方法一:
首先打開apache中conf下的http.conf文件打開虛擬主機(jī)的注釋:如下去掉第二行前面的#即可。
# Virtual hosts
# Include conf/extra/httpd-vhosts.conf
再打開conf目錄下的extra目錄中的httpd-vhosts.conf文件,在文件最后面加上
//你的虛擬主機(jī)所使用的端口號(hào) - ServerAdmin [email protected] //虛擬主機(jī)的管理員賬號(hào)
- DocumentRoot "D:/www/"
- //所需配置的網(wǎng)站的文件路徑,本地測(cè)試需配置
- ServerName www.companysz.com //服務(wù)器名稱 本地測(cè)試需配置
- ErrorLog "logs/dummy-host2.localhost-error.log" //錯(cuò)誤日志
- CustomLog "logs/dummy-host2.localhost-access.log" common //用戶日志
配置完成后保存即可
然后打開c:/windows/system32/drivers/etc/hosts,在其中配置你所需要的hosts,例如: 127.0.0.1 www.companysz.com 192.168.1.80 www.companysz.com
直接在http.conf最后面加上:
- ServerName www.111cn.net
- DocumentRoot D:/www/
- AllowOverride All
- Options All
- php教程_value include_path D:/library
- php_value magic_quotes_gpc off
- php_value register_globals off
新聞熱點(diǎn)
疑難解答
圖片精選