apache安装&优化-Windows

安装

准备
https://www.apachelounge.com/download/ 下载apache及jk

解压并配置httpd.conf 中的SRVROOT
这里需要 /
httpd.conf

如果使用\ 启动报错如下
报错

删除服务 SC

期间其他命令

优化

MPM参见 https://httpd.apache.org/docs/2.4/mod/mpm_winnt.html
开启 需要将 httpd.conf 中#Include conf/extra/httpd-mpm.conf 放开
mpm中有好多种mpm

Netware mpm_netware
OS/2 mpmt_os2
Unix prefork,worker 或 event,取决于平台特性
Windows mpm_winnt
其中win默认走WinNT,也可使用如下命令检测当前使用哪一种

D:\Apache24\bin>httpd.exe -l
Compiled in modules:
  core.c
  mod_win32.c
  mpm_winnt.c
  http_core.c
  mod_so.c

This Multi-Processing Module (MPM) is the default for the Windows NT operating systems

WinNT MPM

ThreadsPerChild: constant number of worker threads in the server process

MaxConnectionsPerChild: maximum number of connections a server process serves

ThreadsPerChild 150 MaxConnectionsPerChild 0 ThreadsPerChild 最大1920 设置500~1000即可 MaxConnectionsPerChild 还待测试 有机会参照https://blog.csdn.net/kenhins/article/details/77717318 这个做个测试

另外,可以通过查看Apache提供的server-status(状态报告)来验证当前所设置数值是否合理,在httpd.conf文件中做如下设置来打开它:

* # 首先需要加载mod_status模块
 LoadModule status_module modules/mod_status.so
* # 然后设置访问的地址
 <Location /server-status>
    SetHandler server-status
     Order deny,allow
     Deny from all
     Allow from all
posted @ 2020-06-16 18:11  Qtong  阅读(248)  评论(0)    收藏  举报