We are happy to announce that Vesta is back under active development as of 25 February 2024. We are working on v1 candidate and expect to engage more with the community over the coming months. We are committed to open source, and we encourage contributors to help us build the future of Vesta.
NGINX and HTTPD not starting at reboot
-
- Posts: 4
- Joined: Tue Dec 20, 2016 5:00 pm
NGINX and HTTPD not starting at reboot
New install of VestaCP. NGINX and HTTPD can start after server reboot. I have to manually restart the services. I run chkconfig nginx on and chkconfig httpd on, but with no help.
Anyone?
Anyone?
-
- Posts: 12
- Joined: Tue Oct 18, 2016 10:14 am
Re: NGINX and HTTPD not starting at reboot
Actually, I'm experiencing the same problem. And it's not just after reboots, it happens on it's own, possibly right after automatic updates. Anyone else have this issue? When I fist saw it I though it could be a problem with multiple applications attempting to control a single port. Port 80 to be specific. Like Apache has a default config attemtping to grab port 80 while Ngenix is wants that port too. As a result neither start. BUT that's just a guess.
Re: NGINX and HTTPD not starting at reboot
Try to add to /etc/rc.local these lines:
Code: Select all
sleep 3
service nginx restart
service nginx httpd
Re: NGINX and HTTPD not starting at reboot
============================================================================================
nginx
1.Edit nginx service:
2. Change this:
To this:
============================================================================================
Apache
1. Edit apache service (modify "httpd" for your Apache name service):
2. Do the same changes as nginx.
============================================================================================
Reboot your server.
nginx
1.Edit nginx service:
Code: Select all
nano /etc/systemd/system/multi-user.target.wants/nginx.service
Code: Select all
After=nss-lookup.target remote-fs.target
Code: Select all
After=network-online.target remote-fs.target nss-lookup.target
Wants=network-online.target
Apache
1. Edit apache service (modify "httpd" for your Apache name service):
Code: Select all
nano /etc/systemd/system/multi-user.target.wants/httpd.service
2. Do the same changes as nginx.
============================================================================================
Reboot your server.
Re: NGINX and HTTPD not starting at reboot
Thanks! It worked for me, but after this changes i got error when trying to restart httpd:Trentor wrote:============================================================================================
nginx
1.Edit nginx service:
2. Change this:Code: Select all
nano /etc/systemd/system/multi-user.target.wants/nginx.service
To this:Code: Select all
After=nss-lookup.target remote-fs.target
============================================================================================Code: Select all
After=network-online.target remote-fs.target nss-lookup.target Wants=network-online.target
Apache
1. Edit apache service (modify "httpd" for your Apache name service):
Code: Select all
nano /etc/systemd/system/multi-user.target.wants/httpd.service
2. Do the same changes as nginx.
============================================================================================
Reboot your server.
[root@web]# service httpd restart
env: /etc/init.d/httpd: Permission denied
and file /etc/init.d/httpd and /etc/rc.d/init.d is empty (CentOS 7)
may be i do some thing else
when i rebooting the server all starts ok, bun not restarting. start and stop httpd not working too :(
command systemctl restart httpd works fine
Re: NGINX and HTTPD not starting at reboot
try rebuilding all users.
and post output of this command
and post output of this command
Code: Select all
nginx -t -c /etc/nginx/nginx.conf
Re: NGINX and HTTPD not starting at reboot
I rebuild all users and still have problem with HTTPD servicevikhyat wrote:try rebuilding all users.
and post output of this commandCode: Select all
nginx -t -c /etc/nginx/nginx.conf
Code: Select all
[root@web ~]# nginx -t -c /etc/nginx/nginx.conf
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
Re: NGINX and HTTPD not starting at reboot
Can anyone show /etc/rc.d/init.d/httpd for centos 7, apache 2.4.6?
mine is empty :(
mine is empty :(
Re: NGINX and HTTPD not starting at reboot
Centos 7 use systemd so you not have /etc/init.d/httpd this is not used
Re: NGINX and HTTPD not starting at reboot
Yes, it works wonderfully for Centos 8dpeca wrote: ↑Wed Dec 28, 2016 2:06 amTry to add to /etc/rc.local these lines:Code: Select all
sleep 3 service nginx restart service nginx httpd
Can be executed on the command line.
Code: Select all
echo "sleep 3 && systemctl restart nginx && systemctl restart httpd" >> /etc/rc.local