Web server Security

Source: Internet
Author: User

Apache Close Directory

Configuration files: Installation directory/apache/conf/httpd.conf

<directory/>    #默认就会把/directory burst out; Close method: Options-indexes followsymlinks (-Indexes indicates opposite)         +indexes +followsymlinks +execcgi    # or      ----->   Options function to close: Options None    allowoverride all    Order allow,deny    fromall     Require all granted</Directory>

Apache Hidden version Number
window:default settings# Include conf/extra/httpd-default. conf  # Remove the previous comment #
# Modify Httpd-default.conf
Servertokens full change to Servertokens Prod
Serversignature on change to serversignature off

 liunx:  Modify conf/extra/httpd-default.conf, much as the following message:servertokens full toServertokens Prodserversignature on change to Serversignature Off

Here are some of the possible assignments for Servertokens :

Servertokens Prod display "Server:apache"
Servertokens Major Display "Server:apache/2″
Servertokens Minor Display "Server:apache/2.2″
Servertokens Min Display "Server:apache/2.2.17″
Servertokens OS Display "server:apache/2.2.17 (Unix)"
Servertokens full Display "server:apache/2.2.17 (Unix) Php/5.3.5″

Nginx Close Directory

Modify Configuration:/usr/local/nginx/conf/nginx.conf

AutoIndex on;  #默认管文件目录列表 #另外两个参数最好也加上去autoindex_exact_size off; # Default is on to show the exact size of the file, in bytes. # After change to OFF, the approximate size of the file is displayed, in kilobytes or MB or GB autoindex_localtime on; # The default is off and the file time displayed is GMT time. # When on, displays the file time as the file's server time

Nginx Hidden Version number
 -  # Add last line }

Edit a php-fpm configuration file, such as fastcgi.conf or fcgi.conf

# Find the following line fastcgi_param server_software nginx/$nginx _version;  # modified to fastcgi_param server_software nginx;

PHP Hidden version number

Configuration file PHP.ini

expose_php = on  # changed to OFF, the header information will be hidden x-powered-by:php/7.1.0

Web server Security

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.