日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 综合教程 >内容正文

综合教程

WAMP设置

發布時間:2024/5/24 综合教程 29 生活家
生活随笔 收集整理的這篇文章主要介紹了 WAMP设置 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

當安裝好WAMP后,windows右下角會出現WAMP Server的圖標,如圖所示!

當中集成了PHP開發的常用功能。

Localhost:表示啟動瀏覽器打開本地首頁

My Projects:項目文件夾(目前沒有任何作用)

phpMyAdmin:MySql Web管理工具。

Apache:Apache服務器管理相關內容,有版本管理,服務管理,模塊管理,虛擬目錄管理,配置文件,日志文件。

PHP:PHP相關管理,版本,設置和擴展。

MySQL:MySQL相關管理,版本,服務,MySql控制臺,配置文件,日志。

WebGrid:調試窗口

快速設置:啟動、關閉、重啟所有服務。

切換在線狀態:是否能被外部訪問,在線表示可以訪問,離線表示只能被本機訪問。

一、修改WAMP默認的文本編輯器

1、在WAMP根目錄中打開wampmanager.conf文件。

將:

editor = "notepad.exe"

修改為:

editor = "C:Program FilesNotepad++
otepad++.exe"

然后保存,重新啟動WAMP。

二、配置WAMP網站根目錄。

1、首先在F:盤新建一個Demo文件夾,用來存放網站代碼。

2、修改Apache的中httpd.conf中

修改:

DocumentRoot "D:/php/wamp/www/" 為DocumentRoot "F:/Demo/"

<Directory "D:/php/wamp/www/"> 為<Directory "F:/Demo/">

注意:所有配置文件修改后,都必須重新啟動服務。

這時Apache中的文件就已經修改完成,就可以通過localhost訪問F:/Demo中的文件了。

但是WAMP菜單中的www目錄還沒有改變,如果需要改變WAMP菜單中的目錄,還需要修改WAMP安裝目錄下的wampmanager.ini和wampmanager.tpl文件。

3、修改wampmanager.ini文件。

搜索"menu.left";將

Type: item; Caption: "www 目錄"; Action: shellexecute; FileName: "D:/php/wamp/www"; Glyph: 2

修改為:

Type: item; Caption: "Demo目錄"; Action: shellexecute; FileName: "F:/Demo"; Glyph: 2

4、修改wampmanager.tpl文件

搜索"menu.left";將:

Type: item; Caption: "${w_wwwDirectory}"; Action: shellexecute; FileName: "${wwwDir}"; Glyph: 2

修改為:

Type: item; Caption: "Demo目錄"; Action: shellexecute; FileName: "F:/Demo"; Glyph: 2

修改后重新啟動WAMP。

三、WAMP多站點的配置

第1步,修改httpd.conf,增加8080端口的監聽

#Listen 12.34.56.78:80
Listen 80
Listen 8080

第2步,修改virtual hosts的配置,同樣在httpd.conf這個文件中。

# Virtual hosts
#Include conf/extra/httpd-vhosts.conf
#修改為
# Virtual hosts
Include conf/extra/httpd-vhosts.conf

第3步,增加虛擬主機配置,修改httpd-vhosts.conf文件。

#
# Use name-based virtual hosting.
#
NameVirtualHost *:80
NameVirtualHost *:8080

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "C:/wamp/www/"
ServerName dummy-host.example.com
ServerAlias www.dummy-host.example.com
ErrorLog "logs/dummy-host.example.com-error.log"
CustomLog "logs/dummy-host.example.com-access.log" common
<Directory "C:/wamp/www/">
Options Indexes FollowSymLinks
AllowOverrideAll
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

<VirtualHost *:8080>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "C:/wamp/www2/"
ServerName dummy-host.example.com
ServerAlias www.dummy-host.example.com
ErrorLog "logs/dummy-host.example.com-error.log"
CustomLog "logs/dummy-host.example.com-access.log" common
<Directory "C:/wamp/www2/">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

第4步,重啟apache,就可以看到效果了

四、添加本地域名訪問

1、修改httpd-vhosts.conf文件。

<VirtualHost *:80>
DocumentRoot "D:phpwampwww est01"
ServerName test1.com
</VirtualHost>

<VirtualHost *:80>
DocumentRoot "D:phpwampwww est02"
ServerName test2.com
</VirtualHost>

2、修改hosts文件

C:WindowsSystem32driversetchosts

添加:

127.0.0.1 test1.com
127.0.0.1 test2.com

在hosts中只能使用默認端口綁定域名,也就是只能綁定80端口,指定其他端口后就無法訪問。

總結

以上是生活随笔為你收集整理的WAMP设置的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。