Steps for apache to set its own IP address:
1. Find the httpd.conf file in the conf folder in the apache installation directory. , open with Notepad or other text editing software.
#2. Search for the line "Include conf/extra/httpd-vhosts.conf" in the file, remove the "#" in front of it, and enable the virtual host function.
3. Find the httpd-vhosts.conf file in the conf/extra folder in the apache installation directory, and open it with Notepad or other text editing software.
4. At the end of the file, add the following code and save it:
<VirtualHost *:80> ServerName www.domain.com DocumentRoot D:/www/domain <Directory "D:/www/domain"> Options +Indexes +Includes +FollowSymLinks +MultiViews AllowOverride None Order allow,deny Allow from all </Directory> </VirtualHost>
Among them, 80 is the port of the server, and what follows ServerName is the domain name. What follows DocumentRoot and Directory is the directory where the website program is located.
5. Find the hosts file of the server. Taking the Windows system as an example, edit it with Notepad or other text in the C:\windows\system32\drivers\etc directory. The software opens.
#6. Add a line 126.63.36.3 www.domain.com at the end of the hosts file and save it. After restarting the service, you can access it through the domain name.
For more technical articles related to Apache, please visit the Apache Tutorial column to learn!
The above is the detailed content of How to set own ip address for apache. For more information, please follow other related articles on the PHP Chinese website!