如何在Apache服务器配置多端口运行多个网站
环境:
apache22
配置:
1注册端口,默认为80,可增加或修改,因此次需部署三个网站,因此至少增加两个端口(81,82);
2将端口和发布路径绑定,新增加两个VirtualHost,
<VirtualHost :80>ServerName localhost
Documentroot "D:/publish/web"
</virtualHost>
<VirtualHost :81>
ServerName localhost1
Documentroot "D:/publish/web1"
</virtualHost>
<VirtualHost :82>
ServerName localhost2
Documentroot "D:/publish/web2"
</virtualHost>
:80,:81,:82即为网站端口;
3为多个网站发布目录授权,
<Directory "D:/publish/web">Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<Directory "D:/publish/web1">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<Directory "D:/publish/web2">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
0条评论