Skip to main content

debian - Apache 2.4 reload fails



My Apache won't reload after doing some changes, in this case after adding a new VHOST via Webmin.
It's not the first time it happens, last time I resolved reinstalling Apache, indeed not a satisfactory way to solve the problem.



In Webmin I get this error



Failed to start apache :
:

Starting apache2 (via systemctl): apache2.service.


So I try to reload Apache manually vis ssh



This is what happens



root@myvps:/# /etc/init.d/apache2 reload
Reloading apache2 configuration (via systemctl): apache2.serviceJob for apache2.service failed. See 'systemctl status apache2.service' and 'journalctl -xn' for details. failed!



So this is the journalctl -xn response



Jan 04 08:55:51 myvps systemd[1]: Reload failed for LSB: Apache2 web server.
-- Subject: Unit apache2.service has finished reloading its configuration
-- Defined-By: systemd
-- Support: lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit apache2.service has finished reloading its configuration
--

-- The result is failed.
Jan 04 08:56:01 myvps CRON[3403]: pam_unix(cron:session): session opened for user root by (uid=0)
Jan 04 08:56:01 myvps CRON[3404]: (root) CMD (cd / && run-parts --report /etc/cron.hourly)
Jan 04 08:56:01 myvps CRON[3403]: pam_unix(cron:session): session closed for user root
Jan 04 08:56:02 myvps systemd[1]: Reloading LSB: Apache2 web server.
-- Subject: Unit apache2.service has begun with reloading its configuration
-- Defined-By: systemd
-- Support: freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit apache2.service has begun with reloading its configuration

Jan 04 08:56:02 myvps systemd[1]: Failed to reset devices.list on /system.slice/apache2.service: No such file or directory
Jan 04 08:56:03 myvps apache2[3420]: Reloading web server: apache2 failed!
Jan 04 08:56:03 myvps apache2[3420]: Apache2 is not running ... (warning).
Jan 04 08:56:03 myvps systemd[1]: apache2.service: control process exited, code=exited status=1
Jan 04 08:56:03 myvps systemd[1]: Reload failed for LSB: Apache2 web server.
-- Subject: Unit apache2.service has finished reloading its configuration
-- Defined-By: systemd
--
-- Unit apache2.service has finished reloading its configuration
--

-- The result is failed.


and this is the systemctl status apache2.service one



Jan 04 09:23:43 myvps apache2[3819]: Action 'start' failed.
Jan 04 09:23:43 myvps apache2[3819]: The Apache error log may have more information.
Jan 04 09:23:43 myvps apache2[3819]: .
Jan 04 09:23:43 myvps systemd[1]: Started LSB: Apache2 web server.
-- Subject: Unit apache2.service has finished start-up

-- Defined-By: systemd
-- Support: lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit apache2.service has finished starting up.
--
-- The start-up result is done.
Jan 04 09:24:03 myvps systemd[1]: Reloading LSB: Apache2 web server.
-- Subject: Unit apache2.service has begun with reloading its configuration
-- Defined-By: systemd
--

-- Unit apache2.service has begun with reloading its configuration
Jan 04 09:24:03 myvps systemd[1]: Failed to reset devices.list on /system.slice/apache2.service: No such file or directory
Jan 04 09:24:03 myvps apache2[3868]: Reloading web server: apache2 failed!
Jan 04 09:24:03 myvps apache2[3868]: Apache2 is not running ... (warning).
Jan 04 09:24:03 myvps systemd[1]: apache2.service: control process exited, code=exited status=1
Jan 04 09:24:03 myvps systemd[1]: Reload failed for LSB: Apache2 web server.
-- Subject: Unit apache2.service has finished reloading its configuration
-- Defined-By: systemd
--
-- Unit apache2.service has finished reloading its configuration

--
-- The result is failed.


These are the caracteristics of the VPS




  • Debian Linux 8

  • Apache 2.4.10

  • Webmin 1.780


  • Kernel and CPU Linux 2.6.32-042stab108.8 on x86_64

  • BIND 9.9.5



some others details from the Apache error log:



[Mon Jan 04 05:16:05.615503 2016] [mpm_event:notice] [pid 367:tid 140186227066752] AH00489: Apache/2.4.10 (Debian) OpenSSL/1.0.1k configured -- resuming normal operations
[Mon Jan 04 05:16:05.615527 2016] [core:notice] [pid 367:tid 140186227066752] AH00094: Command line: '/usr/sbin/apache2'
[Mon Jan 04 06:22:05.208150 2016] [core:error] [pid 428:tid 140185949918976] [client clientIP:clientPort] AH00135: Invalid method in request quit
[Mon Jan 04 08:34:33.316012 2016] [mpm_event:notice] [pid 367:tid 140186227066752] AH00493: SIGUSR1 received. Doing graceful restart

(98)Address already in use: AH00072: make_sock: could not bind to address vhostIp:vhostPort
[Mon Jan 04 08:34:33.343511 2016] [mpm_event:alert] [pid 367:tid 140186227066752] no listening sockets available, shutting down
[Mon Jan 04 08:34:33.343518 2016] [:emerg] [pid 367:tid 140186227066752] AH00019: Unable to open logs, exiting


my apache2.conf
http://pastebin.com/xcedmPi0



my VirtualHost configurations files
000-default.conf

http://pastebin.com/QYgMtTaK



webmin.conf
pastebin.com/wFAe1uyS



Anybody could help?



Thanks.


Answer



It looks like from the error log, you have either misconfigured your virtualhost or duplicate Listen 80 entries in your apache config files.





(98)Address already in use: AH00072: make_sock: could not bind to
address vhostIp:vhostPort




In your default virtualhost config file, try changing to and restart apache. For a name based virtual host you don't need to specify ip address.



Also check your /etc/apache2/ports.conf file for possible duplicate entry for port declaration.




Update from OP: Problem was solved by deleting a line in the ports.conf Listen 443 Listen vpsIp:5673 (line added by Webmin during the failed vhost creation)


Comments

Popular posts from this blog

linux - Awstats - outputting stats for merged Access_logs only producing stats for one server's log

I've been attempting this for two weeks and I've accessed countless number of sites on this issue and it seems there is something I'm not getting here and I'm at a lost. I manged to figure out how to merge logs from two servers together. (Taking care to only merge the matching domains together) The logs from the first server span from 15 Dec 2012 to 8 April 2014 The logs from the second server span from 2 Mar 2014 to 9 April 2014 I was able to successfully merge them using the logresolvemerge.pl script simply enermerating each log and > out_putting_it_to_file Looking at the two logs from each server the format seems exactly the same. The problem I'm having is producing the stats page for the logs. The command I've boiled it down to is /usr/share/awstats/tools/awstats_buildstaticpages.pl -configdir=/home/User/Documents/conf/ -config=example.com awstatsprog=/usr/share/awstats/wwwroot/cgi-bin/awstats.pl dir=/home/User/Documents/parced -month=all -year=all...

iLO 3 Firmware Update (HP Proliant DL380 G7)

The iLO web interface allows me to upload a .bin file ( Obtain the firmware image (.bin) file from the Online ROM Flash Component for HP Integrated Lights-Out. ) The iLO web interface redirects me to a page in the HP support website ( http://www.hp.com/go/iLO ) where I am supposed to find this .bin firmware, but no luck for me. The support website is a mess and very slow, badly categorized and generally unusable. Where can I find this .bin file? The only related link I am able to find asks me about my server operating system (what does this have to do with the iLO?!) and lets me download an .iso with no .bin file And also a related question: what is the latest iLO 3 version? (for Proliant DL380 G7, not sure if the iLO is tied to the server model)

hp proliant - Smart Array P822 with HBA Mode?

We get an HP DL360 G8 with an Smart Array P822 controller. On that controller will come a HP StorageWorks D2700 . Does anybody know, that it is possible to run the Smart Array P822 in HBA mode? I found only information about the P410i, who can run HBA. If this is not supported, what you think about the LSI 9207-8e controller? Will this fit good in that setup? The Hardware we get is used but all original from HP. The StorageWorks has 25 x 900 GB SAS 10K disks. Because the disks are not new I would like to use only 22 for raid6, and the rest for spare (I need to see if the disk count is optimal or not for zfs). It would be nice if I'm not stick to SAS in future. As OS I would like to install debian stretch with zfs 0.71 as file system and software raid. I have see that hp has an page for debian to. I would like to use hba mode because it is recommend, that zfs know at most as possible about the disk, and I'm independent from the raid controller. For us zfs have many benefits, ...