国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 網(wǎng)站 > 建站經(jīng)驗(yàn) > 正文

winxp apache用php建本地虛擬主機(jī)的方法

2019-11-02 16:29:48
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友
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(假設(shè)的DNS)

2 在E:/WAMP/Apache2.2/conf/extra/httpd-vhosts.conf

修改內(nèi)容:

NameVirtualHost *

<VirtualHost *>

ServerAdmin web@xxx.com

DocumentRoot E:/WAMP/www

ServerName localhost

ErrorLog logs/localhost-error_log

CustomLog logs/localhost-access_log common

</VirtualHost>

<VirtualHost *>

ServerAdmin web@xxx.com

DocumentRoot E:/WAMP/www/app (應(yīng)用目錄)

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

</VirtualHost>

<VirtualHost *>

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

</VirtualHost>

#自己建的目錄

<VirtualHost *>

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

</VirtualHost>

============================

3 檢查是否關(guān)聯(lián)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

若無(wú)則添加上以代碼。

4 查找

# Virtual hosts

#Include conf/extra/httpd-vhosts.conf

改為

# Virtual hosts

Include conf/extra/httpd-vhosts.conf

5 查找

<IfModule dir_module>

DirectoryIndex index.html

</IfModule>

改為

<IfModule dir_module>

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

</IfModule>

6 查找 <Directory "E:/WAMP/Apache2.2/htdocs">

改為 <Directory "E:/WAMP/www"> (www為apache應(yīng)用目錄)

7 查找 DocumentRoot "E:/WAMP/Apache2.2/htdocs"

改為 DocumentRoot "E:/WAMP/www"

8 查找 ServerRoot "E:/XXX/Apache2.2" (apache安裝目錄)

改為 ServerRoot "E:/WAMP/Apache2.2" (apache服務(wù)器目錄)

9 x.test.com x.test1.com x.test2.com

分別輸入以上三個(gè)進(jìn)行測(cè)試
發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 吉木萨尔县| 淮南市| 洮南市| 八宿县| 安平县| 高雄市| 昭平县| 清水河县| 长宁区| 咸宁市| 衡东县| 临泉县| 漳州市| 和龙市| 泰来县| 遂川县| 龙泉市| 英超| 铜梁县| 巴南区| 湘潭县| 九龙城区| 通江县| 嘉荫县| 双鸭山市| 云安县| 泉州市| 鹿邑县| 晋江市| 沭阳县| 七台河市| 邢台市| 那曲县| 广水市| 唐海县| 溆浦县| 叙永县| 南木林县| 盐城市| 枣强县| 呼和浩特市|