cPanel Tutorials | Security Guides | News Feeds | Search
Navigation
Home
Guides
Password Generator
Files
News Feeds
Hosting News
Contact Us
Documentation
Site Search
 
Latest Guides
Largest number of established connections
Kill all processes matching certain strings.
Install FFmpeg-PHP
Install FFmpeg
Configure Squid
Install Squid
Password Security
Install Teamspeak
Disable SELinux
Install RoundCube on cPanel

Viewing Guide 

Change Apache Version Header
Written by: HostGeekZ



This guide is wraped for easy viewing, to see the non wraped version Click Here



If you wish to set your own server version for Apache too somthing else that maybe fits into your company name, its actually a very simple process but it does involve adjusting the apache source.

An example of what it looks like after you have edited is google.com

HTTP/1.1 200 OK
Cache-Control: private
Content-Type: text/html
path=/; domain=.google.com
Server: GWS/2.1
Content-Length: 0
Date: Wed, 16 Nov 2005 21:33:28 GMT




As you see it returns GWS, speculation says its Google Web Server however watching as the versions go on they match the Apache releases, so they either use a heavily modded apache version or just the simple change that I am about to show.

Apache does have this feature somewhat built in already and all we are changing is one line.


if (ap_server_tokens == SrvTk_PRODUCT_ONLY) {
ap_add_version_component(pconf, AP_SERVER_BASEPRODUCT);
}
else if (ap_server_tokens == SrvTk_MINIMAL) {
ap_add_version_component(pconf, AP_SERVER_BASEVERSION);
}
else if (ap_server_tokens == SrvTk_MINOR) {
ap_add_version_component(pconf, AP_SERVER_BASEPRODUCT "/" AP_SERVER_MINORREVISION);
}
else if (ap_server_tokens == SrvTk_MAJOR) {
ap_add_version_component(pconf, AP_SERVER_BASEPRODUCT "/" AP_SERVER_MAJORVERSION);
}
else {
ap_add_version_component(pconf, AP_SERVER_BASEVERSION " (" PLATFORM ")");
}




This is where it sets the product version, and if you set it to Prod it will only return the base_product with nothing else, so all we have to do is adjust the base_product. Anyway enough babbling and lets get straight to the point.

Firstly, you will need to grab a copy of apache from http://www.apache.org and untar it,

Now we need to modify include/ap_release.h before compiling

nano include/ap_release.h



Find

#define AP_SERVER_BASEPRODUCT "Apache"



and replace it with

#define AP_SERVER_BASEPRODUCT "HostGeekZ"



Obviously replacing HostGeekZ with the version you wish to use.

Now compile and install apache

./configure --prefix=/usr/hostgeekz
make
make install



Now want to set httpd.conf to read the first statement of server_baseproduct only to do this open httpd.conf, the path will depend on what you set --prefix to, as we used /usr/hostgeekz this is where httpd.conf will be

nano /usr/hostgeekz/conf/httpd.conf



Now find

ServerSig


and set this too

ServerSig off



Then add this below

ServerTokens Prod



Then start apache, you are now complete and it should return


Server: HostGeekZ


User Comments 
     
Name:
Email: If you provide your email address you will receive updates for this guide to it.
Comment:
Verification We require you to add the following 2 values together for anti-spam purposes.
8 + 8
   

©Copyright HostGeekZ 2004-2007. All Rights Reserved.
Resources