Skip to content

bostrt/mod_serverheader

Repository files navigation

mod_serverheader

Installation

Fedora users

# dnf copr enable bostrt/mod_serverheader
# dnf install mod_serverheader

RHEL users

The copr plugin is now available for RHEL in Optional repos:

# yum install yum-plugin-copr
# yum copr enable bostrt/mod_serverheader
# yum install mod_serverheader

RHEL alternative

Drop YUM repo file into your /etc/yum/repos.d/. Here's the repo file for RHEL 7.

Configuration

/etc/httpd/conf.d/mod_serverheader.conf

ServerHeader Directive

Description: Modify Server header contents
Syntax: ServerHeader value
Context: server config, virtual host
Module: mod_serverheader


This directive allows you to override Apache HTTPD's Server response header. In addition to configuring this directive, you may also need to modify your ServerTokens directive to allow for a longer value to be used.

Example Usage:

LoadModule serverheader_module modules/mod_serverheader.so
ServerTokens Full
ServerHeader my-server

Client will see this:

# curl -I http://example.com/
HTTP/1.1 200 OK
Date: Sat, 25 Feb 2017 01:47:40 GMT
Server: my-server ◀◀◀◀◀◀◀◀
Content-Length: 8
Content-Type: text/html; charset=iso-8859-1

Building

# git clone https://github.com/bostrt/mod_serverheader.git
# cd mod_serverheader
# apxs -i -a -c mod_serverheader.c

Motivation

https://robertbost.wordpress.com/2017/03/19/introducing-mod_serverheader/