我用的是XAMPP
所以找个apache的目录找到httpd-vhosts.conf文件
配置如下:
在文件的后面
- <VirtualHost *:80>
- DocumentRoot F:/xampp/htdocs
- ServerName localhost
- ServerAdmin admin@localhost
- </VirtualHost>
- ##设置开发主机
- <Directory "E:/phpworks">
- Options Indexes Includes execCGI
- AllowOverride All
- Order Allow,Deny
- Allow From All
- </Directory>
- <VirtualHost *:80>
- ServerAdmin admin@p
- DocumentRoot E:/phpworks
- ServerName p:80
- ServerAlias *.p
- ErrorLog logs/p-error_log
- </VirtualHost>
- ##结束设置开发主机
- ##<VirtualHost *:80>
- ## ServerAdmin admin@p
- ## DocumentRoot E:/phpworks
- ## ServerName wangjunsky.3322.org:80
- ## ServerAlias wangjunsky.3322.org
- ## ErrorLog logs/p-error_log
- ##</VirtualHost>