打开httpd.conf
将Include "conf/extra/httpd-vhosts.conf"
前面的“#”去掉,
编辑httpd-vhost.conf
NameVirtualHost *:80
ServerAdmin liu1084@163.com
DocumentRoot "D:/xampp/xampp/htdocs/blog"
ServerName myblog
ServerAlias www.myblog.com
ErrorLog "logs/www.myblog.com-error.log"
CustomLog "logs/www.myblog.com-access.log" common
ServerAdmin liu1084@163.com
DocumentRoot "D:/xampp/xampp/htdocs/formtest"
ServerName formtest
ServerAlias
ErrorLog "logs/-error.log"
CustomLog "logs/-access.log" common
打开hosts文件:
127.0.0.1 www.myblog.com
127.0.0.1
重启apache,就可以访问自己设定的域名了。
阅读(724) | 评论(0) | 转发(0) |