Apache % C5 % E4 % D6 % C3/"target =" _ blank "> apache configuration method:
The configuration methods for both Linux and Windows are basically the same. Find the httpd. conf configuration file in the directory where you install apache,
Find the following section:
The code is as follows: |
Copy code |
<IfModule dir_module> DirectoryIndex index. php index.html index.htm </IfModule> |
Enter the default homepage index. php name you want to set after DirectoryIndex, as shown below:
The code is as follows: |
Copy code |
<IfModule dir_module> DirectoryIndex index. php </IfModule> |
This configuration will explain index. php.
Note: after modifying the httpd. conf file, restart apache.
A method to prohibit direct access to the website by IP addresses
Method 1: 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 2:
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 |