1.找到我们安装xmapp路径下的httpd-vhosts.conf文件,我的安装路径是D:\XMAPP\xmapp\apache\conf\extra,如下图所示:
2.用工具(notepad++)打开,我们会看到如下配置:
3.配置多各站点,我们只需要ctrl+c ,ctrl+v就可以了。但是这里都用#注释了(相当于//),说明这里的代码没起作用,如果你需要的话可以去掉#。
##<VirtualHost *:80> ##ServerAdmin [email protected] ##DocumentRoot "D:/XMAPP/xmapp/htdocs/dummy-host.example.com" ##ServerName dummy-host.example.com ##ServerAlias www.dummy-host.example.com ##ErrorLog "logs/dummy-host.example.com-error.log" ##CustomLog "logs/dummy-host.example.com-access.log" common ##</VirtualHost> |
4.举个例配置:
DocumentRoot "F:/project/test" ServerName test.com |
到这里,我们配置好了么?答案是no,接着我们看一下我们安装目录下D:\XMAPP\xmapp\apache\conf的httpd.conf文件夹,用工具(notepad)打开,搜索httpd-vhost,回找到:
# Virtual hosts
Include conf/extra/httpd-vhosts.conf,我们发现在xmapp中,Include conf/extra/httpd-vhosts.conf没有用#注释掉,如果注释的话,我们去掉#就可以了,当然wampServer是注释掉的。
ServerAdmin:管理员邮箱地址。
DocumentRoot:目录,网站代码所放在的目录。
ServerName:主机名。
ErrorLog:错误日志。
CustomLog:日常日志。
总结:其实xmapp和wampServer多站点配置是一样的。
原文链接:https://blog.csdn.net/u014133119/article/details/80839858