windows下面虚拟主机
1. wondows xp + apmserv 5.2.6 端口8088
2.httpd.config文件
1.?ServerRoot ?"D:/APMServ/APMServ5.2.6/Apache" ?
Listen ??8088?
ServerName 127.0.0.1:8088
DocumentRoot "D:/APMServ/APMServ5.2.6/www/"
(原文未變)
2.要么將幾臺<virtualhost>標簽全放在 D:\APMServ\APMServ5.2.6\Apache\conf\apmserv\vhost.conf 文件中(誰在前誰是默認的虛擬主機)
被httpd.config包含 ,要么將他們全部寫在httpd.config中 (若有更多臺虛擬主機可按原樣改動后添加)
NameVirtualHost *:8088 <VirtualHost *:8088>ServerName www.test.comServerAlias *.test.comDocumentRoot "D:/APMServ/APMServ5.2.6/www/test" <Directory "D:/APMServ/APMServ5.2.6/www/test"> Options FollowSymLinks IncludesNOEXEC IndexesDirectoryIndex index.html index.htm default.htm index.php default.php index.cgi default.cgi index.pl default.pl index.shtmlAllowOverride None Order Deny,Allow Allow from all </Directory> </VirtualHost>NameVirtualHost *:8088 <VirtualHost *:8088>ServerName www.testone.comServerAlias *.testone.comDocumentRoot "D:/APMServ/APMServ5.2.6/www/testone" <Directory "D:/APMServ/APMServ5.2.6/www/testone"> Options FollowSymLinks IncludesNOEXEC IndexesDirectoryIndex index.html index.htm default.htm index.php default.php index.cgi default.cgi index.pl default.pl index.shtmlAllowOverride None Order Deny,Allow Allow from all </Directory> </VirtualHost>3.C:\WINDOWS\system32\drivers\etc\hosts 文件用文本編輯器打開添加下邊內容(若有更多臺虛擬主機可按原樣改動后添加)
127.0.0.1 localhost
127.0.0.1 testone.com
127.0.0.1 www.testone.com
127.0.0.1 testtwo.com
127.0.0.1 www.testtwo.com
4.本機打開任意瀏覽器 輸入URL www.test.com 或者 www.testone.com 會顯示出?D:/APMServ/APMServ5.2.6/www/test 或者?"D:/APMServ/APMServ5.2.6/www/testone 中的 默認頁(index.php 或index.html……)
轉載于:https://www.cnblogs.com/hllnj2008/p/4073748.html
總結
以上是生活随笔為你收集整理的windows下面虚拟主机的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: C语言实现俄罗斯方块
- 下一篇: CentOS6.5修改系统语言为英语