如何在不使用mod

编程入门 行业动态 更新时间:2024-10-24 14:26:55
本文介绍了如何在不使用mod_security的情况下更改Apache的"Server:"标头?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

如何在不使用mod_security的情况下更改Apache的 Server:标头?

How to change Apache's Server: header without mod_security?

我不想使用mod_security,因为我没有其他要求.这对我来说是无用的开销.

I do not want to use mod_security because I don't have anything else to do with it. And it is a useless overhead for me.

相反,我应该在Apache的源代码中进行哪些更改?我通常使用从源代码编译的Apache.

Instead, what should I change in the Apache's source? I usually use Apache compiled from source.

我正在使用Apache 2.4.46版本.

I am using Apache version 2.4.46.

推荐答案

要更改Apache的 Server:标头,请在源代码中更改以下内容:

To change Apache's Server: header, change the following in the source code:

更改文件/path/to/httpd-2.4.46/include/ap_release.h :

转到以下行:

... #define AP_SERVER_BASEPROJECT "Apache HTTP Server" #define AP_SERVER_BASEPRODUCT "Apache" ...

并将其更改为任何内容,例如:

And change it to anything, like:

... #define AP_SERVER_BASEPROJECT "Apache Something My Server" #define AP_SERVER_BASEPRODUCT "Apache My Server" ...

然后编译apache,您就很好了!

And then compile apache, and you are good!

此外,请确保遵循其随附的许可证.有关许可证的问题不在这里.

Also, make sure to follow the license that is provided with it. Questions about license here are off-topic.

更多推荐

如何在不使用mod

本文发布于:2023-11-01 12:25:42,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1549326.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何在   mod

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!