模型如下:
<VirtualHost *:80>
ServerName posts.mydomain
DocumentRoot "d:/usr/www/posts"
<Directory "d:/usr/www/posts">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName friends_tj.mydomain
DocumentRoot "d:/usr/www/friends_tj"
<Directory "d:/usr/www/friends_tj">
Options Indexes MultiViews
AllowOverride None
rder allow,deny
Allow from all
</Directory>
</VirtualHost>
实际解决:
<VirtualHost *:80>
ServerName yourdomin # 放你的域名
ServerAdmin root@255.255.255.255 # 放你的I
RewriteEngine on
RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
RewriteRule .* - [F]
php_admin_value open_basedir D:/usr/www/posts
DocumentRoot "D:/usr/www/posts"
<Directory "D:/usr/www/posts">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</Virtualhost>
<Virtualhost *:80>
ServerName 255.255.255.255
ServerAdmin root@255.255.255.255
RewriteEngine on
RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
RewriteRule .* - [F]
php_admin_value open_basedir D:/usr/www/friends_tj
DocumentRoot "D:/usr/www/friends_tj"
<Directory "D:/usr/www/friends_tj">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
下面是补充内容:如何设置虚拟目录
<VirtualHost *:80>
ServerName 255.255.255.255
ServerAdmin root@255.255.255.255
RewriteEngine on
RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
RewriteRule .* - [F]
php_admin_value open_basedir D:/usr/www/
DocumentRoot "D:/usr/www/"
Alias /tj "D:/usr/www/friends_tj"
<Directory "D:/usr/www/friends_tj">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
Alias /posts "D:/usr/www/posts"
<Directory "D:/usr/www/posts">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>