nginx and apache won't start after reboot
nginx and apache won't start after reboot
Don't know if that has anything to do with this but I just edited the hosts - file and rebooted.
In the Vesta CP admin server apache, nginx, spamasassin, iptables is greyed out.
*** Hosts-file ***
127.0.0.1 localhost.omail.no localhost
127.0.1.1 omail
31.24.132.23 omail.no
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
*** Apache status ***
root@omail:/home/oystein# /etc/init.d/apache2 status
● apache2.service - LSB: Apache2 web server
Loaded: loaded (/etc/init.d/apache2)
Active: active (exited) since Wed 2016-05-11 19:17:58 CEST; 13min ago
Process: 534 ExecStart=/etc/init.d/apache2 start (code=exited, status=0/SUCCESS)
May 11 19:17:58 omail.no apache2[534]: Starting web server: apache2AH00557: apache2: apr_sockaddr_info_get() failed for omail.no
May 11 19:17:58 omail.no apache2[534]: AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
May 11 19:17:58 omail.no apache2[534]: (99)Cannot assign requested address: AH00072: make_sock: could not bind to address 31.24.132.23:8080
May 11 19:17:58 omail.no apache2[534]: no listening sockets available, shutting down
May 11 19:17:58 omail.no apache2[534]: AH00015: Unable to open logs
May 11 19:17:58 omail.no apache2[534]: Action 'start' failed.
May 11 19:17:58 omail.no apache2[534]: The Apache error log may have more information.
*** nginx status ***
root@omail:/etc# /etc/init.d/nginx status
● nginx.service - LSB: Stop/start nginx
Loaded: loaded (/etc/init.d/nginx)
Active: failed (Result: exit-code) since Wed 2016-05-11 19:17:56 CEST; 16min ago
Process: 535 ExecStart=/etc/init.d/nginx start (code=exited, status=1/FAILURE)
May 11 19:17:56 omail.no nginx[535]: nginx: [emerg] bind() to 31.24.132.23:80 failed (99: Cannot assign requested address)
May 11 19:17:56 omail.no systemd[1]: nginx.service: control process exited, code=exited status=1
May 11 19:17:56 omail.no systemd[1]: Failed to start LSB: Stop/start nginx.
May 11 19:17:56 omail.no systemd[1]: Unit nginx.service entered failed state.
*** NETSTAT port 80 ****
root@omail:/etc# netstat -tunlp | grep 80
tcp 0 0 0.0.0.0:8083 0.0.0.0:* LISTEN 593/vesta-nginx
*** TEST CONFIG ****
root@omail:/etc# service nginx configtest
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is succes
root@omail:/etc# apachectl configtest
Syntax OK
***************
I can manually start nginx server (and iptables) from VestaCP with no issues.
but Apache won't start before I click Restart.
QUESTION: Why isn't these services starting when server boots? I really need to fix this.
In the Vesta CP admin server apache, nginx, spamasassin, iptables is greyed out.
*** Hosts-file ***
127.0.0.1 localhost.omail.no localhost
127.0.1.1 omail
31.24.132.23 omail.no
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
*** Apache status ***
root@omail:/home/oystein# /etc/init.d/apache2 status
● apache2.service - LSB: Apache2 web server
Loaded: loaded (/etc/init.d/apache2)
Active: active (exited) since Wed 2016-05-11 19:17:58 CEST; 13min ago
Process: 534 ExecStart=/etc/init.d/apache2 start (code=exited, status=0/SUCCESS)
May 11 19:17:58 omail.no apache2[534]: Starting web server: apache2AH00557: apache2: apr_sockaddr_info_get() failed for omail.no
May 11 19:17:58 omail.no apache2[534]: AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
May 11 19:17:58 omail.no apache2[534]: (99)Cannot assign requested address: AH00072: make_sock: could not bind to address 31.24.132.23:8080
May 11 19:17:58 omail.no apache2[534]: no listening sockets available, shutting down
May 11 19:17:58 omail.no apache2[534]: AH00015: Unable to open logs
May 11 19:17:58 omail.no apache2[534]: Action 'start' failed.
May 11 19:17:58 omail.no apache2[534]: The Apache error log may have more information.
*** nginx status ***
root@omail:/etc# /etc/init.d/nginx status
● nginx.service - LSB: Stop/start nginx
Loaded: loaded (/etc/init.d/nginx)
Active: failed (Result: exit-code) since Wed 2016-05-11 19:17:56 CEST; 16min ago
Process: 535 ExecStart=/etc/init.d/nginx start (code=exited, status=1/FAILURE)
May 11 19:17:56 omail.no nginx[535]: nginx: [emerg] bind() to 31.24.132.23:80 failed (99: Cannot assign requested address)
May 11 19:17:56 omail.no systemd[1]: nginx.service: control process exited, code=exited status=1
May 11 19:17:56 omail.no systemd[1]: Failed to start LSB: Stop/start nginx.
May 11 19:17:56 omail.no systemd[1]: Unit nginx.service entered failed state.
*** NETSTAT port 80 ****
root@omail:/etc# netstat -tunlp | grep 80
tcp 0 0 0.0.0.0:8083 0.0.0.0:* LISTEN 593/vesta-nginx
*** TEST CONFIG ****
root@omail:/etc# service nginx configtest
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is succes
root@omail:/etc# apachectl configtest
Syntax OK
***************
I can manually start nginx server (and iptables) from VestaCP with no issues.
but Apache won't start before I click Restart.
QUESTION: Why isn't these services starting when server boots? I really need to fix this.
Re: nginx and apache won't start after reboot
So if you edit hosts and reboot and this broke something, just revert changes :)
I think apache cant listen in your IP 31.24.132.23
Edit your hosts again or check if in that IP are something more on port 8080.
If you want apps start on boot you can use chkconfig tool https://access.redhat.com/documentation ... onfig.html
This working on centos 6, debian, ubuntu etc, may not working on systems whit systemd
Whit systemd (centos7) you need run
I think apache cant listen in your IP 31.24.132.23
Code: Select all
Cannot assign requested address: AH00072: make_sock: could not bind to address 31.24.132.23:8080
If you want apps start on boot you can use chkconfig tool https://access.redhat.com/documentation ... onfig.html
This working on centos 6, debian, ubuntu etc, may not working on systems whit systemd
Whit systemd (centos7) you need run
Code: Select all
systemctl enable httpd.service