找到apache下httpd.conf,设置加载虚拟主机模块
Include conf/extra/httpd-vhosts.conf
启用加载虚拟主机配置文件
Include conf/extra/httpd-vhosts.conf
配置虚拟主机配置项:
打开文件extra/httpd-vhosts.conf
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "站点绝对路径"
ServerName 你自己的域名
ServerAlias 别名域名,可以直接是*.你的域名
ErrorLog "logs/dummy-host.example.com-error.log"
CustomLog "logs/dummy-host.example.com-access.log" common
</VirtualHost>
到这里就直接成功了,没有遇到麻烦!
ok;