Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 have just set up a wi-fi network at home. I have all my files on my desktop computer ( and want to access localhost over there from another computer (

On my desktop I can access localhost through the normal http://localhost. Apache is running on port 80 as usual.

Exactly what do I have to do to achieve this? There is documentation on the net but they either don't work or are too fragment and confusing to understand.

I think I have to make changes to my apache's httpd.conf file and the hosts file. Any ideas as to what changes to make?

share|improve this question

closed as off-topic by Tom O'Connor Aug 14 '13 at 21:25

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions must be relevant to professional system administration. Server Fault is a site dedicated to professionals; novice questions are off-topic. Please see the Help Center for more information on topicality. The best advice we can give you is to hire a professional to help you out." – Tom O'Connor
If this question can be reworded to fit the rules in the help center, please edit the question.

localhost is the name given to the IP loopback address Every computer in a network has a localhost address that points to itself. To access your files on your main computer you can use You could also edit the hosts file on the client(s) and assign a name to edit /etc/hosts (unixlike systems) or %SystemRoot%\system32\drivers\etc\hosts for windows systems e.g.    homeserver.lan 

then you will be able to access the server as http://homeserver.lan

Edit: From the comments below, the port was being blocked by a firewall.

share|improve this answer
but I am not able to access (the IP address is dynamic, does that make a difference?) or desktoppcname... i really doubt that making changes to the hosts file will make any difference... – vr3690 Apr 3 '11 at 10:19
@vr3690: Check that your desktop pc will allow connections through it's firewall on port 80 (http). – Iain Apr 3 '11 at 10:53
bingo. when i use on desktop pc, i am able to see the site. so I am guessing I have a firewall problem. how do I fix this? – vr3690 Apr 3 '11 at 10:56
@vr3690: You don't provide any information about the OS on your desktop PC. If it is windows have a look here – Iain Apr 3 '11 at 11:10
yes. got it working. allowed port 80 limiting the scope to my subnet. thanks. – vr3690 Apr 3 '11 at 11:13

Out of the box Apache's default vhost configs might offer something if you try this in your browser: `'.

If that works look in the /etc/apache2/sites-enabled/000-default file (this may differ slightly on your OS) and change DocumentRoot to point to where the files you want to access are.

This isn't exactly secure if both machines are connected to the Internet but if you're not Port Forwarding on a NAT router to port 80 out to the Internet for serving Web pages then it's not the end of the world.

Remember to /etc/init.d/apache2 restart or similar after changes.

(It's probably worth saying at this point that using HTTP to share files across a LAN probably it's the obvious and ideal solution but the myriad of other solutions available are outwith this question most likely).

share|improve this answer

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