如何在CentOS/RHEL中启用Apache的KeepAlive服务

HTTP Keep-Alive 或HTTP持久连接是用于发送和接收一个TCP连接多个HTTP请求和响应的概念。大多数网站的速度分析仪的建议使用 Keep-Alive 为您的网站。 让我们在CentOS / RedHat系统中编辑Apache配置文件并启用 Keep-Alive。默认情况下Apache服务器 Keep-Alive 被禁用,所以按照下面的步骤来启用它。
# vim /etc/httpd/conf/httpd.conf
现在改变以下值,如下所示
#
# KeepAlive: Whether or not to allow persistent connections
#
KeepAlive On

#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection.

MaxKeepAliveRequests 100

#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 15
现在,使用以下命令重新启动Apache服务,您已成功的在你的Apache服务器上开启Keep-Alive。
# service httpd restart
赞(52) 打赏
未经允许不得转载:优客志 » 系统运维
分享到:

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏