Hide the Apache version number:
1>curl --head 127.0.0.1
2> Vim /etc/httpd/conf/httpd.conf
. 3> to the OS ServerTokens ServerTokens productonly
4>systemctl restart httpd
5>curl --head 127.0.0.1
Hide PHP Version:
1>curl --head 127.0.0.1
2> Vim /etc/php.ini
. 3> = ON to the expose_php expose_php = off
4>systemctl restart httpd
5>curl --head 127.0.0.1
Hide Nginx version number:
1. Open the Main Nginx configuration file: nginx.conf, cancel or add comments configuration statement.
1> curl --head 127.0.0.1
2> Vim /etc/nginx/nginx.conf
. 3> {# ... HTTP some configurations will be omitted
server_tokens off; # is commented out
# some configurations will be omitted ...}
. 4> systemctl the restart Nginx
. 5> curl --head 127.0.0.1
2, edit php-fpm profile, such as fastcgi.conf or fcgi.conf (this configuration
file name can also be custom tailored to the specific file name):
find / -name fastcgi.conf -o -name fcgi.conf
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
改为:
fastcgi_param SERVER_SOFTWARE nginx;
3, nginx reload configuration
Servic nginx reload
reload reload configuration can continue business, it can also be considered directly restart.
systemctl restart nginx
This completely hides the Foreign nginx version number, and so is the emergence of 404,501 pages will not
display nginx version