Forum Moderators: mack

Message Too Old, No Replies

how to make http://mysite work in Apache?

to access a local site simply by http://site

         

mms19

2:12 pm on Oct 17, 2003 (gmt 0)

10+ Year Member



I just installed Apache in my local computer with Windows XP. I have a few sites in different folders, say c:/my documents/web/mysite and d:/www/othersite.

I would like to access the sites directly via [mysite...] and [othersite....] So, I just set the VirtualHost in the httpd.conf as

NameVirtualHost mysite

<VirtualHost mysite>
ServerAdmin webmaster@example.com
DocumentRoot c:/my documents/web/mysite
ServerName mysite
</VirtualHost>

<VirtualHost othersite>
ServerAdmin webmaster@example.com
DocumentRoot d:/www/othersite
ServerName othersite
</VirtualHost>

but this does not work.

What did I do wrong? Anything need to be set particularly in Apache for Windows?

Thank you.

mat

2:19 pm on Oct 17, 2003 (gmt 0)

10+ Year Member



First, we make sure that Apache is installed on the same partition as ALL the local sites. Then, allocate a local IP to each site - make sure you add them to the TCP properties of your NIC.

You'll then end up with a httpd.conf looking much like this:

NameVirtualHost 172.16.100.01
<VirtualHost 172.16.100.01>
DocumentRoot "/path/to/site1/on/this/partition"
ServerName sitename
</VirtualHost>

NameVirtualHost 172.16.100.02
<VirtualHost 172.16.100.02>
DocumentRoot "/path/to/site2/on/this/partition"
ServerName sitename2
</VirtualHost>

Probably not right, but it works. HTH

mms19

5:24 am on Oct 18, 2003 (gmt 0)

10+ Year Member



If my Apache is installed in C drive and the site is located at D drive, will I be able to do it?

How to set the TCP properties in my NIC?

Thank you.