apache和apache2如何隱藏版本資訊
1.3.24版:
#cd /usr/ports/www/apache13
#make configure (重要)
#cd work/apache...(不記得了:-)/src/include
#ee httpd.h
修改其中三行,將""中的內容改成你想像的……;-)
#define SERVER_BASEVENDOR "Apache Group"
#define SERVER_BASEPRODUCT "apache"
#define SERVER_BASEREVISION "1.3.24"
#cd ../main/
#ee http_main.c
修改下面這段程式碼:
* Pieces for managing the contents of the Server response header
* field.
*/
static char *server_version = NULL;
static int version_locked = 0; #將0改為1
/* Global, alas, so http_core can talk to us */
enum server_token_type ap_server_tokens = SrvTk_FULL; #改為SrvTk_MIN
/*
* This routine is called when the pconf pool is vacuumed. It resets the
* server version string to a known value and [re]enables modifications
* (which are disabled by configuration completion).
*/
static void reset_version(void *dummy)
{
version_locked = 0; #將0改為1
ap_server_tokens = SrvTk_FULL; #改為SrvTk_MIN
server_version = NULL;
}