Forums / Install & configuration / Virtual host... hmmm

Virtual host... hmmm

Author Message

cosmin ghidoveanu

Sunday 30 November 2003 2:24:20 pm

What is the correct way of creating a virtual host in apache 2.0 on Windows 2000?
My Apache is installed in C:\Program Files\Apache2

the webroot is C:\Program Files\Apache2\htdocs

What do I have to put inside the apache config to make it work?

By the way the virtual host examples given in the documentation prevent Apache from starting when placed in the server config.

Note to developers: have you noticed how easy to install other similar products are? Maybe you should work on that before asking... 3000$, was it? Or provide clear examples in the documentation?

James Packham

Monday 01 December 2003 9:18:36 am

You could add something like:

NameVirtualHost *:80

<Virtualhost *:80>
<Directory [your webroot]>
Options FollowSymLinks Indexes ExecCGI
AllowOverride None
</Directory>

RewriteEngine On
RewriteRule !\.(gif|css|jpg|png|jar|js|html)$ /index.php

DocumentRoot [your web root]
ServerName http://[your servername].[your domain.com]
</Virtualhost>

to httpd.conf and edit the square brackets. It's a little basic, but you can keep adding more <virtualhost>[details]</virtualhost> to your hearts content without killing your apache server (assuming this is the same for Win as it is for Lin). I'd recommend the apache documentation on the apache site if you're really having that much trouble with virtual hosting, I know it set me on the right track a couple of times when I was in trouble.

Regards,

James

stig henning

Friday 12 December 2003 8:26:33 am

thank you for extensive posting!