Tuesday, November 20

Configuration of Virtual Host in Apache 2.2

I have been using Apache for 5 years, and I can literally tell each directive in httpd.conf. But yesterday I failed configuring Vitual Host in Apache 2.2.

Thanks for Google. David reminds me that Apache 2.2 imposes stricter permissions, so I moved all virtual hosts into one folder "\working\remoteserver" and added directive:
< Directory \working\remoteserver>
Order Deny,Allow
Allow from all
< /Directory>

Then modify the httpd-vhosts.conf as
< VirtualHost *:80>

#AddDefaultCharset utf-8

ServerName private.fadshop.net

ServerAdmin webmaster@fadshop.net
DocumentRoot \Working\RemoteServer\private.fadshop.net

ErrorLog "|rotatelogs logs/private.fadshop.net-error.%Y-%m-%d.log 604800"

CustomLog "rotatelogs logs/private.fadshop.net-access.%Y-%m-%d.log 604800" combined

# ForceType text/html

< /VirtualHost>

and other virtual hosts. One more thing to remember: After you deploy virtual hosts, the "original" host will be ignore. So you should create first virtual host as the original host.

Labels: ,


Links to this post:

Create a Link

<< Home