3

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.

muru
  • 207,228
RAJ ...
  • 173

2 Answers2

5

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

dedunu
  • 9,556
1

According to my testing, I have successfully open http://localhost and http://IPaddress by adding the following lines into your httpd.conf file:

Listen IPAdress:80  
Listen 127.0.0.1:80

And then restart the httpd service with

systemctl restart httpd.service
pengchy
  • 111
  • 6