In vmware11, install centos 7 minimal, compile and install nginx 1.6.3, and add boot startup. I don’t know why, but it always doesn’t work?
Although centos 7 is managed with systemctl, my mysql and php-fpm can be successful, but nginx just can’t. I don’t know how to do it. Please ask someone.
滿天的星座2017-05-16 17:25:57
If you use compilation and installation, just add the following code directly to /etc/rc.local:
/usr/local/nginx/sbin/nginx
The premise is that your nginx is installed under /usr/local/nginx
In addition, if you use yum to install it, it will start automatically as a server by default. You can use chkconfig to check
黄舟2017-05-16 17:25:57
If you use yum to install nginx in centos7, there are no related files in /etc/init.d
Start directly with systemctl:
sudo systemctl enable nginx
sudo systemctl start nginx
大家讲道理2017-05-16 17:25:57
Start Nginx service automatically after booting:
sudo systemctl enable nginx.service
Tip: ln -s '/usr/lib/systemd/system/nginx.service' '/etc/systemd/system/multi-user.target.wants/nginx.service'