1 在C:\WINDOWS\system32\Drivers\etc\Hosts
添加如下代码:127.0.0.1 localhost127.0.0.1 x.test.com x.test1.com x.test2.com注:x.test.com(假设的DNS)
2 在E:\WAMP\apache2.2\conf\extra\httpd-vhosts.conf
修改内容:NameVirtualHost *ServerAdmin web@xxx.comDocumentRoot E:/WAMP/wwwServerName localhostErrorLog logs/localhost-error_logCustomLog logs/localhost-access_log commonServerAdmin web@xxx.comDocumentRoot E:/WAMP/www/app (应用目录)ServerName test.comServerAlias x.test.com admin.teeume.comErrorLog logs/x.test.com-error_logCustomLog logs/x.test.com-access_log commonServerAdmin web@xxx.comDocumentRoot E:/WAMP/www/app/assetsServerName x.test1.comErrorLog logs/img.test1.com-error_logCustomLog logs/img.test1.com-access_log common#自己建的目录ServerAdmin web@xxx.comDocumentRoot E:/WAMP/www/test/assetsServerName x.test2.comErrorLog logs/img.test2.com-error_logCustomLog logs/img.test2.com-access_log common============================
3 检查是否关联php
在E:\WAMP\Apache2.2\conf 找到httpd.conf在末尾是否有如下在代码:############start for php5LoadModule php5_module E:/WAMP/php5/php5apache2_2.DLLPHPIniDir E:/WAMP/php5AddType application/x-httpd-php .php .phtml .php5AddType application/x-httpd-php-source .phps#####end for php5若无则添加上以代码。
4 查找
# Virtual hosts#Include conf/extra/httpd-vhosts.conf
改为
# Virtual hostsInclude conf/extra/httpd-vhosts.conf
5 查找
DirectoryIndex index.html
改为
DirectoryIndex index.html index.html.var index.php6 查找 改为 (www为apache应用目录)7 查找 DocumentRoot "E:/WAMP/Apache2.2/htdocs"改为 DocumentRoot "E:/WAMP/www"8 查找 ServerRoot "E:/XXX/Apache2.2" (apache安装目录)改为 ServerRoot "E:/WAMP/Apache2.2" (apache服务器目录)9 x.test.com x.test1.com x.test2.com分别输入以上三个进行测试
发表评论