Home > Backend Development > PHP Tutorial > nginx installation under linux

nginx installation under linux

WBOY
Release: 2016-08-08 09:31:55
Original
925 people have browsed it

Because the installation of nginx depends on other libraries, you must install the dependent libraries first. The following are the specific steps

http://nginx.org/download/nginx-1.2.8.tar.gz

1. Install the PCRE library
cd /usr/local/
wget ftp://ftp.csx.cam .ac.uk/pub/software/programming/pcre/pcre-8.36.tar.gz
tar -zxvf pcre-8.36.tar.gz
cd pcre-8.36
./configure
make
make install
Note: Because some 64-bit machines need to add a soft link nginx to read it
ln -s /usr/local/lib/libpcre.so.1 /lib64/
2. Install the zlib library
cd /usr/local/
wget http:/ /zlib.net/zlib-1.2.8.tar.gz
tar -zxvf zlib-1.2.8.tar.gz
cd zlib-1.2.8
./configure
make
make install

3. Install ssl
Method one:
yum -y install openssl openssl-devel
Method two:
cd /usr/local/
wget http://www.openssl.org/source/openssl-1.0.1c.tar.gz
tar -zxvf openssl-1.0.1c.tar.gz
./config
make
make install
4. Install nginx
cd /usr/local/
wget http://nginx.org/download/nginx-1.6.2.tar. gz
tar -zxvf nginx-1.6.2.tar.gz
cd nginx-1.6.2
./configure --prefix=/usr/local/nginx-1.6.2 --with-http_ssl_module --with-http_gzip_static_module - -with-openssl=/usr/local/ssl
make
make install
//Establish a soft connection
ln -s /usr/local/nginx-1.6.2 nginx
Note:
--with-http_ssl_module is for configuration The module required for https access

--with-http_gzip_static_module is a static compression module

Start nginx:

/usr/local/nginx/sbin/nginx

Check the configuration file:

/usr/local/nginx/ sbin/nginx -t

Specify the configuration file to start:

/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf

Restart:

/usr/local /nginx/sbin/nginx -s reload

The above introduces the installation of nginx under Linux, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template