I'm running Apache on my stationary and I would like to access a website through my laptop.
This is some of the Apache config:


    ServerName mysite.com
    DocumentRoot I:/wamp/www/mysite/

ServerName localhost:80

<Directory />
    Options FollowSymLinks
    AllowOverride all
    Order deny,allow
    Deny from all

On my laptop I've added the following to the HOSTS file:   mysite.com

But accessing the page through mysite.com is not very successfull. If I enter the IP address directly, I only get a Forbidden message.

What do I need to do in order to get this to work?


I'm runing WAMPSERVER 2.1 (Apache 2.2.17)
Apache is up and running
I can ping from laptop
I'm not able to ping http://mysite.com from laptop
IE gives me a 403 Forbidden -> The website declined to show this webpage

The only log that get's entries when trying to access the website from my laptop, is access.log.

access.log - - [13/Jun/2011:10:14:04 +0200] "GET / HTTP/1.1" 403 202

[Mon Jun 13 10:08:16 2011] [error] VirtualHost localhost:0 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results

My apache config has the following entry:

AllowOverride all
Order Deny,Allow
Deny from all
Allow from

Could it be that this Allow from is stopping other computers accessing the page?

  • Post the relevant entries from your error log. If you're getting a 'Forbidden' message the error log will have more details in. There are hundreds of reasons that error could be caused by.
    – Smudge
    Jun 13, 2011 at 8:00
  • Are there any firewalls in place? Is the Apache Webservice running? Can it be pinged? Try access it just from the webserver's IP rather than the hosts file, to start with.
    – tombull89
    Jun 13, 2011 at 8:01
  • I've added som info.
    – Steven
    Jun 13, 2011 at 8:17
  • When you're asking a question like this, you need to think what it leaves behind for people who look at the site later - you should upvote answers that were helpful, and create an answer for anything else you do, rather than leaving comments inline. Right now the original problem isn't included in the question, for example.
    – crb
    Jun 13, 2011 at 8:56
  • @crb, how is my original problem not included in the question? The headline states pretty clearly what the problem is. I upvote answers that are helpfull. So far, there is only one answer and it was not helpfull. It did not solve my problem. When time permits, I will add an answer to my own solution and mark is at solved.
    – Steven
    Jun 13, 2011 at 9:26

2 Answers 2


I discovered that the problem was in Allow from section.

I just had to add the IP addresses of the computers I wanted to get access.

AllowOverride all
Order Deny,Allow
Deny from all
Allow from
Allow from
Allow from
Allow from

You at least should specify a port for your VirtualHost and NameVirtualHost directives. For example:

<VirtualHost localhost:80>

The Apache docs on using name-based virtual hosts are thorough and worth a read.

  • I've done that (, but it's not working. I've also tried using, but doing that, I'm not able to access the page from localhost either. I've read the docs.
    – Steven
    Jun 13, 2011 at 8:31
  • Could Allow from be the source of my problem? See update.
    – Steven
    Jun 13, 2011 at 8:36
  • Yup, that was it. By adding Allow from for my laptop and Allow from for my local computer, then it all worked :)
    – Steven
    Jun 13, 2011 at 8:39

Your Answer

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

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