Home > Topics > Pagoda Panel > body text

IP access is prohibited in Pagoda Apache environment

藏色散人
Release: 2019-10-26 13:55:04
forward
4115 people have browsed it

IP access is prohibited in Pagoda Apache environment

The following tutorial column of Pagoda Panel will introduce to you the tutorial on prohibiting ip access (anti-malicious analysis) in the Pagoda Apache environment. I hope it will help you if you need it. My friends are helpful!

Tutorial on prohibiting IP access (anti-malicious analysis) in the Apache environment

You need to modify the Apache configuration file httpd.conf to achieve this. The specific code is as follows:

NameVirtualHost 121.*.*.*
 
<VirtualHost 121.*.*.*>
ServerName 121.*.*.*
<Location />
Order Allow,Deny
Deny from all
</Location>
</VirtualHost>
 
<VirtualHost 121.*.*.*>
DocumentRoot /var/www/nowamagic/
ServerName www.nowamagic.net
</VirtualHost>
 
<VirtualHost 121.*.*.*>
DocumentRoot /var/www/nowamagic/
ServerName nowamagic.net
</VirtualHost>
Copy after login

The first part of the code is The implementation rejects any access request directly through the IP 121.*.*.*. At this time, if you use 121.*.*.* to access, you will be prompted to deny access.

The second part of the code is to allow access through the domain name http://www.nowamagic.net/, and the home directory points to /var/www/nowamagic/ (the server OS here is CentOS)

The third part of the code allows domain name access without www. It should be written together with the above merge.

The above is the detailed content of IP access is prohibited in Pagoda Apache environment. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:boke112.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!