How to hide Nginx, Apache, and PHP versions. nginxapache_PHP tutorial-php Tutorial

Source: Internet
Author: User
How to hide Nginx, Apache, and PHP versions: nginxapache. This method hides the version numbers of Nginx, Apache, and PHP. when a hacker intrude into a server, nginxapache will first "Step On". Here "Step On ", it refers to the method for hiding Nginx, Apache, and PHP versions running on the server. nginxapache

When hackers intrude into a server, they will first "Step On". Here "Step On" refers to understanding the details of some services running on the server, such as the version number, when hackers know the version number of the service, they can find some vulnerabilities in the service version to intrude into and attack the service. Therefore, we need to hide these versions to avoid unnecessary problems.

Let's test it.

insoz:~ insoz$ curl -I http://127.0.0.1/phpinfo.phpHTTP/1.1 200 OKServer: nginx/1.5.0Date: Thu, 18 Jun 2015 02:39:32 GMTContent-Type: text/htmlConnection: keep-aliveVary: Accept-EncodingX-Powered-By: PHP/5.3.1

We can see that the nginx and php versions of our servers are exposed. let's look at the hidden methods.

First, let's look at how to hide the version number in nginx:
Add the following code to the nginx. conf configuration file:

server_tokens off;

How to hide the version number in apache:
Add the following code to the apache configuration file httpd. conf:

ServerTokens ProdServerSignature Off

Let's take a look at how to hide the version number in php:
Add the following code to the php configuration file php. ini:

expose_php = Off

Okay. after modification, restart the service. let's test it again:

insoz:~ insoz$ curl -I http://127.0.0.1//phpinfo.phpHTTP/1.1 200 OKServer: nginxDate: Thu, 18 Jun 2015 02:41:47 GMTContent-Type: text/htmlConnection: keep-aliveVary: Accept-Encoding

Articles you may be interested in:
  • Nginx, Apache, and Lighttpd disable directory execution php configuration example
  • View nginx apache mysql php compilation parameters in Linux
  • How to hide http header version information in nginx/apache/php
  • Methods for disabling Web pages from being referenced by iframe in PHP, Nginx, and Apache

When hackers intrude into a server, they will first "Step On". Here "Step On" refers to understanding how the server runs...

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.