Apache配置多个网站

来源:互联网 发布:cba数据统计 编辑:程序博客网 时间:2024/05/16 20:27

通过配置不同的端口,配置不同的网站。

一、安装目录下的conf目录下找到httpd.conf文件

二、找到Listen 80,这是Apache的默认端口,你可以修改该端口,也可以添加新端口,这里我改为如下(也就是为该服务器配置1个端口):
          Listen 8888

三、找到#Include conf/extra/httpd-vhosts.conf,把前面的“#”去掉;

四、找到目录 Apache/conf/extra 下的httpd-vhosts.conf文件,并用记事本打开;

五、在最后添加

<VirtualHost *:8888>
    ServerAdmin webmaster@dummy-host2.x
    DocumentRoot "D:/AppServ/www/test"
    ServerName dummy-host2.x
    ErrorLog "logs/dummy-host2.x-error.log"
    CustomLog "logs/dummy-host2.x-access.log" common
</VirtualHost>