Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've setup a Apache web server on Ubuntu Linux. I can see it as http://localhost and and http://default.local/. All work well. But I can't see localhost from other machines in my network using IP address: or http://default.local/

I also have added to both computers' /etc/hosts/

I added the lines below to my apache conf:

`Allow from 192.168.1`

but it did not work. It says "the connection has timed out".

what should i do?


adp@adp-desktop:~$ sudo netstat -ap | grep apache
tcp        0      0 *:www                   *:*                     LISTEN      10581/apache2   
tcp        0      0 localhost:www           localhost:46017         ESTABLISHED 10586/apache2   

Apache conf:

NameVirtualHost *:80
<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    ServerName default.local    
    DocumentRoot /home/www/public_html
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    <Directory /home/www/public_html>
        Options Indexes FollowSymLinks MultiViews
        #AllowOverride None
        AllowOverride all
        Order allow,deny
        allow from all

share|improve this question
What does the Listen directive say ? – Iain Dec 24 '10 at 11:55
it listens 80... as i said everything is OK. it just can't be seen from other computers. – Alexar Dec 29 '10 at 5:36

I'm not sure if this is clear for you but the hostname localhost is a local alias on every machine pointing to which is the local loopback interface. It is therefore only accessible from the local machine.

When you have such problem, what you want to do is check what IP the Apache socket is bound to. In order to do this, you can use netstat -ap | grep apache. This will give you a line containing either locahost:80 or *:80. Note that the port number may be replaced by a more intelligible name such as http.

The first one will mean that Apache is only bound to the local interface therefore can't be reached from other computers on the network. The first one will mean that Apache can be reached from the network providing that traffic flows are allowed and fucntionnal (no firewall per example).

EDIT : Considering the configuration you posted, you should check network connectivity. Make sure both PCs can ping each other and make sure you are trying to access the correct IP.

share|improve this answer
thanks. i run your command, and added to question. will you check it and tell what does it mean? – Alexar Dec 24 '10 at 11:47
can you also post you Apache configuration ? – Antoine Benkemoun Dec 24 '10 at 11:55
yes, i did. please check the question. – Alexar Dec 24 '10 at 12:09
If you've posted your entire apache.conf you've got a real problem. That looks more like a vhost.conf file. – Andrew Taylor Dec 24 '10 at 12:39
you ar right. i set ServerName to my conf. now it is accessible view default.local too. and i set it in my laptop's hosts file. but the problem persists. – Alexar Dec 24 '10 at 15:29

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.