The code is as follows: |
Copy code |
Namevirtualhost *: 80 <Virtualhost 59.60.30.212: 80 >=> this IP address must be specified. Serveradmin conkeyn@163.com Servername 59.60.30.212 <Location/> Order deny, allow Deny from all </Location> </Virtualhost> |
Method 2 add the following code at the end of the httpd. conf file
Namevirtualhost 221 .*.*.*
<Virtualhost 221. *>
Documentroot "c:/test"
Server name 221 .*.*.*
</Virtualhost>
<Virtualhost 221. *>
Documentroot "c:/web"
Servername
</Virtualhost>
Note: the blue part passes through 221. *. *. * direct access requests from this ip address point to the c:/test Directory. This can be an empty directory or a home page file, such as index, can be created. hmtl. The content of the first file can be a declaration.
Method 3: Create a VM,
The code is as follows: |
Copy code |
Servername ipaddress (for example, 192.168.0.1) Documentroot/usr/local/apache/nosite/ |
In this way, you can.
Create an index.htm under/usr/local/apache/nosite/and prompt the user that ip access is not allowed. Or other error messages.
Method 4:
The code is as follows: |
Copy code |
Servername ipaddress (for example, 192.168.0.1) Documentroot/usr/local/apache/nosite/ Order deny, allow Deny from all |