zoukankan      html  css  js  c++  java
  • xampp-apache配置

    我安装的软件是xampp-win32-1.8.2-0-VC9-installer

    需要配置的文件有

    httpd.conf

    httpd-default.conf

    httpd-info.conf

    httpd-xampp.conf

    xampp安装后,以下文件夹内的内容需要配置修改

    xampapachein

    xampapacheconf

    xampapacheconfextra

    xampapachemodules

    ---以下是我自己遇到的问题

    ---windows server 2008的系统

    1.安装后启动不了,总提示libsasl.dll缺失

      解决方法:将xampp/php/libsasl.dll文件复制到xamppapachein文件下

    2.apache中设置端口 (xamppapacheconfhttpd.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的安全性问题(xamppapacheconfhttpd.conf)  

      解决slow http post的方法

      解决方法:LoadModule reqtimeout_module modules/mod_reqtimeout.so前的'#'去掉 并添加如下内容

      //其实以下内容在xamppapacheconfextrahttpd-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放到xamppapachemodules位置下

      LoadModule antiloris_module modules/mod_antiloris.so
      <IfModule antiloris_module>
      IPReadLimit 50
      </IfModule>

    4.网站启动后,网站会泄露apache,php的版本信息问题(xamppapacheconfextrahttpd-default.conf)

      解决方法,将此文件中的ServerTokens,ServerSignature值修改

      #ServerTokens Full
      ServerTokens Prod

      #ServerSignature On
      ServerSignature Off

    5.网站启动后,网站会泄露apache状态信息即server-status、server-info(xamppapacheconfextrahttpd-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中关于登录的一些问题)(xamppapacheconfextrahttpd-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不是系统的服务

      xamppapacheapache_installservice.bat

      右击此文件以管理员身份运行,apache服务就是出现服务内了,如果没出现,重启电脑应该可以出现

       xamppapacheapache_uninstallservice.bat

      右击此文件以管理员身份运行,apache服务可以从电脑服务中卸载掉

    9.php简写模式打开

      php中有些代码用简写即<? ?>编辑的所以php.ini中 

      short_open_tag = On

     10.error_log="D: oolsxamppphplogsphp_error_log"

      将php.ini文件中此句话注释掉,防止产生大量的日志文件

    11.extension=php_ldap.dll

      php.ini文件中此句话,表示使用域账号,如果程序不适用域账号,此句话需注释

    12.http://boxbaby123.blog.163.com/blog/static/23542244201412610412746/

      此链接中还有一些优化设置

  • 相关阅读:
    AIMS 2013中的性能报告工具不能运行的解决办法
    读懂AIMS 2013中的性能分析报告
    在线研讨会网络视频讲座 方案设计利器Autodesk Infrastructure Modeler 2013
    Using New Profiling API to Analyze Performance of AIMS 2013
    Map 3D 2013 新功能和新API WebCast视频下载
    为Autodesk Infrastructure Map Server(AIMS) Mobile Viewer创建自定义控件
    ADN新开了云计算Cloud和移动计算Mobile相关技术的博客
    JavaScript修改css样式style
    文本编辑神器awk
    jquery 开发总结1
  • 原文地址:https://www.cnblogs.com/jcz1206/p/3746027.html
Copyright © 2011-2022 走看看