我安裝的軟件是xampp-win32-1.8.2-0-VC9-installerphp
須要配置的文件有html
httpd.confmysql
httpd-default.confweb
httpd-info.confsql
httpd-xampp.confapache
xampp安裝後,如下文件夾內的內容須要配置修改windows
xamp\apache\bin安全
xamp\apache\confpost
xamp\apache\conf\extra優化
xamp\apache\modules
---如下是我本身遇到的問題
---windows server 2008的系統
1.安裝後啓動不了,總提示libsasl.dll缺失
解決方法:將xampp/php/libsasl.dll文件複製到xampp\apache\bin文件下
2.apache中設置端口 (xampp\apache\conf\httpd.conf)
默認是80端口,能夠修改,以下,
#Listen 12.34.56.78:80
#Listen 80
Listen 8081
這樣設置後,本地啓動網址爲http://localhost:8081/
若是須要多個端口能夠再添加
例如:
Listen 8082
NameVirtualHost *:8082
<VirtualHost *:8082>
ServerName localhost:8082
DocumentRoot "D:/xampp/htdocs/projectname"
</VirtualHost>
其中servername和documentroot要根據實際狀況改變
如IP爲10.1.12.3 則 ServerName 10.1.12.3:8082
DocumentRoot 則是你程序的位置
3.網站啓動後可能會存在slow http post、slowloris的安全性問題(xampp\apache\conf\httpd.conf)
解決slow http post的方法
解決方法:LoadModule reqtimeout_module modules/mod_reqtimeout.so前的'#'去掉 並添加以下內容
//其實如下內容在xampp\apache\conf\extra\httpd-default.conf文件中已設置,保證httpd.conf文件中保證Include "conf/extra/httpd-default.conf"此句話存在且未被註釋便可
<IfModule reqtimeout_module>
RequestReadTimeout header=20-40,MinRate=500 body=20,MinRate=500
</IfModule>
如下的內容也多是須要配置的,可是我未驗證
<IfModule mod_qos.c>
# handle connections from up to 100000 different IPs
QS_ClientEntries 100000
# allow only 50 connections per IP
QS_SrvMaxConnPerIP 50
# limit maximum number of active TCP connections limited to 256
MaxClients 256
# disables keep-alive when 180 (70%) TCP connections are occupied
QS_SrvMaxConnClose 180
# minimum request/response speed (deny slow clients blocking the server, keeping connections open without requesting anything
QS_SrvMinDataRate 150 1200
</IfModule>
解決slowloris的方法:
下載適合你電腦的mod_antiloris.so,個人是x86_2.4_vc10,將mod_antiloris.so放到xampp\apache\modules位置下
LoadModule antiloris_module modules/mod_antiloris.so
<IfModule antiloris_module>
IPReadLimit 50
</IfModule>
4.網站啓動後,網站會泄露apache,php的版本信息問題(xampp\apache\conf\extra\httpd-default.conf)
解決方法,將此文件中的ServerTokens,ServerSignature值修改
#ServerTokens Full
ServerTokens Prod
#ServerSignature On
ServerSignature Off
5.網站啓動後,網站會泄露apache狀態信息即server-status、server-info(xampp\apache\conf\extra\httpd-info.conf)
解決方法:將SetHandler server-status和SetHandler server-info註釋掉
<Location /server-status>
#SetHandler server-status
</Location>
<Location /server-info>
#SetHandler server-info
</Location>
6.關於New XAMPP security concept問題,(xampp中關於登陸的一些問題)(xampp\apache\conf\extra\httpd-xampp.conf)
我的理解:讓xampp的登陸頁面只能本地訪問,其餘位置都不能夠訪問xampp、mysql等的登陸頁面
<LocationMatch "^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))">
Order deny,allow
Deny from all
#Allow from ::1 127.0.0.0/8 \
# fc00::/7 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 \
# fe80::/10 169.254.0.0/16
Allow from 127.0.0.1
ErrorDocument 403 /error#/XAMPP_FORBIDDEN.html.var
</LocationMatch>
7.配置完後,須要重啓apache才能生效
8.xampp安裝好後,apache不是系統的服務
xampp\apache\apache_installservice.bat
右擊此文件以管理員身份運行,apache服務就是出現服務內了,若是沒出現,重啓電腦應該能夠出現
xampp\apache\apache_uninstallservice.bat
右擊此文件以管理員身份運行,apache服務能夠從電腦服務中卸載掉
9.php簡寫模式打開
php中有些代碼用簡寫即<? ?>編輯的因此php.ini中
short_open_tag = On
10.error_log="D:\tools\xampp\php\logs\php_error_log"
將php.ini文件中此句話註釋掉,防止產生大量的日誌文件
11.extension=php_ldap.dll
php.ini文件中此句話,表示使用域帳號,若是程序不適用域帳號,此句話需註釋
12.http://boxbaby123.blog.163.com/blog/static/23542244201412610412746/
此連接中還有一些優化設置