You cannot directly use yum install nginx to install on centos
I used the rpm installation package.
nginx download URL: http://nginx.org/packages/centos/6/x86_64/RPMS/nginx-1.8.1-1.el6.ngx.x86_64.rpm Choose the appropriate version
Installation Guide CentOS 6.4 Quickly install Nginx http://blog.sina.com.cn/s/blog_586c261a0101i1eu.html
Some configurations after installation, please check if needed:
http://www.server110.com/nginx/201309/981.html
http://liuyu.blog.51cto.com/183345/166381/
I didn't use it anyway. It also feels a bit old
I installed gitlab at the same time, and its installation package also has nginx plug-in, which caused the default port 80 to be occupied.
So you need to modify the nginx configuration file:
vi /etc/nginx/conf.d/default.conf
Modify port 80, and then
/etc/init.d/nginx restart Restart
At the same time, add the new port to the firewall:
vi /etc/sysconfig/iptables
Add port
-A INPUT -m state –state NEW -m tcp -p tcp –dport 88 -j ACCEPT
Restart the firewall:
service iptables restart
nginx forgets the root password and does not have an email to reset, please refer to:
http://www.blogjava.net/Nirvana/archive/2014/03/28/411606.htmlReset password
nginx official website documentation:
http://nginx.org/en/docs/
The above introduces the installation of nginx on centos, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.