Home  >  Article  >  Backend Development  >  Install nginx under ubuntu12.1

Install nginx under ubuntu12.1

WBOY
WBOYOriginal
2016-08-08 09:28:591083browse

1. Preparation before installation

1) GCC compiler

Execute the following command:

sudo apt-get update 
sudo apt-get install gcc-4.8 
sudo apt-get install g++-4.8
sudo apt-get install gcc-4.8-multilib 
sudo apt-get install g++-4.8-multilib 
sudo apt-get install gcc-4.8-doc 
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 20 
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 20 
sudo update-alternatives --config gcc 
sudo update-alternatives --config g++ 
If there is a missing dependent library during this period, use sudo apt-get install to install it. Then use gcc -v to check whether the installation is successful.

2) The PCRE library

failed during online installation, and then used offline installation. As follows:

sudo wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.36.tar.gz 
sudo tar -xzvf pcre-8.36.tar.gz 
cd /usr/local/src/pcre-8.36 (解压目录)
sudo ./configure 
sudo make 
sudo make install  
3) ZLIB library

Online installation is as follows:

sudo apt-get install zlib1g-dev

Offline installation is as follows:

Download address: http://zlib.net

cd /usr/local/src  
tar -zxvf zlib-1.2.8.tar.gz  
cd zlib-1.2.8  
sudo ./configure  
sudo make  
sudo make install  
4) openssl (online installation available)

Online installation is as follows:

sudo apt-get install openssl 
sudo apt-get install libssl-dev

Offline installation is as follows:

Download address: http://www.openssl.org/source

cd /usr/local/src  
tar -zxvf openssl-1.0.1e.tar.gz  
2, nginx installation
Offline installation:

sudo wget http://nginx.org/download/nginx-1.7.10.tar.gz 
sudo tar -xzvf nginx-1.7.10.tar.gz
cd nginx-1.7.10/
sudo ./configure
sudo make
sudo make install

The above introduces the installation of nginx under ubuntu12.1, 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