网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

winxpapache用php建本地虚拟主机的方法

1 在C:\WINDOWS\system32\drivers\etc\hosts
添加如下代码:
127.0.0.1 localhost
127.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.com
DocumentRoot E:/WAMP/www
ServerName localhost
ErrorLog logs/localhost-error_log
CustomLog logs/localhost-access_log common


ServerAdmin web@xxx.com
DocumentRoot E:/WAMP/www/app (应用目录)
ServerName test.com
ServerAlias x.test.com admin.teeume.com
ErrorLog logs/x.test.com-error_log
CustomLog logs/x.test.com-access_log common


ServerAdmin web@xxx.com
DocumentRoot E:/WAMP/www/app/assets
ServerName x.test1.com
ErrorLog logs/img.test1.com-error_log
CustomLog logs/img.test1.com-access_log common

#自己建的目录

ServerAdmin web@xxx.com
DocumentRoot E:/WAMP/www/test/assets
ServerName x.test2.com
ErrorLog logs/img.test2.com-error_log
CustomLog logs/img.test2.com-access_log common

============================
3 检查是否关联php
在E:\WAMP\Apache2.2\conf 找到httpd.conf
在末尾是否有如下在代码:
############start for php5
LoadModule php5_module E:/WAMP/php5/php5apache2_2.dll
PHPIniDir E:/WAMP/php5
AddType application/x-httpd-php .php .phtml .php5
AddType application/x-httpd-php-source .phps
#####end for php5
若无则添加上以代码。
4 查找
# Virtual hosts
#Include conf/extra/httpd-vhosts.conf
改为
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
5 查找

DirectoryIndex index.html

改为

DirectoryIndex index.html index.html.var index.php

6 查找
改为 (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
分别输入以上三个进行测试

集宁网站制作公司哪家好,找创新互联公司!从网页设计、网站建设、微信开发、APP开发、成都响应式网站建设等网站项目制作,到程序开发,运营维护。创新互联公司从2013年创立到现在10年的时间,我们拥有了丰富的建站经验和运维经验,来保证我们的工作的顺利进行。专注于网站建设就选创新互联公司

网页题目:winxpapache用php建本地虚拟主机的方法
本文URL:http://bjjierui.cn/article/deeeg.html

其他资讯