zoukankan      html  css  js  c++  java
  • Apache安全配置

    vi /etc/httpd/conf/httpd.conf #编辑文件
    ServerTokens OS  在44行修改为:ServerTokens Prod (在出现错误页的时候不显示服务器操作系统的名称)
    ServerSignature On  在536行修改为:ServerSignature Off (在错误页中不显示Apache的版本)
    Options Indexes FollowSymLinks  在331行修改为:Options Includes ExecCGIFollowSymLinks(允许服务器执行CGI及SSI,禁止列出目录)
    #AddHandlercgi-script .cgi 在796行修改为:AddHandlercgi-script .cgi .pl(允许扩展名为.pl的CGI脚本运行)
    AllowOverride None  在338行修改为:AllowOverride All (允许.htaccess)
    AddDefaultCharset UTF-8 在759行修改为:AddDefaultCharset GB2312 (添加GB2312为默认编码)
      Options Indexes MultiViewsFollowSymLinks 在554行修改为 Options MultiViewsFollowSymLinks(不在浏览器上显示树状目录结构)
    DirectoryIndex index.html index.html.var 在402行修改为:DirectoryIndex index.html index.htm Default.html Default.htm

    index.phpDefault.phpindex.html.var (设置默认首页文件,增加index.php)
    KeepAlive Off 在76行修改为:KeepAlive On (允许程序性联机)
    MaxKeepAliveRequests 100 在83行修改为:MaxKeepAliveRequests 1000 (增加同时连接数) 
    :wq! #保存退出
    /etc/init.d/httpd restart #重启
    rm -f /etc/httpd/conf.d/welcome.conf /var/www/error/noindex.html #删除默认测试页

  • 相关阅读:
    SpringMVC
    MyBatis 与 Spring 的完美整合方法
    持久层之 MyBatis: 第三篇 :缓存 And 高级查询
    持久层之 MyBatis: 第二篇 :动态SQL And多表查询
    C语言实现简单epoll服务器(二)
    C语言简单实现epoll服务器(一)
    shell编程题(十九)
    shell编程题(十七)
    shell编程题(十六)
    shell编程题(十三)
  • 原文地址:https://www.cnblogs.com/evilxr/p/3929252.html
Copyright © 2011-2022 走看看