https://github.com/bostrt/mod_serverheader
Override Apache HTTPD Server header
https://github.com/bostrt/mod_serverheader
httpd module
Last synced: 12 months ago
JSON representation
Override Apache HTTPD Server header
- Host: GitHub
- URL: https://github.com/bostrt/mod_serverheader
- Owner: bostrt
- License: apache-2.0
- Created: 2017-02-24T02:32:30.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2020-07-31T15:57:50.000Z (over 5 years ago)
- Last Synced: 2025-02-12T20:35:17.001Z (about 1 year ago)
- Topics: httpd, module
- Language: C
- Homepage: https://robertbost.wordpress.com/2017/03/19/introducing-mod_serverheader/
- Size: 16.6 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## 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](https://copr.fedorainfracloud.org/coprs/bostrt/mod_serverheader/repo/epel-7/bostrt-mod_serverheader-epel-7.repo).
## Configuration
`/etc/httpd/conf.d/mod_serverheader.conf`
## ServerHeader Directive
[Description](https://httpd.apache.org/docs/2.4/mod/directive-dict.html#Description): Modify Server header contents
[Syntax](https://httpd.apache.org/docs/2.4/mod/directive-dict.html#Syntax): ServerHeader *value*
[Context](https://httpd.apache.org/docs/2.4/mod/directive-dict.html#Context): server config, virtual host
[Module](https://httpd.apache.org/docs/2.4/mod/directive-dict.html#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`](https://httpd.apache.org/docs/2.4/mod/core.html#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/
