Problems with Apache Vhosts configuration

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
John.Mike
Forum Newbie
Posts: 18
Joined: Fri Sep 04, 2009 11:43 pm
Location: Canton.China

Problems with Apache Vhosts configuration

Post by John.Mike »

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?
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: Problems with Apache Vhosts configuration

Post by VladSun »

Read your Apache error logs.
There are 10 types of people in this world, those who understand binary and those who don't
John.Mike
Forum Newbie
Posts: 18
Joined: Fri Sep 04, 2009 11:43 pm
Location: Canton.China

Re: Problems with Apache Vhosts configuration

Post by John.Mike »

VladSun wrote:Read your Apache error logs.
I have checked my Apache error logs but nutting useful for this problem i found .today i have the linux os ubuntu 8.04 installed on my pc , and i try to configure my vhosts based on mod_rewrite and it didn't work either.
Follow's my environment:
Apache2.28
FileSystem :
DocumentRoot /var/www
ServerRoot : /etc/apache2
My httpd.conf in /etc/apache2/:
RewriteEngine on
RewriteMap lowercase int:tolower
## define the map file
RewriteMap vhost txt:/etc/apache2/vhost.map
RewriteCond ${lowercase:%{SERVER_NAME}} ^(.+)$
RewriteCond ${vhost:%1} ^(/.*)$
RewriteRule ^/(.*)$ %1/$1
ServerName 121.49.91.201
My vhost.map in /etc/apache2:
ajax.uestx.cn /var/www/ajax

when in type" ajax.uestx.cn" in my firefox ,it leads me to the /var/www but not /var/www/ajax
I am sure that i have made Mod_rewrite worked througn checked my phpinfo().
Post Reply