centos7 - centos 7, add nginx to start at boot?
phpcn_u1582
phpcn_u1582 2017-05-16 17:23:57
0
4
826

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.

phpcn_u1582
phpcn_u1582

reply all(4)
滿天的星座

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

黄舟

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
Ty80

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'

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template