Virtual Hosts - probs w/ httpd.conf
Posted by: arlen (---.neb.res.rr.com)
Date: August 14, 2006 02:19PM

I'm trying to get apache setup w/ virtual hosts in which I plan to run multiple instances of WordPress. I've actually succeeded w/ getting the virtual hosts to work, but want to house all data in a location I regularly backup.

I'm using WAMP and largely used the urbangiraffe.com tutorials w/ help from posts in this forum. The config below is what I've come up w/ from posts in this forum.

My working httpd.conf file has the following for each virtual host:

<VirtualHost *:80>
DocumentRoot c:/users/domain.com/public_html
ServerName local.domain.com
ServerAlias domain.com
ErrorLog c:/users/domain.com/logs/error.log
CustomLog c:/users/domain.com/logs/access.log common
<Directory "c:/users/domain.com/public_html">
Options Indexes FollowSymLinks Includes
Order deny,allow
Deny from all
Allow from 127.0.0.1
</Directory>
</VirtualHost>

Ideally, I'd like to put things on a HD on another machine (either as a mapped drive or network path) and be able to edit my sites from either of my machines. I don't know if that's possible, but think it should be. Short of that I'd like to put them in "My Documents" on the PC I'm working on - this would be mostly for backup reasons.

Anyway, when I change the paths, I can't get Apache to start w/ either of these two options. I was able to get localhost to work in "My Documents" (but not on a mapped drive) before adding the virtual hosts, so I'm confused that it won't work w/ virtual hosts. A couple questions:

1) Is it possible to have a virtual host via apache use a directory on another XP networked machine as the root for the website, and if so, how do I do it?

2) Can spaces be used in the path for defining the root of a Virtual Host as in " ... Documents and Settings/Name/My Documents/ ..." ? Is there anything special needed to make this work? (I suspect it's the spaces in the path that are causing problems, as whenever I add a space it bombs)

I've burnt a lot of time trying to get either of the above to work w/ no luck, but it seems like it should be possible logically and from what I've read. Thanks in advance.

Options: ReplyQuote
Re: Virtual Hosts - probs w/ httpd.conf
Posted by: arlen (---.neb.res.rr.com)
Date: August 14, 2006 04:17PM

FYI, a friend on another forum helped me figure out #2 - the "My Documents" issue. Adding quotes around the paths fixed that problem.

He suggested I consider using IP addresses to address #1, but isn't sure exactly how it would be done. Each machine has it's own IP. Any thoughts?

Options: ReplyQuote
Re: Virtual Hosts - probs w/ httpd.conf
Posted by: CyberSpatium (67.170.181.---)
Date: August 14, 2006 07:26PM

to use ip address change
<VirtualHost *:80>

to
<VirtualHost put.ip.address.here>

if you want to use multiple ip addresses for the same site, use
<VirtualHost put.ip.address.here second.ip.address.here>

Options: ReplyQuote
Re: Virtual Hosts - probs w/ httpd.conf
Posted by: arlen (---.neb.res.rr.com)
Date: August 15, 2006 05:06AM

Thanks CyberSpatium, that was the piece of info I needed to make things work. Took me awhile to get it up and running, but it's easy once you know how.

For anyone who wants to do this, don't make the mistake I was making. Don't try to force Apache to use a drive on another PC for the DocumentRoot ... at least I couldn't get that to work. Set Apache up on the PC where you want the data to dwell, and allow it to act as a server. If my experience is correct, you'll need to add the virtual hosts you've defined on the server (including the IP of the server) to the C:\WINDOWS\system32\drivers\etc\hosts file on each PC to get the PC to see the virtual host.

Options: ReplyQuote


Sorry, only registered users may post in this forum.