Home >Backend Development >PHP Tutorial >Steps to install nginx stable version on Ubuntu1404

Steps to install nginx stable version on Ubuntu1404

WBOY
WBOYOriginal
2016-07-29 09:04:261081browse

Because my system has just been installed and there are no packages!

1: First update all packages

<code> sudo apt-get update
</code>

2: Jump to the system’s Downloads folder (I downloaded it under the Downloads folder)

<code>cd /home/用户名/Downloads/
</code>

3: Download the stable version of nginx from the official website

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

4: Unzip

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

5: Enter the unzipped folder

<code>cd nginx-1.8.1
</code>

6: Execute the command

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

7: Re-enter the Downloads folder to download pcre

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

8: Unzip pcre

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

9: Enter the unzipped folder

<code>cd pcre-8.31
</code>

10: Execute the command

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

11: Install g++

<code>sudo apt-get install g++
</code>

12: Re-enter the pcre-8.31 folder and execute the command

<code>./configure
make
sudo make install   报错缺少zlib包
</code>

13: Install the zlib package

<code>sudo apt-get install zlib1g-dev
</code>

14: Re-enter the pcre-8.31 folder and execute the command

<code>./configure
make
sudo make install
</code>

15: Re-enter the nginx-1.8.1 folder to execute the command

<code>./configure
make
sudo make install
</code>

16: Start nginx

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

17: Close nginx

<code>sudo killall -9 nginx
</code>
').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });

The above introduces the steps to install the stable version of nginx on Ubuntu1404, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn