您的位置:首页 > 运维架构 > Apache

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

2009-08-18 21:28 387 查看
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、重启,完成!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: