Download the installation package http://nginx.org/packages/centos/6/x86_64/RPMS/ or http://nginx.org/packages/mainline/centos/6/x86_64/RPMS/ to install various versions of nginx downstream. Package
Install rpm -i xxx.rpm
After installation, an nginx user will be created, and nginx will be installed as a service
Switch to the nginx user and execute service nginx start
Note that if you do not use nginx to start, you must modify it. nginx configuration file, and change the owner of the temporary file generated by nginx to the user who started nginx
For example, to start nginx with root
vi /etc/nginx/nginx.conf
Change user nginx to user root root
Modify temporary file owner
chown -R root /var/cache/nginx/
Delete pid file
rm -f /var/run/nginx.pid
Start
service nginx start
The above introduces the installation of nginx on centos6, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.