senyandy's blog

wamp配置多端口代码

1、监听多个端口:
Listen 80
Listen 127.0.0.1:8080
Listen 192.168.0.227:7000

2、虚拟主机:
<VirtualHost 127.0.0.1>
ServerName wwwtzx
Options All ExecCGI FollowSymLinks Includes IncludesNOEXEC Indexes MultiViews SymLinksIfOwnerMatch None
DirectoryIndex index.html index.php index.shtml
DocumentRoot "D:/wamp/www"
</VirtualHost>
<VirtualHost 127.0.0.1:8080>
ServerName wwwtzx
Options All ExecCGI FollowSymLinks Includes IncludesNOEXEC Indexes MultiViews SymLinksIfOwnerMatch None
DirectoryIndex index.html index.php index.shtml
DocumentRoot "D:/wamp/www3"
</VirtualHost>
<VirtualHost 192.168.0.227:7000>
ServerName wwwtzx
Options All ExecCGI FollowSymLinks Includes IncludesNOEXEC Indexes MultiViews SymLinksIfOwnerMatch None
DirectoryIndex index.html index.php index.shtml
DocumentRoot "D:/wamp/www2"
</VirtualHost>

3、网站文件目录访问权限
<Directory "D:/wamp/www/">
Options FollowSymLinks Indexes
Allow from 127.0.0.1
Deny from all
Order Deny,Allow
AllowOverride All
</Directory>
<Directory "D:/wamp/www2">
Options All ExecCGI FollowSymLinks Includes IncludesNOEXEC Indexes MultiViews SymLinksIfOwnerMatch None
Allow from All
</Directory>
<Directory "D:/wamp/www3">
Options All ExecCGI FollowSymLinks Includes IncludesNOEXEC Indexes MultiViews SymLinksIfOwnerMatch None
Allow from All
</Directory>

4、重启,完成!

评论