5

After I updated my apache, none of my virtual hosts are accessible anymore, the server responds "Connection refused". No errors are in the logs and I have no idea what is causing this. My virtual host is something like this:

 <VirtualHost 173.XXX.XXX.XXX:80>
      ....
      ServerName hostname.com
      ....
 </VirtualHost>
 <VirtualHost 173.XXX.XXX.XXX:443>
      ....
      ServerName hostname.com
      ....
 </VirtualHost>

Any ideas of how to debug?

2
  • Did you start Apache? Mar 15, 2013 at 18:25
  • Of course! The apache is running. I also rebooted the system. Mar 15, 2013 at 18:26

4 Answers 4

9

"Connection refused" would mean that apache is not listening on port 80; run this command to make sure" lsof -i:80, if you found no output then start apache and try again

Update: after seeing some output of different commands; it turned out that libapache2-mod-php5 is not installed according to dpkg -l | grep apache2 it was flagged as 'rc' (removed, but configuration files remaining). Since the debug information was showing loading mod_php5 then the absence of this package is what causing apache not to start

12
  • No output is given. Weird... I did service apache2 start and returned "Starting web server apache2 [OK]", after I tried pgrep apache and no output was shown. Is apache not being initialized, even saying [OK]?! Mar 15, 2013 at 18:32
  • try running 'apache2ctl -t' to test your configuration
    – minniux
    Mar 15, 2013 at 18:35
  • Syntax OK. Everything was fine before the update. Mar 15, 2013 at 18:36
  • what about running: apache2ctl -k start ?
    – minniux
    Mar 15, 2013 at 18:41
  • Tried and no output =/ Mar 15, 2013 at 18:42
7

Do you have your "Listen" directives in your vhost files or in /etc/apache2/ports.conf?

You should have a line similar to :

Listen 80
2

I get this problem every time I get a major upgrade/update on Ubuntu. Solved it just by running the following command:

sudo a2enmod ssl
sudo a2enmod rewrite
sudo /etc/init.d/apache2 restart

Hope this helps!

-1

apt-get upgrade problems

Another problem I found was that my lightdm stopped working. No GUI prompt after "apt-get upgrade". I found that lightdm was removed. I installed manually and all started working.

1
  • 2
    lightdm has reaaally nothing to do with apache!
    – djdomi
    Apr 24, 2020 at 14:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .