1、配置httpd.conf
在c:\xampp\apache\conf目录下,打开httpd.conf
改成下面这样
# Virtual hosts……虚拟主机
Include conf/extra/httpd-vhosts.conf
#DocumentRoot "c:/xampp/htdocs"
2、配置httpd-vhosts.conf
在C:\xampp\apache\conf\extra文件夹下,打开httpd-vhosts.conf
添加
#端口(必须)
<VirtualHost *:80>
#网站管理员邮箱(非必须)
ServerAdmin haha@qq.com
#绑定的子域名(必须)
ServerName te.cloudsystem.work
#子域名目录 (必须)
DocumentRoot "C:/xampp/htdocs/te/"
#错误日志(非必须)
#错误日志在C:/xampp/htdocs/te/logs文件夹
ErrorLog "C:/xampp/htdocs/te/logs/te.cloudsystem.work-error.log"
#访问日志(非必须)
#访问日志在C:/xampp/htdocs/te/logs文件夹
CustomLog "C:/xampp/htdocs/te/logs/te.cloudsystem.work-access.log" common
</VirtualHost>