1
votes

I am using my local machine as a development server. I have my hosts file set up as such:

127.0.0.1   localhost
127.0.0.1   cdog24
127.0.0.1   xxxxxorg
127.0.0.1   newintranet

My httpd-vhosts.conf file is set up as follows:

NameVirtualHost *:80

<VirtualHost *:80>
    DocumentRoot "D:\Webserver\htdocs"
    ServerName localhost
    ServerAlias localhost
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "D:\Webserver\htdocs\cdog24"
    ServerName cdog24
    ServerAlias cdog24
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "D:\Webserver\htdocs\xxxxxorg"
    ServerName xxxxxorg
    ServerAlias xxxxxorg
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "D:\Webserver\htdocs\newintranet"
    ServerName newintranet
    ServerAlias newintranet
</VirtualHost>

I am running xampp and can access each site on my local machine respectively by typing in:

http://localhost http://cdog24 http://xxxxxorg http://newintranet

When i go to a different computer on my network, I assume I have to type int he name of my machine or use the IP address. So, when I type in the following:

http://machinename/cdog24 or http://10.1.0.24/newintranet

I am taken to a 404 page.

What am I missing? Firewall on local machine or network do not factor as they are both off. I am on a Windows 7 local machine, the remote machine is also Windows 7.

Thanks for any help.

3

3 Answers

2
votes

You will need to edit the hosts file on the remote machine (where the browser is running, not the server):

x.x.x.x   cdog24
x.x.x.x   xxxxxorg
x.x.x.x   newintranet

Change x.x.x.x to the IP address of the Windows box that is running the server.

Now you should be able to browse to, say http://cdog24/ in your browser.

However, do NOT add a localhost entry that points to the other machine. localhost should always point to 127.0.0.1!

1
votes

Have you tried with just http://machinename/ ? http://machinename/directory would require that the document root be pointing to htdocs itself.

1
votes

You need to work out what the IP address of your machine is on your network, and then edit teh hosts files on the other machines to point to yours

<your local IP>   cdog24
<your local IP>   xxxxxorg
<your local IP>   newintranet

You maybe also have to update the apache conf file to work from your network address rather than 127.0.0.1.