search

Home  >  Q&A  >  body text

How to block access to my website by entering the external IP address in the browser address bar?

How toBlockEnter the external IP in the browser address bar to access my website


Destiny.Destiny.1954 days ago2201

reply all(1)I'll reply

  • ringa_lee

    ringa_lee2019-08-31 10:30:41

    There are two ways to implement the WEB server built with apache, both of which are implemented by modifying the httpd.conf file. Here are examples.

    Method 1: At the end of the httpd.conf file, add the following code

              NameVirtualHost 127.0.0.0
         <VirtualHost 127.0.0.0>
         ServerName 127.0.0.0
         <Location />
            Order Allow,Deny
            Deny from all
         </Location>
         </VirtualHost>

      ----------------Separating line----- ------------------

              <VirtualHost 127.0.0.0>
         DocumentRoot "E:/WWW/myweb"
         ServerName www.php.cn
         </VirtualHost> 

    Explanation: The part above the dividing line is to reject any access request directly through the IP 127.0.0.0, �%9

    reply
    0
  • Cancelreply