step 1:
找到xampp目录下的etc目录中的httpd.conf文件,进入编辑模式后找到里面的
# Virtual hosts
#Include etc/extra/httpd-vhosts.conf
改为:
# Virtual hosts
Include etc/extra/httpd-vhosts.conf
step 2:
然后找到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>
step 3:
重启apache后生效