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.
If you use compilation and installation, just add the following code directly to /etc/rc.local:
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
If you use yum to install nginx in centos7, there are no related files in/etc/init.d
Start directly with systemctl:
systemctl enable nginx.service
难道不行?会将所有级别生效。或者推荐下载sysv-rc-conf
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'