在apache下建立多个站点
要在apache 建立多个站点,通过编辑apache/conf/httpd.conf 文件
设置端口号为80站点目录为D:/AppServ/www的一个站点代码如下:
===============================================
Listen 80
<VirtualHost 127.0.0.1:80>
ServerName "127.0.0.1:80"
DocumentRoot "D:\AppServ\www"
<Directory "D:\AppServ\www">
</Directory>
</VirtualHost>
<VirtualHost 127.0.0.2:80>
ServerName "127.0.0.2:80"
DocumentRoot "D:\AppServ\www2"
<Directory "D:\AppServ\www2">
</Directory>
</VirtualHost>
<VirtualHost 127.0.0.3:80>
ServerName "127.0.0.3:80"
DocumentRoot "D:\AppServ\www3"
<Directory "D:\AppServ\www3">
</Directory>
</VirtualHost>
===============================================