Apache 服务安全加固
最后更新于
LogLevel notice #日志的级别 ErrorLog /…/logs/error_log #日志的保存位置(错误日志) LogFormat %h %l %u %t \”%r\” %>s %b “%{Accept}i\”%{Referer}i\” \”%{User-Agent}i\”” combined CustomLog /…/logs/access_log combined (访问日志) Order Deny,Allow Deny from all Order Allow,Deny Allow from /web Options FollowSymLinks AllowOverride None #Options Indexes FollowSymLinks #删掉Indexes Options FollowSymLinks AllowOverride None Order allow,deny Allow from all ErrorDocument 400 /custom400.html ErrorDocument 401 /custom401.html ErrorDocument 403 /custom403.html ErrorDocument 404 /custom404.html ErrorDocument 405 /custom405.html ErrorDocument 500 /custom500.html Timeout 10 #客户端与服务器端建立连接前的时间间隔 KeepAlive On KeepAliveTimeout 15 #限制每个 session 的保持时间是 15 秒。此处为建议值,具体的参数值需要根据现实际情况设定。 ServerSignature Off ServerTokens Prod TraceEnable Off #LoadModule cgi_module modules/mod_cgi.so#ScriptAlias /cgi-bin/ “/var/www/cgi-bin/”##AllowOverride None# Options None#Order allow,deny#Allow from all# cat /etc/httpd/conf/httpd.conf|grep Listen Listen x.x.x.x:80 # rm -rf /usr/local/apache2/htdocs/ # rm –rf /usr/local/apache2/cgi-bin/ # rm –rf /usr/local/apache2/manual # rm -rf /path/to/httpd-2.2.4* <Location /><LimitExcept GET POST CONNECT OPTIONS> Order Allow,Deny Deny from all</LimitExcept></Location> </article>
</main>