Problems with Apache Vhosts configuration
Posted: Sun Sep 13, 2009 10:56 pm
I have try it for more than thousand times to config the apache Vhosts:
Wat i want to achive is:
my PC environment:
OS:WINXP
trees:phpstudy-apache2
--bin
--cgi-bin
--conf
--htdos
--icons
--logs
--modules
-Mysql
-PHP5
I have a domain uestx.cn and I have added an A record which is *.uestx.cn,and i have done that when i input such as "musicc.uestx.cn" into my IE,i was able to browser my website through input belows sataments into the config file httpd.conf.
<VirtualHost *>
ServerName http://www.uestx.cn
ServerAlias uestx.cn
DocumentRoot /www
</VirtualHost>
<VirtualHost *>
ServerName http://www.musicc.uestx.cn
ServerAlias musicc.uestx.cn
DocumentRoot /www/MusicShareSite/
Now i am trying to use mod_rewrite module to do reach functions ,i have LoadModule rewrite_module modules/mod_rewrite.so and add belows statement into httpd.conf:
RewriteEngine on
RewriteMap lowercase int:tolower
RewriteMap vhost txt:D:/Program Files/phpStudy/Apache2/conf/vhost.map
RewriteCond ${lowercase:%{SERVER_NAME}} ^(.+)$
RewriteCond ${vhost:%1} ^(D:/www/.*)$
RewriteRule ^/(.*)$ %1/$1
And i have my apache2 stopped ,and it's not able to start now...wat should i do now? is there any problem with my configuration?
Wat i want to achive is:
my PC environment:
OS:WINXP
trees:phpstudy-apache2
--bin
--cgi-bin
--conf
--htdos
--icons
--logs
--modules
-Mysql
-PHP5
I have a domain uestx.cn and I have added an A record which is *.uestx.cn,and i have done that when i input such as "musicc.uestx.cn" into my IE,i was able to browser my website through input belows sataments into the config file httpd.conf.
<VirtualHost *>
ServerName http://www.uestx.cn
ServerAlias uestx.cn
DocumentRoot /www
</VirtualHost>
<VirtualHost *>
ServerName http://www.musicc.uestx.cn
ServerAlias musicc.uestx.cn
DocumentRoot /www/MusicShareSite/
Now i am trying to use mod_rewrite module to do reach functions ,i have LoadModule rewrite_module modules/mod_rewrite.so and add belows statement into httpd.conf:
RewriteEngine on
RewriteMap lowercase int:tolower
RewriteMap vhost txt:D:/Program Files/phpStudy/Apache2/conf/vhost.map
RewriteCond ${lowercase:%{SERVER_NAME}} ^(.+)$
RewriteCond ${vhost:%1} ^(D:/www/.*)$
RewriteRule ^/(.*)$ %1/$1
And i have my apache2 stopped ,and it's not able to start now...wat should i do now? is there any problem with my configuration?