>點擊下載 http://sonlywya.cn/soft/141" />

綠色資源網(wǎng):您身邊最放心的安全下載站! 最新軟件|熱門排行|軟件分類|軟件專題|論壇轉(zhuǎn)帖|廠商大全

綠色資源網(wǎng)

技術(shù)教程
您的位置:首頁服務(wù)器類Web服務(wù)器 → Win2003+Wamp5 V2.1配置VPS環(huán)境

Win2003+Wamp5 V2.1配置VPS環(huán)境

我要評論 2015/02/27 00:24:50 來源:綠色資源網(wǎng) 編輯:濟憶 [ ] 評論:0 點擊:392次

1、安裝wampserver

利用wampserver安裝包直接進行環(huán)境配置步驟簡單,對于沒有任何基礎(chǔ)的童鞋們也可以進行自己配置。

wamp5V2.1包:PHP 5.3.3、mysql 5.5.8、Apache 2.2.17、PHPMyAdmin 3.2.0.1

下載地址:  http://sonlywya.cn/soft/1807.html

下載成功之后,直接雙擊安裝,過程中選擇安裝到指定目錄即可。這里安裝到:D:\wamp

注意:如果之前沒有安裝過apache、mysql之類的,直接一直點擊 Next(下一步) 直到安裝成功即可。如果前面有安裝過,最好先卸載,然后再進行wamp包的安裝。

安裝好之后右下角將會出現(xiàn)下面的圖片,右鍵點擊:

 

這樣就已經(jīng)安裝好了,apache、mysql、php、phpmadmin等,可以通過瀏覽器訪問:http://localhost/ 查看安裝后效果。

如果需要開啟偽靜態(tài)支持:

 

打開apache的配置文件httpd.conf
1.把#LoadModule rewrite_module modules/mod_rewrite.so前面的#去掉。
2.找到
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be “All”, “None”, or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride None
把 AllowOverride None 改為 AllowOverride All
最后就是重啟一下apache服務(wù)器使配置生效,這樣就支持.htaccess文件了

 

接著進行域名的綁定,當然,域名必須已經(jīng)解析到你當前VPS。

2、配置多站點:

打開bin\apache\Apache2.2.17\conf\httpd.conf

第61行:LoadModule alias_module modules/mod_alias.so 前面是否有#,如果有,去除這句話前面的# (開啟alias的支持)

第446行:#Include conf/extra/httpd-vhosts.conf 去掉前面的# (使apache能夠讀取extra/httpd-vhosts.conf 文件)

打開bin\apache\Apache2.2.17\conf\extra\httpd-vhosts.conf

刪除底部默認的一些配置:

之后根據(jù)下述添加多站點的方式,選擇一種自己進行添加:

 

1、多IP多端口多站點配置

Listen 172.20.30.40:80
Listen 172.20.30.40:8080
Listen 172.20.30.50:80
Listen 172.20.30.50:8080

<VirtualHost 172.20.30.40:80>
DocumentRoot /www/example1-80
ServerName www.example1.com
< /VirtualHost>

<VirtualHost 172.20.30.40:8080>
DocumentRoot /www/example1-8080
ServerName www.example1.com
< /VirtualHost>

<VirtualHost 172.20.30.50:80>
DocumentRoot /www/example2-80
ServerName www.example1.org
< /VirtualHost>

<VirtualHost 172.20.30.50:8080>
DocumentRoot /www/example2-8080
ServerName www.example2.org
< /VirtualHost>
————————————————————

2、多IP單端口多站點
———————————————————–
<VirtualHost 192.168.1.1:80>
DocumentRoot “/usr/local/apache/a”
ServerName www.a.com #網(wǎng)站根目錄
ServerAlias a.com #做出響應(yīng)的域名,其實也就是這里列出的域名,也指向前面設(shè)置的網(wǎng)站根目錄
DirectoryIndex index.html index.php
< /VirtualHost>

NameVirtualHost 192.168.1.2:80

<VirtualHost 192.168.1.2:80>
DocumentRoot “/usr/local/apache/b”
ServerName www.b.com
ServerAlias b.com
DirectoryIndex index.php
< /VirtualHost>

<VirtualHost 192.168.1.2:80>
DocumentRoot “/usr/local/apache/c”
ServerName www.c.com
ServerAlias c.com
DirectoryIndex index.php
< /VirtualHost>
—————————————————————

3、單IP單端口多站點
—————————————————————
Listen 80

NameVirtualHost 192.168.1.15 #接收請求的IP地址

<VirtualHost 192.168.1.15> #綁定的ip

ServerAdmin test@test.com #管理員郵箱
DocumentRoot “D:/Inetpub/www/maidou/” #網(wǎng)站目錄
ServerName www.test.com #主機名(域名)

DirectoryIndex index.php #主目錄默認頁

ServerAlias test.other.com admin.other.com #做出響應(yīng)的域名

ErrorLog logs/error_log.log #錯誤日志
CustomLog logs/custom.log common #用戶日志
<Directory “D:/Inetpub/www/maidou/”>
Options Indexes FollowSymLinks
AllowOverride All #AllowOverride指明Apache服務(wù)器是否加載.htacess
Order allow,deny
Allow from all
< /Directory>

</VirtualHost>

# 多臺可以再添加
<VirtualHost 192.168.1.15>
DocumentRoot “D:/Inetpub/www/other/”
ServerName www.other.com

<Directory “D:/Inetpub/www/other/”>
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
< /Directory>
< /VirtualHost>

根據(jù)自己的需要設(shè)置即可,除了DocumentRoot、ServerName是必須的外,其他幾個設(shè)置都可以不要。

 

3、重啟apache,搞定

注意:實際配置時,可以一邊配置一邊查看效果,以免配置過程出現(xiàn)錯誤,最后又不容易找到。

關(guān)鍵詞:Win2003,wampserver,VPS

閱讀本文后您有什么感想? 已有 人給出評價!

  • 16 歡迎喜歡
  • 1 白癡
  • 1 拜托
  • 1 哇
  • 0 加油
  • 13 鄙視