xampp中apache使用域名访问
友情提示:操作前先进行备份,可随时进行还原
一、首先找到/opt/lampp/etc/httpd.conf:
#Virtual hosts
Include etc/extra/httpd-vhosts.conf 将这前面的#去掉
二、修改 /opt/lampp/etc/extra/httpd-vhosts.conf
详情:
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot /opt/lampp/htdocs/b (这里写上所绑定到的目录)
ServerName www.linuxidc.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 *:80>
DocumentRoo