佬唐

博客园 首页 新随笔 联系 订阅 管理

Apache能否像IIS一样配置多端口多网站呀?……当然能啦,而且比IIS强多了!

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、重启,完成!

posted on 2009-08-18 21:28  佬唐  阅读(164)  评论(0)    收藏  举报