LAMP安全加固之apache篇(1)
LAMP安全加固之apache篇(1)
图-LAMP
一用LAMP,我就想到LAMP安全的问题,安全那是必须要搞定的!看看我是如何办的!
apache方面:
1.修改banner
编译源代码,修改默认的banner
ServerTokens ProductOnly
ServerSignature Off
在apache的源码包中找到ap_release.h将
#define AP_SERVER_BASEPRODUCT “Apache”
修改为
#define AP_SERVER_BASEPRODUCT “Microsoft-IIS/6.0”
os/unix下的os.h文件
#define PLATFORM “Unix”
修改为
#define PLATFORM “Win32“
2.修改默认的http状态响应码404,503等默认页面
3.Apache的访问权限控制
htpasswd -b -c /(存放密码文件路径)/.htpasswd username password
Alias /hack “/var/www/html/hack/”
authname “test”
authtype basic
authuserfile /var/www/html/hack/.htpasswd
require user kindle
评论暂时关闭