现在的位置: 首页 > 综合 > 正文

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

2013年10月05日 ⁄ 综合 ⁄ 共 1224字 ⁄ 字号 评论关闭

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

抱歉!评论已关闭.