一步一步把WampServer裝好裝滿

一步一步把WampServer裝好裝滿

今天有點時間要來介紹另一套免費的架站軟體整合包WampServer

下載:https://sourceforge.net/projects/wampserver/files/WampServer%203/WampServer%203.0.0/

安裝前請先看這篇:

http://forum.wampserver.com/read.php?2,138295

只支援NTFS格式,並把需要裝的前置程式都裝好

Microsoft Visual C/C++ Redistributable 2008 (VC9),
Microsoft Visual C/C++ Redistributable 2010 (VC10),
Microsoft Visual C/C++ Redistributable 2012 (VC11),
Microsoft Visual C/C++ Redistributable 2013 (VC13),
Microsoft Visual C/C++ Redistributable 2015 (VC14),
Microsoft Visual C/C++ Redistributable 2017 (VC15)

安裝好後的程式介面
一步一步把WampServer裝好裝滿

新增網站:http://localhost/add_vhost.php

一步一步把WampServer裝好裝滿

現在網站在本機已經可以看到了,但其他電腦連線進來看的話會出現

Forbidden

You don't have permission to access / on this server.


Apache/2.4.33 (Win64) PHP/7.0.29 Server at 61.ins104.com.tw Port 80

除了設定好防火牆,我們還要編輯httpd-vhosts.conf檔:

<VirtualHost *:80>
ServerName www.yourname.com.tw
DocumentRoot "e:/wamp64/www/webs/www.yourname.com.tw"
<Directory "e:/wamp64/www/webs/www.yourname.com.tw/">
Options +Indexes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>

改成

<VirtualHost *:80>
ServerNamewww.yourname.com.tw
DocumentRoot "e:/wamp64/www/webs/www.yourname.com.tw"
<Directory "e:/wamp64/www/webs/www.yourname.com.tw/">
Options +Indexes +FollowSymLinks +MultiViews
AllowOverride All
require all granted
</Directory>
</VirtualHost>

然後重啟服務,其他電腦就可以連線了

一步一步把WampServer裝好裝滿

WampServer SSL設定

參考這篇先申請SSL For Free

將下載的三個檔更改檔名為yourssl,放在E:\wamp64\bin\apache\apache2.4.33\conf\

編輯http-ssl.conf (E:\wamp64\bin\apache\apache2.4.33\conf\extra)

修改程式碼的路徑,大概有以下幾列:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
SSLSessionCache "shmcb:E:/wamp64/bin/apache/apache2.4.33/logs/ssl_scache(512000)"

ErrorLog "E:/wamp64/bin/apache/apache2.4.33/logs/error.log"

TransferLog "E:/wamp64/bin/apache/apache2.4.33/logs/access.log"

SSLCertificateFile "E:/wamp64/bin/apache/apache2.4.33/conf/yourssl.crt"

SSLCertificateKeyFile "E:/wamp64/bin/apache/apache2.4.33/conf/yourssl.key"

&lt;Directory "E:/wamp64/bin/apache/apache2.4.33/cgi-bin"&gt;
SSLOptions +StdEnvVars

CustomLog "E:/wamp64/bin/apache/apache2.4.33/logs/ssl_request.log" \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x "%r" %b"

編輯httpd.conf

LoadModule socache_shmcb_module modules/mod_socache_shmcb.so

LoadModule ssl_module modules/mod_ssl.so

Include conf/extra/httpd-ssl.conf

編輯httpd-vhosts.conf

<VirtualHost *:443>
ServerName www.yourname.com.tw:443
DocumentRoot "e:/wamp64/www/webs/www.yourname.com.tw"
<Directory "e:/wamp64/www/webs/www.yourname.com.tw/">
Options +Indexes +FollowSymLinks +MultiViews
AllowOverride All
require all granted
</Directory>
SSLEngine on
SSLCertificateFile "E:/wamp64/bin/apache/apache2.4.33/conf/yourssl.crt"
SSLCertificateKeyFile "E:/wamp64/bin/apache/apache2.4.33/conf/yourssl.key"
SSLCACertificateFile "E:/wamp64/bin/apache/apache2.4.33/conf/yourssl_ca_bundle.crt"
</VirtualHost>

重啟服務

網站Log分別紀錄

編輯httpd-vhosts.conf

1
2
CustomLog "|e:/wamp64/bin/apache/apache2.4.33/bin/rotatelogs.exe e:/wamp64/logs/www.yourname.com.tw/access.log-%m-%d 86400" common
ErrorLog "|e:/wamp64/bin/apache/apache2.4.33/bin/rotatelogs.exe e:/wamp64/logs/www.yourname.com.tw/error.log-%m-%d 86400"

觀察server-status

編輯httpd.conf

開啟 mod_info.so
開啟 mod_status.so
開啟 httpd-info.conf

瀏覽器輸入http://127.0.0.1/server-status?refresh=5

設定Wampserver開機自動啟動

一步一步把WampServer裝好裝滿

與大家分享...
一步一步把WampServer裝好裝滿
Facebook
0一步一步把WampServer裝好裝滿
Google+
0一步一步把WampServer裝好裝滿
Pinterest
0一步一步把WampServer裝好裝滿
email
0 回復

發表評論

想要留言嗎?
歡迎歡迎!

發表迴響

你的電子郵件位址並不會被公開。 必要欄位標記為 *