相信大家都用过APMServ 5.2.6吧??
今天好蛋疼的是,通过视图化去配置虚拟主机进行访问本地项目,竟然无法访问,搞了大半天,还是无法解决这个BUG!
后来没办法,只能通过手工进行配置了,具体方法如下:
找到安装目录:“D:/APM/APMServ5.2.6/Apache/conf/apmserv”,把此目录下的vhost.conf文件用记事本打开,并修改为
#虚拟主机1
NameVirtualHost *:80
<VirtualHost *:80>
ServerName zhxy.cc
DocumentRoot "D:/workspace/zhxy-me"
RewriteEngine On
RewriteRule ^/$ /index.php [R=301]
<Directory "D:/workspace/zhxy-me">
Options FollowSymLinks IncludesNOEXEC Indexes
DirectoryIndex index.html index.htm default.htm index.php default.php index.cgi default.cgi
index.pl default.pl index.shtml
AllowOverride None
Order Deny,Allow
Allow from all
</Directory>
</VirtualHost>
#虚拟主机2
<VirtualHost *:80>
ServerName zhxy.com
DocumentRoot "D:/workspace/zhxy"
RewriteEngine On
RewriteRule ^/$ /index.php [R=301]
<Directory "D:/workspace/zhxy">
Options FollowSymLinks IncludesNOEXEC Indexes
DirectoryIndex index.html index.htm default.htm index.php default.php index.cgi default.cgi
index.pl default.pl index.shtml
AllowOverride None
Order Deny,Allow
Allow from all
</Directory>
</VirtualHost>
如果想要配置多个虚拟主机,只要在继续添加:
<VirtualHost *:80>
ServerName zhxy.com
DocumentRoot "D:/workspace/zhxy"
RewriteEngine On
RewriteRule ^/$ /index.php [R=301]
<Directory "D:/workspace/zhxy">
Options FollowSymLinks IncludesNOEXEC Indexes
DirectoryIndex index.html index.htm default.htm index.php default.php index.cgi default.cgi
index.pl default.pl index.shtml
AllowOverride None
Order Deny,Allow
Allow from all
</Directory>
</VirtualHost>
并把ServerName、DocumentRoot、Directory这三个地方进行相应的修改就可以解决这个BUG了,
希望我这个办法可以帮到大家!