Nginx is a very powerful, high-performance Web and reverse proxy service
*It has many very superior features: In the case of high concurrency of connections, Nginx is** A good alternative to Apache service
Nginx is one of the software platforms often chosen by virtual host business owners in the United States.
Download it and transfer it to the server. The first step is to decompress
tar -zxvf nginx-1.13.1.tar.gz
Enter the directory of nginx-1.13.1 and view The following file
found that nginx is released through the source package, and nginx is written in C, so a c/c compiler needs to be installed
yum install gcc
## As above, gcc has been installed, let’s install nginx At the end of the detection, it was found that the dependent pcre library was not available. Let’s install pcrehttps://ftp.pcre.org/pub/pcre/After downloading pcre, you will also need to decompress the tar.gz file first. tar -zxvf pcre-8.00.tar.gz
After decompression, there are the following files, which are still source code installations
##It says that we can't find g, let's install g
yum install gcc-c
Come back and continue to install pcre
./configure
make install
pcre installation is complete, go back and install nginx
Zlib is missing, we need to install zlib again
http://www.zlib.net/
zlib is also managed by tar.gz, unzip it first
I found that zlib is also managed by the source code package, to install zlib
./configure
make install
After the installation is completed, install nginx
./configure
make install
This time the installation was finally successful. The software is installed to
/usr/local/nginx
Start nginx
./usr/local/nginx/sbin/nginx
Access nginx (ip address: 192.168.100.100, port number: 80)
http://192.168.100.100:8080/
nginx is installed successfully.
The above is the detailed content of How to install and use nginx in Linux system. For more information, please follow other related articles on the PHP Chinese website!