Giving Apache Web Server A Different Name by changing Source Code Before Installation (very simple instructions)
I am going to show you how to change Apache's source code before compiling and installing so that it always shows a different name while using the technique described here. I have used Apache version 2.0.59 for this tutorial. Assuming that you have already downloaded the source code and extracted all the files in httpd-2.0.59, 'cd' into httpd-2.0.59 and use 'nano' (or your favourite text editor) to open the file (httpd-2.0.59/server/core.c) containing the Apache label.
cd httpd-2.0.59 nano ./server/core.c Now, search for the string "ap_set_version(apr_pool_t *pconf)" (w/o quotes). If you are using nano press Ctrl-W to use the "search" option. On my computer the code (circled in red below) was present on line 2492, so it should be about the same on your computer as well. |

| Now, you have to put your string in place of the constant AP_SERVER_BASEPRODUCT (circled in yellow above). Please note that you'll have to put your string in double quotes e.g. "Techs Worldwide Web Server". Code in the file will look like below (string is circled in red) after making the changes explained. Please make sure that you put double quotes (") at both ends of your string. |

|
That's it. Save the file (Ctrl-O for nano) and exit out of the application (Ctrl-X for nano). Now, compile and install Apache using this modified code. Once your are done installing Apache, go to Apache's configuration file (http.conf by default) and change the value for "ServerTokens" directive to "ProductOnly" (w/o quotes). ServerTokens ProductOnly Restart Apache and use the technique described here to see the name of the server. The web server should be reporting "Techs Worldwide Web Server" as its name. |
Please feel free to use the comments form below if you have any questions or need more explanation on anything. Use the icons below to share this tutorial with your friends.
tags cloud
popular searches
free download for mysql database server 5.1.5, php, linux, mysql mysql, mysql, java, install mysql, gearman, ubuntu, tools, source code, bison, mysql initialization, install cairo, laptop
Similar Tutorials:
- How to install MySQL Gearman UDF on Ubuntu/Debian Linux
- Using encryption/decryption tool on geeksww.com
- Installing OpenSSL on Ubuntu Linux
- Download, configure, compile, and install MySQL 5.6
- How to download, compile, and install CMake on Linux


Comments (write a comment):
0 comments so far. Be the first one to leave a comment on this article.