how to change apache product name on header

Posted: 31st July 2010 by admin in Linux How to

how to change apache product name on header

vi /apache_1.3.X/src/include/httpd.h

หา

#define SERVER_BASEVENDOR “Apache Group”
#define SERVER_BASEPRODUCT “Apache”
#define SERVER_BASEREVISION “1.3.X”
#define SERVER_BASEVERSION SERVER_BASEPRODUCT “/” SERVER_BASEREVISION

#define SERVER_PRODUCT SERVER_BASEPRODUCT
#define SERVER_REVISION SERVER_BASEREVISION
#define SERVER_VERSION SERVER_PRODUCT “/” SERVER_REVISION
enum server_token_type {
SrvTk_MIN, /* eg: Apache/1.3.0 */
SrvTk_OS, /* eg: Apache/1.3.0 (UNIX) */
SrvTk_FULL, /* eg: Apache/1.3.0 (UNIX) PHP/3.0 FooBar/1.2b */
SrvTk_PRODUCT_ONLY /* eg: Apache */
};

เปลี่ยนเป็น

#define SERVER_BASEVENDOR “Apache Group”
#define SERVER_BASEPRODUCT “Microsoft-IIS” << เปลี่ยนเป็นอะไรก็ได้
#define SERVER_BASEREVISION “6.0″ << เปลี่ยนเป็นอะไรก็ได้
#define SERVER_BASEVERSION SERVER_BASEPRODUCT “/” SERVER_BASEREVISION

#define SERVER_PRODUCT SERVER_BASEPRODUCT
#define SERVER_REVISION SERVER_BASEREVISION
#define SERVER_VERSION SERVER_PRODUCT “/” SERVER_REVISION
enum server_token_type {
SrvTk_MIN, /* eg: Apache/1.3.0 */
SrvTk_OS, /* eg: Apache/1.3.0 (UNIX) */
SrvTk_FULL, /* eg: Apache/1.3.0 (UNIX) PHP/3.0 FooBar/1.2b */
SrvTk_PRODUCT_ONLY /* eg: Apache */
};

เซพแล้ว compile ใหม่

เพิ่ม ServerTokens Min ใน httpd.conf

##########################################################

#Apache Server

HOW TO CHANGE Server : Apache/2.X.X TO Server : ???????

vi /httpd-2.X.X/include/ap_release.h

หา

#define AP_SERVER_BASEVENDOR “Apache Software Foundation”
#define AP_SERVER_BASEPRODUCT “Apache”

#define AP_SERVER_MAJORVERSION_NUMBER 2
#define AP_SERVER_MINORVERSION_NUMBER X
#define AP_SERVER_PATCHLEVEL_NUMBER X
/* #define AP_SERVER_DEVBUILD_BOOLEAN 1 */

เปลี่ยนเป็น

#define AP_SERVER_BASEVENDOR “Apache Software Foundation”
#define AP_SERVER_BASEPRODUCT “Microsoft-IIS/6.0″ << เปลี่ยนเป็นอะไรก็ได้

#define AP_SERVER_MAJORVERSION_NUMBER 2
#define AP_SERVER_MINORVERSION_NUMBER X
#define AP_SERVER_PATCHLEVEL_NUMBER X
/* #define AP_SERVER_DEVBUILD_BOOLEAN 1 */

เซพแล้ว compile ใหม่
เพิ่ม ServerTokens Prod ใน httpd.conf

เคยเขียนไว้เองใน thaibsd
เอามาเก็บไว้เผื่อมีคนจะใช้

*
Security Code: