大网数据广告活动
服务器运维问答

Is chrooting possible with apache 2.4 on RHEL 7? Does it make sense to chroot ?

· 52CE 我爱测

I did my research and found that people are unsure if chroot is helpful in security. I have these questions left unanswered. Is chrooting worthwhile if yes can it be done for httpd 2.4 on rhel 7?Please share any resource or refer…

问题原文

原帖链接 · Dextro67 · CC BY-SA 3.0

I did my research and found that people are unsure if chroot is helpful in security. I have these questions left unanswered. Is chrooting worthwhile if yes can it be done for httpd 2.4 on rhel 7?Please share any resource or reference. If not what can be an equivalent way to secure the web server?

Thanks in Advance.

已采纳解答

原帖链接 · Joe · CC BY-SA 3.0

This has been discussed before: How to chroot Apache on CentOS?

Yes, it's possible to chroot apache. In apache 2.4 you need the mod_unixd module (https://httpd.apache.org/docs/2.4/mod/mod_unixd.html). This page explains how to do it: https://www.howtoforge.com/tutorial/chrooting-apache-2.4-with-mod_unixd-on-debian-8-jessie/ Despite it claiming to be a guide for Debian, it should still work for RHEL, since the guide simply mentions what directives to use in apache 2.4.

That being said, I don't think the perceived benefits are worth the costs. This ancient (May 2004) document discusses pros/cons of chrooting apache. One key phrase from the article:

Installing Apache in a chroot jail does not make Apache itself any more secure. Rather, it serves to restrict the access of Apache and its child processes to a small subset of the filesystem. The advantage in chrooting a process is not in preventing a breakin, but rather in containing a potential threat.

And, as the aforementioned question/answer says, a much better method to containing breakins is to use the already provided security feature of RHEL: SELinux. Most administrators simply turn this off at installation so they don't have to deal with the headache. However, a bit of time learning this powerful feature will save a lot more headache down the road.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2017-06-20)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。