Ubuntu – 127.0.0.1 and localhost not working

14.04Apache2localhost

I have installed apache2 on my local machine (ubuntu 14.04). I am able to see this screen ("It Works!" screen) by using my network IP (xxx.xxx.xxx.xxx) but not using localhost or 127.0.0.1:

this

Can anybody help me out please?

EDIT:

Here is my sudo gedit /etc/apache2/ports.conf file.

I have 000-default file instead of 000-default.conf. Here /etc/apache2/sites-enabled/000-default is.

Best Answer

Run this command to edit ports.conf file sudo gedit /etc/apache2/ports.conf

Add below line in the begining of the file.

Listen 0.0.0.0:80

And make sure that /etc/apache2/sites-enabled/000-default.conf files first line is equal to below line

<VirtualHost *:80>

http://httpd.apache.org/docs/2.2/bind.html

Related Question