Accessing Virtual Host from outside LAN

Posted by Ray on Server Fault See other posts from Server Fault or by Ray
Published on 2010-04-25T05:26:08Z Indexed on 2010/04/25 5:33 UTC
Read the original article Hit count: 349

I'm setting up a web development platform that makes things as easy as possible to write and test all code on my local machine, and sync this with my web server. I setup several virtual hosts so that I can access my projects by typing in "project" instead of "localhost/project" as the URL.

I also want to set this up so that I can access my projects from any network. I signed up for a DYNDNS URL that points to my computer's IP address.

This worked great from anywhere before I setup the virtual hosts. Now when I try to access my projects by typing in my DYNDNS URL, I get the 403 Forbidden Error message, "You don't have permission to access / on this server."

To setup my virtual hosts, I edited two files - hosts in the system32/drivers/etc folder, and httpd-vhosts.conf in the Apache folder of my WAMP installation.

In the hosts file, I simply added the server name to associate with 127.0.0.1. I added the following to the http-vhosts.conf file:

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    DocumentRoot "c:/wamp/www/ladybug"
    ServerName ladybug
    ErrorLog "logs/your_own-error.log"
    CustomLog "logs/your_own-access.log" common
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    DocumentRoot "c:/wamp/www"
    ServerName localhost
    ErrorLog "logs/localhost-error.log"
    CustomLog "logs/localhost-access.log" common
</VirtualHost>

Any idea why I can't access my projects from typing in my DYNDNS URL? Also, is it possible to setup virtual hosts so that when I type in http://projects from a random computer outside of my network, I access url.dyndns.info/projects (a.k.a. my WAMP projects on my home computer)?

Help is much appreciated, thanks!

© Server Fault or respective owner

Accessing Virtual Host from outside LAN

Posted by Ray on Stack Overflow See other posts from Stack Overflow or by Ray
Published on 2010-04-25T04:52:38Z Indexed on 2010/04/25 5:03 UTC
Read the original article Hit count: 349

Filed under:
|
|

I'm setting up a web development platform that makes things as easy as possible to write and test all code on my local machine, and sync this with my web server. I setup several virtual hosts so that I can access my projects by typing in "project" instead of "localhost/project" as the URL.

I also want to set this up so that I can access my projects from any network. I signed up for a DYNDNS URL that points to my computer's IP address.

This worked great from anywhere before I setup the virtual hosts. Now when I try to access my projects by typing in my DYNDNS URL, I get the 403 Forbidden Error message, "You don't have permission to access / on this server."

To setup my virtual hosts, I edited two files - hosts in the system32/drivers/etc folder, and httpd-vhosts.conf in the Apache folder of my WAMP installation.

In the hosts file, I simply added the server name to associate with 127.0.0.1. I added the following to the http-vhosts.conf file:

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    DocumentRoot "c:/wamp/www/ladybug"
    ServerName ladybug
    ErrorLog "logs/your_own-error.log"
    CustomLog "logs/your_own-access.log" common
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    DocumentRoot "c:/wamp/www"
    ServerName localhost
    ErrorLog "logs/localhost-error.log"
    CustomLog "logs/localhost-access.log" common
</VirtualHost>

Any idea why I can't access my projects from typing in my DYNDNS URL? Also, is it possible to setup virtual hosts so that when I type in http://projects from a random computer outside of my network, I access url.dyndns.info/projects (a.k.a. my WAMP projects on my home computer)?

Help is much appreciated, thanks!

© Stack Overflow or respective owner

Related posts about virtualhosts

Related posts about httpd.conf