Setting up Virtual Hosts with Apache on Windows 2008 server for multiple sites. Complicated setup, including subversion
- by Roeland
I am setting up apache on my windows 2008 server at my home. It will serve 2 functions.
Subversion hosting to allow me and some others to manage company documents with version control
Local website hosting for web development. Will need to run several websites since I generally work on more then one site at a time.
Heres what I have done so far.
I set up subversion and apache 2.2 using some walk
troughs.
I changed the default port
to 1337. (im a nerd)
Using dyndns.com I created a domain to forward to my home ip which is dynamic. ( company.gotdns.org)
I then went into my DNS for my company.com and added a record to point repo.company.com to company.gotdns.org
At this point people who need access to my file repository can access by going to repo.company.com/repo which is good so far.
My question comes on the next step, setting up virtual hosts with apache. Ideally I would like to have my local website be viewable by some others in the company from their homes. So, say I am working on site1, I would like to have them be able to view this by going site1.roeland.bythepixel.com. At the same time, I would like to have site10.wouter.bythepixel.com go to his local setup for site10.
What I have done for this:
I went into my DNS for company.com
and added a record to point
roeland.company.com to
company.gotdns.org (which translates
to my ip).
I added code to my httpd-vhosts.conf (listed at bottom)
I added code to my host file (listed at bottom)
Hah, so of course this doenst work as excepted.. going to site1.roeland.bythepixel.com doesnt bring up my test1 site. Could anyone point me where I may be going wrong? Thanks!
hosts:
127.0.0.1 localhost
127.0.0.1 sensenich.roeland.bythepixel.com
::1 localhost
httpd-vhosts.conf:
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot "F:/Current Projects/sensenich.com"
ServerName sensenich.roeland.bythepixel.com
ErrorLog "logs/sensenich.roeland.bythepixel.com-error.log"
CustomLog "logs/sensenich.roeland.bythepixel.com-access.log" common
</VirtualHost>