1.创建文件夹 :mkdir nginx

2.解压nginx: tar zxvf nginx.gz.tar

3.nginx 初始化:在nginx的路径下执行:./configure

有可能会报错:

./configure: error: the HTTP rewrite module requires the PCRE library.
You can either disable the module by using --without-http_rewrite_module
option, or install the PCRE library into the system, or build the PCRE library
statically from the source with nginx by using --with-pcre=<path> option.

解决办法:yum -y install pcre-devel ,如果报

执行 sudo apt install yum 还是报错,查找资料后发现在ubuntu中要用apt-get 的方法安装PCRE 依赖包

  sudo apt-get install openssl libssl-dev

  sudo apt-get install libpcre3 libpcre3-dev

sudo make 命令进行编译

sudo make install 安装nginx软件

这是默认安装到user文件夹下

4.nginx的启动与关闭

1.找到默认nginx的安装文件夹 usr/local/sbin 是nginx脚本所在的位置

  nginx -h :查看nginx所有相关命令  nginx 的操作时通过发送信号给进程进行操作

nginx -q  测试配置时只显示错误

nginx -s  SINGLE(信号类型)  向主机进程发送信号   :nginx -s quit 关闭nginx  nginx -s reload 启动nginx

nginx -p :设置nginx服务器路径前缀

nginx -t :检查nginx服务器配置文件是否有语法错误

nginx -c :指定nginx的配置文件

nginx for ubuntu的更多相关文章

  1. [django] Deploy Django Applications Using uWSGI and Nginx on Ubuntu 14.04

    关键点1:chmod-socket=666 (mysite_uwsgi.ini) 关键点2 : 工程目录和虚拟环境目录搞清楚 几个参考: http://uwsgi-docs.readthedocs.i ...

  2. How To Install Nginx on Ubuntu 16.04 zz

    Introduction Nginx is one of the most popular web servers in the world and is responsible for hostin ...

  3. How to install nginx in Ubuntu

    The steps for installing the nginx on Ubuntu below. 1.install the packages first. apt-get install gc ...

  4. nginx 在ubuntu上使用笔记(绑定域名)

    1. 重启nginx的两个语句: sudo service nginx restart sudo nginx -s reload 2. nginx配置文件路径: etc/nginx/ 尤其是 site ...

  5. Django + Gunicorn + Nginx 部署 Ubuntu 服务器

    Django + Gunicorn + Nginx 部署服务器 获取腾讯云 root权限 本人的服务器使用的是腾讯云,腾讯云默认是没有开放 root 用户的,我们来创建 root 用户. 创建 roo ...

  6. nginx 在ubuntu 上的启动,停止,重启

    vi 显示行号 :set num 在开始玩nginx之前,得先安装nginx,可以参考 <ubuntu15.10_x64 安装 nginx>   启动 sudo /usr/local/ng ...

  7. Build Laravel Blog PigJian by PHP7 and Nginx on Ubuntu

    Recently, I found an interesting framework Laravel written by PHP. i have never used PHP to write an ...

  8. Install nginx on ubuntu

    1. Install libpcre3, libpcre3-dev2. Install zlib1g-dev3. Download nginx and unzip it4. ./configure5. ...

  9. 在Ubuntu 12.4 下安装 nginx, MySQL, PHP

    LNMP是时下很流行的网站配置,我在配置蝉大师服务器的时候顺带把经验做个分享,蝉大师的网址是:http://www.ddashi.com/ 1.第一步, 跟新apt-get 输入: sudo apt- ...

随机推荐

  1. 小贝_mysql优化学习

    mysql优化 简要: 1.数据库设计优化 2.sql语句优化 3.表切割 4.读写分离技术 一.数据库设计优化 1.表设计要符合三范式.当然,有时也须要适当的逆范式 2.什么是三范式 一范式: 具有 ...

  2. 【小技能】如何检索苹果APP

    有时候要临时在PC上查询一下苹果APP的信息,但是又没有安装itunes软件,那么你可以在必应里面使用类似如下的语句,例如来搜索“aboboo site:itunes.apple.com”,就可以搜索 ...

  3. oracle 10g的备份和还原

    采用 expdp备份,impdp还原. 注意这二者不等同于exp和imp.oracle 10g以前,可以采用exp.imp,10g及以后,expdp + impdp矣.据说10g里面,如果采用exp, ...

  4. unix2dos/dos2unix

    dos2unix命令用来将DOS格式的文本文件转换成UNIX格式的(DOS/MAC to UNIX text file format converter).DOS下的文本文件是以\r\n作为断行标志的 ...

  5. AOP 基本术语及其在 Spring 中的实现

    无论是 Spring 还是其他支持 AOP(Aspect Oriented Programming)的框架,尤其是 Spring 这种基于 Java(彻底的面向对象)的语言,在实现 AOP 时,首先为 ...

  6. Mybatis用到的设计模式和常用类原理

    功能:将java对象映射城sql语句,将结果集转化成java对象.将容易变化的放在配置文件中,不变的通过Mybatis管理. 完成:1.根据JDBC规范建立数据库的连接: 2.通过反射打通java对象 ...

  7. BZOJ_2081_[Poi2010]Beads_哈希

    BZOJ_2081_[Poi2010]Beads_哈希 Description Zxl有一次决定制造一条项链,她以非常便宜的价格买了一长条鲜艳的珊瑚珠子,她现在也有一个机器,能把这条珠子切成很多块(子 ...

  8. 使用Python操作Redis应用场景

    1. 安装pyredis 首先安装pip   1 2 3 4 5 6 7 8 <SHELL># apt-get install python-pip ...... <SHELL> ...

  9. Consistent Hashing算法

    前几天看了一下Memcached,看到Memcached的分布式算法时,知道了一种Consistent Hashing的哈希算法,上网搜了一下,大致了解了一下这个算法,做下记录. 数据均衡分布技术在分 ...

  10. bzoj1046 [HAOI2007]上升序列——LIS

    题目:https://www.lydsy.com/JudgeOnline/problem.php?id=1046 倒序求最长下降子序列,则得到了每个点开始的最长上升子序列: 然后贪心输出即可. 代码如 ...