Nginx installation details and problem handling in Linux

Linux compilation and installation

1. nginx depends on the prce library, and pcre must be installed first.

 1 #yum install prce pcre-devel 

2. Download and unzip nginx

1 #cd  /usr/local/src/
2 
3 #wget htpp://nginx.org/download/nginx-1.4.2.tar.gz
4 
5 #tar zxvf nginx-1.4.2tar.gz

3. Configure, compile and install

1 #cd nginx-1.4.2
2 
3 # ./configure –prefix=/usr/local/nginx
4 
5 #make && make install

4. Start nginx

1 #cd /usr/local/nginx
2 
3 #./sbin/nginx

If no error message appears, it indicates that the startup was successful.

 

During ./configure, you may encounter "error: the HTTP gzip module requires the zlib library" error prompt;

It means to tell us that there is no support for the zlib library. If we encounter such problems, we only need to install this library.

code show as below:

 1 #yum install -y zlib-devel 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324648510&siteId=291194637