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. gvoory脚本中关于HttpClient使用详解实例

    一.gvoory脚本中关于HttpClient使用详解实例 HttpClient:是一个接口 首先需要先创建一个DefaultHttpClient的实例 HttpClient httpClient=n ...

  2. jsp引用JSTL核心标签库

    一.引用JSTL 1.  JSTL的引入可以让JSP代码中<%%>等代码消失掉,再结合EL表达式,会更加方便以及美观. 2.  各套框架(还没有学习,比如struts,SpringMVC等 ...

  3. 安全相关的head头

    与安全相关的head头包括 参考网站:https://developer.mozilla.org/en-US/docs/Web/HTTP Content-Security-Policy(CSP):禁止 ...

  4. The uWSGI project aims at developing a full stack for building hosting services.

    https://github.com/unbit/uwsgi-docs/blob/master/index.rst

  5. jquery ajax 回调函数

    function test(callback){ $.ajax({ url:'/mall/credit', type: 'get', dataType:'json', processData: fal ...

  6. mongo03

    Mongo存储的单位是文档,文档是js对象, use test2 db.createCollection("stu")//隐士创建库显示创建表 db.stu.,name:" ...

  7. bzoj4593: [Shoi2015]聚变反应炉

    这道题的难点其实是在设DP方程,见过就应该会了 令f0,i表示先激发i的父亲,再激发i,把i的整棵子树都激发的最小费用 f1,i表示先激发i,再激发i的父亲,把i的整棵子树都激发的最小费用 设x,y为 ...

  8. evm指令集手册

    evm指令集手册 Opcodes 结果列为"-"表示没有运算结果(不会在栈上产生值),为"*"是特殊情况,其他都表示运算产生唯一值,并放在栈顶. mem[a.. ...

  9. HDU - 2063 过山车(最大匹配数)(模板)

    1.男生女生一起坐过山车,每一排有两个座位,但是有个条件,就是每个女生必须找个男生做同伴一起(但是女生只愿意和某几个男生中的一个做同伴),求最多可以有多少对男女生组合坐上过山车. 2.二分图的最大匹配 ...

  10. Goland软件使用教程(一)

    Goland软件使用教程(一)      Goland是由JetBrains公司旨在为go开发者提供的一个符合人体工程学的新的商业IDE.这个IDE整合了IntelliJ平台的有关go语言的编码辅助功 ...