Page 1 of 2

Apache2 stop working

Posted: Tue Feb 13, 2018 8:01 am
by Spheerys
Hi,

One of my server stop working because an error with Apache2.
When I'm tryning to restart it, I have this error :

Code: Select all

/etc/init.d/apache2 restart
 * Restarting web server apache2                                                                                                                                                        [fail] 
 * The apache2 instance did not start within 20 seconds. Please read the log files to discover problems
On the apache2's error log, I have this :

Code: Select all

[Tue Feb 13 08:14:10.561579 2018] [ssl:warn] [pid 6393] AH02292: Init: Name-based SSL virtual hosts only work for clients with TLS server name indication support (RFC 4366)
[Tue Feb 13 08:14:10.561709 2018] [suexec:notice] [pid 6393] AH01232: suEXEC mechanism enabled (wrapper: /usr/lib/apache2/suexec)
What's going wrong ?

Re: Apache2 stop working

Posted: Tue Feb 13, 2018 12:24 pm
by Spheerys
I have another error message when I try to start apache2 :

Code: Select all

 * Starting web server apache2                                                                                                                                                                 (98)Address already in use: AH00072: make_sock: could not bind to address 127.0.0.1:8081
no listening sockets available, shutting down
AH00015: Unable to open logs
Action 'start' failed.
The Apache error log may have more information.
 * 
 * The apache2 instance did not start within 20 seconds. Please read the log files to discover problems
Another one :

Code: Select all

service apache2 restart 
 * Restarting web server apache2                                                                                                                                                        [fail] 
 * There are processes named 'apache2' running which do not match your pid file which are left untouched in the name of safety, Please review the situation by hand.
I obviously made search on this forum and on Google, but nothing solved my issue.

Few more informations :

Code: Select all

netstat -tulpn | grep --color :80
tcp        0      0 10.2.77.131:80          0.0.0.0:*               LISTEN      3365/nginx.conf 
tcp        0      0 10.2.77.131:8080        0.0.0.0:*               LISTEN      6397/apache2    
tcp        0      0 127.0.0.1:8081          0.0.0.0:*               LISTEN      6397/apache2    
tcp        0      0 0.0.0.0:8083            0.0.0.0:*               LISTEN      4352/vesta-nginx
tcp        0      0 127.0.0.1:8084          0.0.0.0:*               LISTEN      3365/nginx.conf 

Code: Select all

netstat -tulpn | grep --color :443
tcp        0      0 10.2.77.131:443         0.0.0.0:*               LISTEN      3365/nginx.conf 

Re: Apache2 stop working

Posted: Tue Feb 13, 2018 3:28 pm
by mehargags
Try restarting your whole server once... may be the pid is not being released properly.

Re: Apache2 stop working

Posted: Tue Feb 13, 2018 3:30 pm
by Spheerys
I did it but apache2 is still refusing to start !

Re: Apache2 stop working

Posted: Tue Feb 13, 2018 8:06 pm
by Spheerys
It's a very strange error...
I'm still digging and I will be more precise about the problem.

After a reboot, Apache2 doens't start.
If I try to restart it, the error is :

Code: Select all

service apache2 restart
 * Restarting web server apache2                                                                                                                                                                                                                                                                               [fail] 
 * There are processes named 'apache2' running which do not match your pid file which are left untouched in the name of safety, Please review the situation by hand.
So, I get the apache2 pid :

Code: Select all

pidof apache2
I'm killing it :

Code: Select all

kill -9 **PID**
And I restart it again :

Code: Select all

service apache2 restart
After "long time" (10/15 seconds), I get this new error :

Code: Select all

 * Starting web server apache2                                                                                                                             * 
 * The apache2 instance did not start within 20 seconds. Please read the log files to discover problems
And on the apache2's error log I get this :

Code: Select all

[Tue Feb 13 21:00:52.586676 2018] [ssl:warn] [pid 29798] AH02292: Init: Name-based SSL virtual hosts only work for clients with TLS server name indication support (RFC 4366)
[Tue Feb 13 21:00:52.586746 2018] [suexec:notice] [pid 29798] AH01232: suEXEC mechanism enabled (wrapper: /usr/lib/apache2/suexec)

Re: Apache2 stop working

Posted: Tue Feb 13, 2018 8:19 pm
by Spheerys
Here the result of apache2ctl -S :

Code: Select all

VirtualHost configuration:
10.2.77.131:8443       is a NameVirtualHost
         default server domain.fr (/home/Me/conf/web/sapache2.conf:6)
         port 8443 namevhost domain.fr (/home/Me/conf/web/sapache2.conf:6)
                 alias www.domain.fr
         port 8443 namevhost img.domain.fr (/home/Me/conf/web/sapache2.conf:46)
                 alias www.img.domain.fr
         port 8443 namevhost gestion.domain.fr (/home/Me/conf/web/sapache2.conf:86)
                 alias www.gestion.domain.fr
                 alias gestion-domain-fr.server.domain.net
         port 8443 namevhost assets.domain.fr (/home/Me/conf/web/assets.domain.fr.apache2.ssl.conf:1)
                 alias www.assets.domain.fr
         port 8443 namevhost piwik.domain.fr (/home/Me/conf/web/piwik.domain.fr.apache2.ssl.conf:1)
                 alias www.piwik.domain.fr
         port 8443 namevhost todo.domain.fr (/home/Me/conf/web/todo.domain.fr.apache2.ssl.conf:1)
                 alias www.todo.domain.fr
         port 8443 namevhost baikal.domain.fr (/home/Me/conf/web/baikal.domain.fr.apache2.ssl.conf:1)
                 alias www.baikal.domain.fr
         port 8443 namevhost sph.im (/home/Me/conf/web/sph.im.apache2.ssl.conf:1)
                 alias www.sph.im
                 alias sph-im.server.domain.net
         port 8443 namevhost cloud.domain.fr (/home/Me/conf/web/cloud.domain.fr.apache2.ssl.conf:1)
                 alias www.cloud.domain.fr
                 alias cloud-domain-fr.server.domain.net
         port 8443 namevhost pb.domain.fr (/home/Me/conf/web/pb.domain.fr.apache2.ssl.conf:1)
                 alias www.pb.domain.fr
                 alias pb-domain-fr.server.domain.net
         port 8443 namevhost servermon.domain.fr (/home/Me/conf/web/servermon.domain.fr.apache2.ssl.conf:1)
                 alias www.servermon.domain.fr
                 alias monit.domain.fr
                 alias servermon-domain-fr.server.domain.net
10.2.77.131:8080       is a NameVirtualHost
         default server server (/home/admin/conf/web/apache2.conf:1)
         port 8080 namevhost server (/home/admin/conf/web/apache2.conf:1)
                 alias www.server
         port 8080 namevhost domain.fr (/home/Me/conf/web/apache2.conf:1)
                 alias www.domain.fr
         port 8080 namevhost assets.domain.fr (/home/Me/conf/web/apache2.conf:35)
                 alias www.assets.domain.fr
         port 8080 namevhost piwik.domain.fr (/home/Me/conf/web/apache2.conf:69)
                 alias www.piwik.domain.fr
         port 8080 namevhost img.domain.fr (/home/Me/conf/web/apache2.conf:103)
                 alias www.img.domain.fr
         port 8080 namevhost perou.domain.fr (/home/Me/conf/web/apache2.conf:137)
                 alias www.perou.domain.fr
         port 8080 namevhost todo.domain.fr (/home/Me/conf/web/apache2.conf:171)
                 alias www.todo.domain.fr
         port 8080 namevhost baikal.domain.fr (/home/Me/conf/web/apache2.conf:205)
                 alias www.baikal.domain.fr
         port 8080 namevhost sph.im (/home/Me/conf/web/apache2.conf:239)
                 alias www.sph.im
                 alias sph-im.server.domain.net
         port 8080 namevhost cloud.domain.fr (/home/Me/conf/web/apache2.conf:273)
                 alias www.cloud.domain.fr
                 alias cloud-domain-fr.server.domain.net
         port 8080 namevhost pb.domain.fr (/home/Me/conf/web/apache2.conf:307)
                 alias www.pb.domain.fr
                 alias pb-domain-fr.server.domain.net
         port 8080 namevhost servermon.domain.fr (/home/Me/conf/web/apache2.conf:341)
                 alias www.servermon.domain.fr
                 alias monit.domain.fr
                 alias servermon-domain-fr.server.domain.net
         port 8080 namevhost gestion.domain.fr (/home/Me/conf/web/apache2.conf:375)
                 alias www.gestion.domain.fr
                 alias gestion-domain-fr.server.domain.net
         port 8080 namevhost gite-.com (/home/CV/conf/web/gite-.com.apache2.conf:1)
                 alias www.gite-toto.com
                 alias gite-toto-com.server.domain.net
         port 8080 namevhost sarah.domain.fr (/home/Me/conf/web/sarah.domain.fr.apache2.conf:1)
                 alias www.sarah.domain.fr
                 alias sarah-domain-fr.server.domain.net
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex ssl-stapling: using_defaults
Mutex proxy: using_defaults
Mutex ssl-cache: using_defaults
Mutex default: dir="/var/run/apache2/" mechanism=default 
Mutex mpm-accept: using_defaults
Mutex fcgid-pipe: using_defaults
Mutex watchdog-callback: using_defaults
Mutex rewrite-map: using_defaults
Mutex fcgid-proctbl: using_defaults
PidFile: "/var/run/apache2/apache2.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="www-data" id=33
Group: name="www-data" id=33
I have switch on the debug log on apache2.conf just in case :

Code: Select all

[Tue Feb 13 21:34:36.335422 2018] [pagespeed:info] [pid 2298] [mod_pagespeed 1.13.35.2-0 @2298] SharedMemCache: pagespeed_default_shm/metadata_cache, sectors = 128, entries/sector = 2226,  64-byte blocks/sector = 4452, total footprint: 52445184
[Tue Feb 13 21:34:36.338230 2018] [pagespeed:info] [pid 2298] [mod_pagespeed 1.13.35.2-0 @2298] Initializing shared memory for path: /var/cache/mod_pagespeed/ flush .
[Tue Feb 13 21:34:36.339109 2018] [ssl:debug] [pid 2298] ssl_engine_pphrase.c(181): AH02199: SSL not enabled on vhost server.domain.net:80, skipping SSL setup
[Tue Feb 13 21:34:36.339547 2018] [ssl:debug] [pid 2298] ssl_engine_pphrase.c(239): AH02202: Init: Read server certificate from '/home/Me/conf/web/ssl.servermon.domain.fr.crt'
[Tue Feb 13 21:34:36.340078 2018] [ssl:debug] [pid 2298] ssl_engine_pphrase.c(239): AH02202: Init: Read server certificate from '/home/Me/conf/web/ssl.pb.domain.fr.crt'
[Tue Feb 13 21:34:36.340528 2018] [ssl:debug] [pid 2298] ssl_engine_pphrase.c(239): AH02202: Init: Read server certificate from '/home/Me/conf/web/ssl.cloud.domain.fr.crt'
[Tue Feb 13 21:34:36.341001 2018] [ssl:debug] [pid 2298] ssl_engine_pphrase.c(239): AH02202: Init: Read server certificate from '/home/Me/conf/web/ssl.test.com.crt'
[Tue Feb 13 21:34:36.341444 2018] [ssl:debug] [pid 2298] ssl_engine_pphrase.c(239): AH02202: Init: Read server certificate from '/home/Me/conf/web/ssl.baikal.domain.fr.crt'
[Tue Feb 13 21:34:36.341925 2018] [ssl:debug] [pid 2298] ssl_engine_pphrase.c(239): AH02202: Init: Read server certificate from '/home/Me/conf/web/ssl.todo.domain.fr.crt'
[Tue Feb 13 21:34:36.342418 2018] [ssl:debug] [pid 2298] ssl_engine_pphrase.c(239): AH02202: Init: Read server certificate from '/home/Me/conf/web/ssl.piwik.domain.fr.crt'
[Tue Feb 13 21:34:36.342852 2018] [ssl:debug] [pid 2298] ssl_engine_pphrase.c(239): AH02202: Init: Read server certificate from '/home/Me/conf/web/ssl.assets.domain.fr.crt'
[Tue Feb 13 21:34:36.343312 2018] [ssl:debug] [pid 2298] ssl_engine_pphrase.c(239): AH02202: Init: Read server certificate from '/home/Me/conf/web/ssl.gestion.domain.fr.crt'
[Tue Feb 13 21:34:36.343788 2018] [ssl:debug] [pid 2298] ssl_engine_pphrase.c(239): AH02202: Init: Read server certificate from '/home/Me/conf/web/ssl.img.domain.fr.crt'
[Tue Feb 13 21:34:36.344211 2018] [ssl:debug] [pid 2298] ssl_engine_pphrase.c(239): AH02202: Init: Read server certificate from '/home/Me/conf/web/ssl.domain.fr.crt'
[Tue Feb 13 21:34:36.347086 2018] [ssl:info] [pid 2298] AH01887: Init: Initializing (virtual) servers for SSL
[Tue Feb 13 21:34:36.356712 2018] [ssl:debug] [pid 2298] ssl_engine_init.c(1397): Init: SSL server IP/port overlap: pb.domain.fr:443 (/home/Me/conf/web/pb.domain.fr.apache2.ssl.conf:1) vs. servermon.domain.fr:443 (/home/Me/conf/web/servermon.domain.fr.apache2.ssl.conf:1)
[Tue Feb 13 21:34:36.356791 2018] [ssl:debug] [pid 2298] ssl_engine_init.c(1397): Init: SSL server IP/port overlap: cloud.domain.fr:443 (/home/Me/conf/web/cloud.domain.fr.apache2.ssl.conf:1) vs. servermon.domain.fr:443 (/home/Me/conf/web/servermon.domain.fr.apache2.ssl.conf:1)
[Tue Feb 13 21:34:36.356810 2018] [ssl:debug] [pid 2298] ssl_engine_init.c(1397): Init: SSL server IP/port overlap: test.com:443 (/home/Me/conf/web/test.com.apache2.ssl.conf:1) vs. servermon.domain.fr:443 (/home/Me/conf/web/servermon.domain.fr.apache2.ssl.conf:1)
[Tue Feb 13 21:34:36.356827 2018] [ssl:debug] [pid 2298] ssl_engine_init.c(1397): Init: SSL server IP/port overlap: baikal.domain.fr:443 (/home/Me/conf/web/baikal.domain.fr.apache2.ssl.conf:1) vs. servermon.domain.fr:443 (/home/Me/conf/web/servermon.domain.fr.apache2.ssl.conf:1)
[Tue Feb 13 21:34:36.356842 2018] [ssl:debug] [pid 2298] ssl_engine_init.c(1397): Init: SSL server IP/port overlap: todo.domain.fr:443 (/home/Me/conf/web/todo.domain.fr.apache2.ssl.conf:1) vs. servermon.domain.fr:443 (/home/Me/conf/web/servermon.domain.fr.apache2.ssl.conf:1)
[Tue Feb 13 21:34:36.356858 2018] [ssl:debug] [pid 2298] ssl_engine_init.c(1397): Init: SSL server IP/port overlap: piwik.domain.fr:443 (/home/Me/conf/web/piwik.domain.fr.apache2.ssl.conf:1) vs. servermon.domain.fr:443 (/home/Me/conf/web/servermon.domain.fr.apache2.ssl.conf:1)
[Tue Feb 13 21:34:36.356873 2018] [ssl:debug] [pid 2298] ssl_engine_init.c(1397): Init: SSL server IP/port overlap: assets.domain.fr:443 (/home/Me/conf/web/assets.domain.fr.apache2.ssl.conf:1) vs. servermon.domain.fr:443 (/home/Me/conf/web/servermon.domain.fr.apache2.ssl.conf:1)
[Tue Feb 13 21:34:36.356889 2018] [ssl:debug] [pid 2298] ssl_engine_init.c(1397): Init: SSL server IP/port overlap: gestion.domain.fr:443 (/home/Me/conf/web/sapache2.conf:86) vs. servermon.domain.fr:443 (/home/Me/conf/web/servermon.domain.fr.apache2.ssl.conf:1)
[Tue Feb 13 21:34:36.356904 2018] [ssl:debug] [pid 2298] ssl_engine_init.c(1397): Init: SSL server IP/port overlap: img.domain.fr:443 (/home/Me/conf/web/sapache2.conf:46) vs. servermon.domain.fr:443 (/home/Me/conf/web/servermon.domain.fr.apache2.ssl.conf:1)
[Tue Feb 13 21:34:36.356960 2018] [ssl:debug] [pid 2298] ssl_engine_init.c(1397): Init: SSL server IP/port overlap: domain.fr:443 (/home/Me/conf/web/sapache2.conf:6) vs. servermon.domain.fr:443 (/home/Me/conf/web/servermon.domain.fr.apache2.ssl.conf:1)
[Tue Feb 13 21:34:36.356975 2018] [ssl:warn] [pid 2298] AH02292: Init: Name-based SSL virtual hosts only work for clients with TLS server name indication support (RFC 4366)
[Tue Feb 13 21:34:36.356994 2018] [ssl:info] [pid 2298] AH01876: mod_ssl/2.4.7 compiled against Server: Apache/2.4.7, Library: OpenSSL/1.0.1f
[Tue Feb 13 21:34:36.357015 2018] [suexec:notice] [pid 2298] AH01232: suEXEC mechanism enabled (wrapper: /usr/lib/apache2/suexec)
[Tue Feb 13 21:34:36.460706 2018] [fcgid:info] [pid 2302] mod_fcgid: Process manager 2302 started
[Tue Feb 13 21:34:36.494144 2018] [pagespeed:info] [pid 2299] [mod_pagespeed 1.13.35.2-0 @2299] SharedMemCache: pagespeed_default_shm/metadata_cache, sectors = 128, entries/sector = 2226,  64-byte blocks/sector = 4452, total footprint: 52445184
[Tue Feb 13 21:34:36.497030 2018] [pagespeed:info] [pid 2299] [mod_pagespeed 1.13.35.2-0 @2299] Initializing shared memory for path: /var/cache/mod_pagespeed/ flush .
And for information, the vestaCP admin is working well (because of nginx)

Re: Apache2 stop working

Posted: Wed Feb 14, 2018 8:25 am
by Spheerys
I need to understand what's appends because this server works perfectly and I didn't change anything on it : one day, during the daily vestacp cronjob, something broke...
But why, and how to solve the issue ?

Re: Apache2 stop working

Posted: Wed Feb 14, 2018 8:51 am
by skurudo

Code: Select all

apachectl -t
looks good too?

Maybe you need disable mod_pagespeed and try to start apache2?

Re: Apache2 stop working

Posted: Wed Feb 14, 2018 8:59 am
by Spheerys
I get this :

Code: Select all

apachectl -t
Syntax OK

Code: Select all

a2dismod mod_pagespeed
ERROR: Module mod_pagespeed does not exist!

Re: Apache2 stop working

Posted: Wed Feb 14, 2018 9:05 am
by skurudo
Hmm.. from your log:

Code: Select all

[Tue Feb 13 21:34:36.335422 2018] [pagespeed:info] [pid 2298] [mod_pagespeed 1.13.35.2-0 @2298] SharedMemCache: pagespeed_default_shm/metadata_cache, sectors = 128, entries/sector = 2226,  64-byte blocks/sector = 4452, total footprint: 52445184
[Tue Feb 13 21:34:36.338230 2018] [pagespeed:info] [pid 2298] [mod_pagespeed 1.13.35.2-0 @2298] Initializing shared memory for path: /var/cache/mod_pagespeed/ flush .
Something like pagespeed exist...

And may be not mod_pagespeed... ?

Code: Select all

a2dismod pagespeed