当前位置:Gxlcms > PHP教程 > Ubuntu1404安装nginx稳定版本步骤

Ubuntu1404安装nginx稳定版本步骤

时间:2021-07-01 10:21:17 帮助过:16人阅读

因为我的系统是刚装的,什么包都没有!

1:首先更新所有的包

  1. <code> sudo apt-get update
  2. </code>

2:跳转到系统的Downloads文件夹(我是下载到Downloads文件夹下面)

  1. <code>cd /home/用户名/Downloads/
  2. </code>

3:从官网下载稳定版本的nginx

  1. <code>wget http://nginx.org/download/nginx-1.8.1.tar.gz
  2. </code>

4:解压

  1. <code>tar zxvf nginx-1.8.1.tar.gz
  2. </code>

5:进入解压过得文件夹

  1. <code>cd nginx-1.8.1
  2. </code>

6:执行命令

  1. <code>./configure
  2. 发现报错 原因是缺少pcre library
  3. </code>

7:重新进入Downloads文件夹下载pcre

  1. <code>wegt http://sourceforge.net/projects/pcre/files/pcre/8.31/pcre-8.31.tar.gz
  2. </code>

8:解压pcre

  1. <code>tar zxvf pcre-8.31.tar.gz
  2. </code>

9:进入解压过得文件夹

  1. <code>cd pcre-8.31
  2. </code>

10:执行命令

  1. <code>./configure 这句成功
  2. make 这句会报错,编译不通过,所以需要安装g++
  3. </code>

11:安装g++

  1. <code>sudo apt-get install g++
  2. </code>

12:重新进入pcre-8.31文件夹并执行命令

  1. <code>./configure
  2. make
  3. sudo make install 报错缺少zlib包
  4. </code>

13:安装zlib包

  1. <code>sudo apt-get install zlib1g-dev
  2. </code>

14:重新进入pcre-8.31文件夹并执行命令

  1. <code>./configure
  2. make
  3. sudo make install
  4. </code>

15:重新进入nginx-1.8.1文件夹执行命令

  1. <code>./configure
  2. make
  3. sudo make install
  4. </code>

16:启动nginx

  1. <code>sudo /usr/local/nginx/sbin/nginx
  2. 启动成功之后登陆localhost看看是否安装成功!http://localhost:80
  3. </code>

17:关闭nginx

  1. <code>sudo killall -9 nginx
  2. </code>

').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i <= lines; i++) { $numbering.append($('
  • ').text(i)); }; $numbering.fadeIn(1700); }); });

    以上就介绍了Ubuntu1404安装nginx稳定版本步骤,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

  • 人气教程排行