Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section Web Server
  • Search

Process Stopped on boot

Questions regarding the Web Server
Apache + Nginx, Nginx + PHP5-FPM
Post Reply
  • Print view
Advanced search
16 posts
  • 1
  • 2
  • Next
Ocrion
Posts: 11
Joined: Tue Nov 12, 2013 6:31 pm

Process Stopped on boot
  • Quote

Post by Ocrion » Fri Nov 15, 2013 2:42 pm

Hello!

For no reason at all whenever I start my server Nginx and Apache2 wont start automatically.

Image (They are able to start when I manually click on the start button or write service apache2 start in the console it's pretty annoying to do it manually all the time).

Apache2 Error (The one causing it not to start I believe)
[Tue Nov 12 17:57:26 2013] [notice] Graceful restart requested, doing restart
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
[Tue Nov 12 17:57:26 2013] [warn] NameVirtualHost 192.168.0.105:8443 has no VirtualHosts
And for Nginx:
2013/11/15 15:34:29 [emerg] 2340#0: bind() to 192.168.0.105:80 failed (99: Cannot assign requested address)
Any tips?

Regards,
Ocrion.
Top

skid
VestaCP Team
Posts: 1476
Joined: Wed Apr 06, 2011 11:12 pm

Re: Process Stopped on boot
  • Quote

Post by skid » Fri Nov 15, 2013 7:22 pm

While apache error message doesn't looks serious, error from nginx does.
First of all make sure you have init script right in place and number in the apache script is higher than in nginx.

Code: Select all

root@adm:~# ls /etc/rc3.d/|grep -e "apache" -e "nginx"
S20nginx
S91apache2
Top

Ocrion
Posts: 11
Joined: Tue Nov 12, 2013 6:31 pm

Re: Process Stopped on boot
  • Quote

Post by Ocrion » Tue Nov 19, 2013 10:38 am

skid wrote:While apache error message doesn't looks serious, error from nginx does.
First of all make sure you have init script right in place and number in the apache script is higher than in nginx.

Code: Select all

root@adm:~# ls /etc/rc3.d/|grep -e "apache" -e "nginx"
S20nginx
S91apache2
Hello!

Back from the weekend, this is the output I got.

Code: Select all

root@purushost:~# ls /etc/rc3.d/|grep -e "apache" -e "nginx"
S01nginx
S03apache2
But this time Apache2 were able to start by it self, but not Nginx. It's like random if it starts or not.
Top

skid
VestaCP Team
Posts: 1476
Joined: Wed Apr 06, 2011 11:12 pm

Re: Process Stopped on boot
  • Quote

Post by skid » Tue Nov 19, 2013 5:56 pm

2013/11/15 15:34:29 [emerg] 2340#0: bind() to 192.168.0.105:80 failed (99: Cannot assign requested address)
This means that someone is using port 80 and nginx can't bind it. It might be a cron task which is trying to fetch data from webser like wget http://localhost/something
Top

Ocrion
Posts: 11
Joined: Tue Nov 12, 2013 6:31 pm

Re: Process Stopped on boot
  • Quote

Post by Ocrion » Tue Nov 19, 2013 7:03 pm

But I haven't added any cron jobs other than the defaults that comes with vestaCP?
Top

skid
VestaCP Team
Posts: 1476
Joined: Wed Apr 06, 2011 11:12 pm

Re: Process Stopped on boot
  • Quote

Post by skid » Tue Nov 19, 2013 9:50 pm

As a quick workaround try this

Code: Select all

echo "service nginx restart" >> /etc/rc.local
Top

Ocrion
Posts: 11
Joined: Tue Nov 12, 2013 6:31 pm

Re: Process Stopped on boot
  • Quote

Post by Ocrion » Wed Nov 20, 2013 11:13 am

skid wrote:As a quick workaround try this

Code: Select all

echo "service nginx restart" >> /etc/rc.local
That did not work. I tried to make it start with Crontab as well but without success...

Code: Select all

@reboot         root    /usr/bin/sleep 30 && /etc/init.d/nginx start
@reboot         root    /usr/bin/sleep 35 && /etc/init.d/apache2 start

Output:
Nov 20 12:10:08 purushost /usr/sbin/cron[3402]: (CRON) INFO (Running @reboot jobs)
Nov 20 12:10:11 purushost /USR/SBIN/CRON[3882]: (root) CMD (/usr/bin/sleep 35 && /etc/init.d/apache2 start)
Nov 20 12:10:11 purushost /USR/SBIN/CRON[3883]: (root) CMD (/usr/bin/sleep 30 && /etc/init.d/nginx start)
The sleep was just a test to see if it had to wait a few seconds before starting them. Arrgh... :(
Top

skid
VestaCP Team
Posts: 1476
Joined: Wed Apr 06, 2011 11:12 pm

Re: Process Stopped on boot
  • Quote

Post by skid » Wed Nov 20, 2013 9:08 pm

Can you check who is listening on port 80?

Code: Select all

lsof -itcp:80
Top

Ocrion
Posts: 11
Joined: Tue Nov 12, 2013 6:31 pm

Re: Process Stopped on boot
  • Quote

Post by Ocrion » Wed Nov 20, 2013 10:10 pm

skid wrote:Can you check who is listening on port 80?

Code: Select all

lsof -itcp:80
Sure!

Output:

Code: Select all

root@purushost:~# lsof -itcp:80
COMMAND  PID     USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
nginx   5517     root   17u  IPv4  11645      0t0  TCP purushost.local:http (LISTEN)
nginx   5518 www-data   17u  IPv4  11645      0t0  TCP purushost.local:http (LISTEN)
nginx   5519 www-data   17u  IPv4  11645      0t0  TCP purushost.local:http (LISTEN)
But that is when I've manually restarted Apache2 and Nginx. When I just rebooted it was an empty output.
Top

skid
VestaCP Team
Posts: 1476
Joined: Wed Apr 06, 2011 11:12 pm

Re: Process Stopped on boot
  • Quote

Post by skid » Wed Nov 20, 2013 10:24 pm

Do you still see "(99: Cannot assign requested address)" in the error log? If yes then something is definitely listening on a port 80 and right before nginx starts. Or maybe ip is not yet initialized. You can get some info by by adding following into rc.local file

Code: Select all

ifconfig >> /tmp/debug.log
lsof -itcp:80  >> /tmp/debug.log
Top


Post Reply
  • Print view

16 posts
  • 1
  • 2
  • Next

Return to “Web Server”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password