Heim  >  Artikel  >  Backend-Entwicklung  >  WampServe批改默认网站目录的方法

WampServe批改默认网站目录的方法

WBOY
WBOYOriginal
2016-06-13 12:23:31828Durchsuche

WampServe修改默认网站目录的方法

1wamp简介

WampServe集成了Apache、MySQL、PHP、phpmyadmin,支持Apache的mod_rewrite,PHP扩展、Apache模块只需要在菜单“开启/关闭”上点点就搞定,省去了修改配置文件的麻烦,这里就简写成wamp

 

假设如下:

Wamp版本:2.1

WAMP2.0安装目录:C:/

www目录:C:/wamp/www/

变更目录:E:/phproot/ 

 

 

一 主要过程:

 

(1)修改 C:\wamp\bin\apache\Apache2.2.17\conf \httpd.conf(实现更改默认网站路径,即将Http://localhost定向到自己的默认目录:E:/phproot/)

 

(2)拷贝并修改index.php(使新默认网站路径中的index.php可以正常显示,如果不需要Index.php可以略过此步)

 

(3)修改C:\wamp\wampmanager.ini和C:\wamp\wampmanager.tpl(改菜单中的www 目录指向)

 

二 具体修改方法全过程:

 

 第一步:修改C:\wamp\bin\apache\Apache2.2.17\conf \httpd.conf

 

查找: DocumentRoot "c:/wamp/www/"

 

修改: DocumentRoot "e:/phproot/"

 

查找: 

 

修改: 

 

 第二步:拷贝并修改index.php

 

(1)拷贝:

 

将C:/wamp/www/拷贝至e:/phproot

 

(2)查找:

 

//chemin jusqu'au fichier de conf de WampServer

 

$wampConfFile = '../wampmanager.conf';

 

//chemin jusqu'aux fichiers alias

 

$aliasDir = '../alias/';

 

(3)修改:

 

//chemin jusqu'au fichier de conf de WampServer

 

$wampConfFile = 'c:/wamp/wampmanager.conf';

 

        //chemin jusqu'aux fichiers alias

 

$aliasDir = 'c:/wamp/alias/';

 

 第三步:修改wampmanager.ini和wampmanager.tpl

 

1 修改C:\wamp\wampmanager.ini:

 

(1)打开:C:\wamp\wampmanager.ini

 

(2)查找:Type: item; Caption: "www 目录"; Action: shellexecute; FileName: "c:/wamp/www/"; Glyph: 2

 

(3)修改:Type: item; Caption: "www 目录"; Action: shellexecute; FileName: "e:/phproot/"; Glyph: 2

 

2 修改C:\wamp\wampmanager.tpl:

 

(1)打开:C:\wamp\wampmanager.tpl

 

(2)查找:Type: item; Caption: "${w_wwwDirectory}"; Action: shellexecute; FileName: "${wwwdir}"; Glyph: 2

 

(3)修改:Type: item; Caption: "${w_wwwDirectory}"; Action: shellexecute; FileName: "e:/phproot"; Glyph: 2

 

完成所有步骤,保存文件,至此修改成功。

 

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn