关于apache的优化配置
2013-01-07 16:16
323 查看
apache的默认工作模式是event.c ,查看其工作模式是在apache安装目录的bin下面进行如下命令:
./apachectl -l 显示如下:
Compiled in modules:
core.c
mod_so.c
http_core.c
event.c
其默认是event.c,另在conf目录下的extra目录运行以命令:
vi httpd-mpm.conf 查看其模式配置:
# prefork MPM
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare
# MaxSpareServers: maximum number of server processes which are kept spare
# MaxRequestWorkers: maximum number of server processes allowed to start
# MaxConnectionsPerChild: maximum number of connections a server process serves
# before terminating
<IfModule mpm_prefork_module>
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxRequestWorkers 250
MaxConnectionsPerChild 0
</IfModule>
# worker MPM
# StartServers: initial number of server processes to start
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadsPerChild: constant number of worker threads in each server process
# MaxRequestWorkers: maximum number of worker threads
# MaxConnectionsPerChild: maximum number of connections a server process serves
# before terminating
<IfModule mpm_worker_module>
StartServers 3
MinSpareThreads 75
MaxSpareThreads 250
ThreadsPerChild 25
MaxRequestWorkers 400
MaxConnectionsPerChild 0
</IfModule>
由于上面默认是event.c的模式,因此需要到源文件下面make clen,删除掉apche目录重新安装,执行以下命令:
./configure --prefix=/usr/local/apache --enable-module=all --with-apr=/usr/local/apr-1.4.6 --with-apr-util=/usr/local/apr-util-1.5.1 --with-pcre=/usr/local/pcre-8.32/ --with-included-apr --with-mpm=worker --enable-cache-disk
--enable-file-cache --enable-so
此处需要将with-included-apr加上,不然加载模块会出错,另外要将需要把apr和apr-util的源文件copy到httpd的源文件的目录srclib下面
cp -r apr-1.4.6 httpd-2.4.3/srclib/apr
cp -r apr-util-1.5.1 httpd-2.4.3/srclib/apr-util
./apachectl -l 显示如下:
Compiled in modules:
core.c
mod_so.c
http_core.c
event.c
其默认是event.c,另在conf目录下的extra目录运行以命令:
vi httpd-mpm.conf 查看其模式配置:
# prefork MPM
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare
# MaxSpareServers: maximum number of server processes which are kept spare
# MaxRequestWorkers: maximum number of server processes allowed to start
# MaxConnectionsPerChild: maximum number of connections a server process serves
# before terminating
<IfModule mpm_prefork_module>
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxRequestWorkers 250
MaxConnectionsPerChild 0
</IfModule>
# worker MPM
# StartServers: initial number of server processes to start
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadsPerChild: constant number of worker threads in each server process
# MaxRequestWorkers: maximum number of worker threads
# MaxConnectionsPerChild: maximum number of connections a server process serves
# before terminating
<IfModule mpm_worker_module>
StartServers 3
MinSpareThreads 75
MaxSpareThreads 250
ThreadsPerChild 25
MaxRequestWorkers 400
MaxConnectionsPerChild 0
</IfModule>
由于上面默认是event.c的模式,因此需要到源文件下面make clen,删除掉apche目录重新安装,执行以下命令:
./configure --prefix=/usr/local/apache --enable-module=all --with-apr=/usr/local/apr-1.4.6 --with-apr-util=/usr/local/apr-util-1.5.1 --with-pcre=/usr/local/pcre-8.32/ --with-included-apr --with-mpm=worker --enable-cache-disk
--enable-file-cache --enable-so
此处需要将with-included-apr加上,不然加载模块会出错,另外要将需要把apr和apr-util的源文件copy到httpd的源文件的目录srclib下面
cp -r apr-1.4.6 httpd-2.4.3/srclib/apr
cp -r apr-util-1.5.1 httpd-2.4.3/srclib/apr-util
相关文章推荐
- apache优化配置
- 关于apache服务的相关配置介绍
- apache优化配置
- 关于apache-tomcat-6.0.14配置的体会
- Apache安装、配置、优化
- Apache 性能配置优化
- Apache配置虚拟主机,关于403问题的解决
- 关于win8系统下的80端口被占用,Apache启动失败.2,MySQL5.1启动失败,请检查相关配置
- 关于网络编程中MTU、TCP、UDP优化配置的一些总结
- 读《实战nginx-取代Apache的高性能web服务器》-"Nginx HTTP 负载均衡和反向代理的配置与优化"精华纪要
- 关于Apache mod_rewrite的中文配置、使用和语法介绍(实现URL重写和防盗链功能)
- 关于Yii2.0的url路径优化问题(配置虚拟路径)
- Apache配置压缩优化时报错――undefined symbol: inflateEnd
- 通过windows任务计划来备份数据库以及检测apache是否正常运行-sever 2008 Apache优化配置
- Apache的配置优化
- apache配置优化测试
- Apache优化配置——工作模式
- apache配置优化之各模式下的效率测试
- Apache 2.0性能优化—MPM的选择与配置(转)
- Apache 2.0性能优化—MPM的选择与配置