Minimal exposure to server information

Source: Internet
Author: User

apache/2.2.15 (CentOS) dav/2 php/5.4.36 Server at 117.40.239.9 Port # College Linux Server

sometimes to minimize the need to expose relevant information for server security by controlling Servertokens and serversignature These 2 valves, servertokens to control whether the server corresponds to a request from the client, Output important system information such as server system types or built-in modules to the client.

Servertokens Prod/major/minor/minimal/os/full

Prod >>> Server:apache
Major >>> SERVER:APACHE/2
Minor >>> server:apache/2.2
Minimal >>> server:apache/2.2.15
OS >>> server:apache/2.2.15 (CentOS)
Full (or not specified) default >>> server:apache/2.2.15 (CentOS) php/5.4.36+b1 mod_ssl/2.0.55 openssl/0.9.8b

serversignature: directives allow you to configure page-foot information for server-side generated documents .

Off (default): Do not output any footer information;

on : Output A line about the version number and the ServerName of the running virtual host

Servertokens productonly

Serversignature Off #不输出任何页脚信息

PHP Version header file hidden back

[[email protected] conf] #vi/etc/php.ini

expose_php on Change to expose_php Off

After restarting Apache, the PHP version is hidden in the HTTP header.

Test command: [[email protected] conf]# curl-i 117.40.239.9

[Email protected] conf]# curl-i 117.40.239.9

http/1.1 OK

Date:mon, 12:17:26 GMT

Server:apache #会调用ServerTokens Productonly, the content of the display is the parameter selection

x-powered-by:php/5.4.36

Connection:close

content-type:text/html; Charset=utf-8

expose_php Off # the effect after the change

[Email protected] conf]# curl-i 117.40.239.9

http/1.1 OK

Date:mon, 12:19:06 GMT

Server:apache

Connection:close

content-type:text/html; Charset=utf-8

Disable the test page for CentOS under Apache

After installing Apache in CentOS and booting, the default CentOS will add a test page for Apache, install it and keep the default configuration for Apache, then enter your site's domain name or IP address in the browser, and the browser will open an interface

# CD/ETC/HTTPD/CONF.D

[email protected] conf.d]# Vim welcome.conf

<locationmatch "^/+$" >

Options-indexes

# errordocument 403/error/noindex.html #注释该行

</LocationMatch>

or: [email protected] error]# vi noindex.html #直接修改文件中的内容;

This article is from the "Linux~dba~mba" blog, make sure to keep this source http://sky9896.blog.51cto.com/2330653/1597489

Minimal exposure to server information

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.