Velvet Star Monitor

Standout celebrity highlights with iconic style.

news

apache2 localhost refused to connect

Writer Mia Lopez

I'm installing apache2.4 on Ubuntu 16.04 with a custom cookbook in Chef. I cannot connect to localhost after a fresh converge, and I'm not having Chef modify any configuration files until I figure out why I cannot connect. I expect to see the default index.html landing page, but nothing works. I can ssh into my vagrant machine, but my browser will not load anything from the server. By the end of this I would like to have my own HTML file that I had Chef build in /var/www/html/ act as the landing page for my Apache server.

Below are a few methods I have already attempted:

I have ran wget localhost and 127.0.0.1 always outputs:

--2017-06-21 08:40:05--
Resolving localhost (localhost)... 127.0.0.1
Connecting to localhost (localhost)|127.0.0.1|:80... failed: Connection refused.

Running sudo systemctl status apache2 in my VM outputs:

Active: active (running) since Wed 2017-06-21 12:17:31 UTC; 31min ago

Running ps -ef | grep apache in my VM outputs:

root 12881 1 0 12:17 ? 00:00:00 /usr/sbin/apache2 -k start
www-data 12884 12881 0 12:17 ? 00:00:01 /usr/sbin/apache2 -k start
www-data 12885 12881 0 12:17 ? 00:00:01 /usr/sbin/apache2 -k start
vagrant 13125 13109 0 13:08 pts/0 00:00:00 grep --color=auto apache

Running netstat -a | grep less in my VM returns:

Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 *:ssh *:* LISTEN
tcp 0 0 10.0.2.15:ssh 10.0.2.2:40222 ESTABLISHED
tcp6 0 0 [::]:http [::]:* LISTEN
tcp6 0 0 [::]:ssh [::]:* LISTEN
udp 0 0 *:bootpc *:*

I have previously attempted to modify the config files in

  • /etc/apache2/apache2.conf
  • /etc/apache2/sites-enabled/000-default.conf

Lastly, I have checked permissions on /var/www and /var/www/html, and they're all 0755

All the above have lacked any form of success. Please help. Before you ask, yes I did restart the apache process after every modification to the server.

4 Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy