1.勤打补丁[没经验,能先用好就不错了]
2.伪装版本
修改httpd.conf
ServerSignature off
ServerTokens Prod
然后这类的话就不见了
Apache/2.2.14 (Ubuntu) Server at 210.32.200.* Port 11***
3.安全的目录结构
/opt/www
/etc/apache2/site-enabled
/var/log
经验1
在site-available中写好网站配置文件,然后
cd ../site-enabled
ln -s ../site-available/xxx.conf
4.Apache 用户组
配置文件httpd.conf 里面的User和Group 设置单独的用户和用户组,比如www-data,不要用系统预定义的账号,比如nobody
5.Apache配置文件
6.网站配置
最简单的配置文件
<VirtualHost 127.0.0.1:11063>
DocumentRoot /opt/www/recruit
ServerName suzie.com
</VirtualHost>
经验
例子:从当前目录开始查找所有扩展名为.in的文本文件,并找出包含”thermcontact”的行
find . -name "*.in" | xargs grep "thermcontact"
7.访问权限
所有目录755 所有文件755
修改配置文件httpd.conf或者xxx.conf
1.禁止目录访问
Options -Indexes FollowSymLinks
2.禁止默认访问 Apache禁止目录访问 Apache的Order Allow,Deny 详解
Order deny,allow
Allow from all
3.禁止用户重载
AllowOverride None
在配置news 语义化连接SEO接触过,因为要开启Apache的 mod_rewirte,由drupal处理url的重写。
4.服务器访问控制
Order deny,allow
deny from all
allow from pair 192.168.1.0/255.255.255.0
.htaccess
1.建立.htpasswd文件 2.htaccess文件实现保护 ...