NginxThe server will not go into details. In the case of high traffic and high concurrency, this software has superior performance and extremely low CPU and memory resources!
Check whether there is a PCRE Library. If not, install it because the rewrite module of nginx needs it.
[Plain]View plaincopyprint?
- Yum-y install PCRE-devel
yum -y install pcre pcre-devel
Install nginx as follows:
[Plain]View plaincopyprint?
- Wget http://nginx.org/download/nginx-1.0.2.tar.gz
- Tar zxvf nginx-1.0.2.tar.gz
- CD nginx-1.0.2
- ./Configure -- prefix =/usr/local/nginx
- Make
- Make install
wget http://nginx.org/download/nginx-1.0.2.tar.gztar zxvf nginx-1.0.2.tar.gzcd nginx-1.0.2./configure --prefix=/usr/local/nginxmakemake install
Of course, you can also choose a simpler installation method:
[Plain]View plaincopyprint?
- Yum install nginx
yum install nginx
After the installation is complete, perform the following operations on nginx:
[Plain]View plaincopyprint?
- /Usr/local/nginx/sbin/nginx start nginx
- /Usr/local/nginx/sbin/nginx-S Stop nginx
- /Usr/local/nginx/sbin/nginx-s reload restart nginx
/Usr/local/nginx/sbin/nginx start nginx/usr/local/nginx/sbin/nginx-S Stop nginx/usr/local/nginx/sbin/nginx-s reload restart nginx
Enter:
[Plain]View plaincopyprint?
- Http: // 127.0.0.1 or http: // localhost
Http: // 127.0.0.1 or http: // localhost
Page display"OK", Indicating that the installation is successful!
For more information about the nginx configuration file, refer to the nginx official website documentation and configure your own configuration!