我安装的软件是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/
此连接中还有一些优化设置