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

Hardening Apache: How to disable Apache manual or make it unreachable?

· 52CE 我爱测

I just found requests like this in my access log: 180.76.15.134 - - [30/Oct/2017:22:38:05 +0100] "GET /manual/en/server-wide.html HTTP/1.1" 200 3551 "-" "Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spid…

问题原文

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

I just found requests like this in my access log:

180.76.15.134 - - [30/Oct/2017:22:38:05 +0100] "GET /manual/en/server-wide.html HTTP/1.1" 200 3551 "-" "Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)"

Accessing this path surprised me: my server (Ubuntu 16.04 / Apache 2.4 / Virtualmin, hardened by various guides i.e. to not expose it's OS or the version of the webserver) responded with the Apache manual that exposed at least it's version.

Now of course there's no directory manual. But I also couln't find a directive or so. Googling around did not give me an answer.

Does someone know where this comes from and how to disable it? Of course I could try to declare a <LocationMatch>-directive, but I want to know where it comes from and whether it's possible to supress this the right way. Who knows what else is going on there...

已采纳解答

原帖链接 · HBruijn · CC BY-SA 4.0

It is considered good practice to not install OS components and software packages that are not necessary.

The apache httpd manual is as far as I know not installed by default but an optional package, that as such can easily be removed and/or disabled.

You probably installed the documentation package apache2-doc which installs a drop-in configuration file /etc/apache2/conf-available/apache2-doc.conf that serves content from /usr/share/doc/apache2-doc/manual

Either remove the package apache2-doc or disable configuration drop-in with a2disconf apache2-doc (and restart your webserver).

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

资料来源与适用范围

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

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

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