How to bind multiple domain names to IP by Appach server
This article introduces the knowledge of "how the Appach server binds IP to multiple domain names". In the actual case operation, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
1. Develop your own website and put it under disk D.
For example: D:/new.html
two。 Open the httpd.conf file of the appcah server
For example, my file is saved in: d:\ EmpireServer\ php\ apache2.2\ conf
(1) find DocumentRoot
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
# Log off DocumentRoot
# DocumentRoot "D:/EmpireServer/web"
#
# Each directory to which Apache has access can be configured with respect
(2) find the virtual machine configuration
# Real-time info on requests and configuration
# Include conf/extra/httpd-info.conf
# Virtual hosts enable virtual host configuration
Include conf/extra/httpd-vhosts.conf
3. Open the httpd-vhosts.conf file (located in conf/extra/httpd-vhosts.conf)
# your project location
DocumentRoot "Dvu /"
# the domain name you want to take (note that it will be the same as the name in the hosts file below)
ServerName www.myself.com
# the first file you need to open when entering the domain name in your browser
DirectoryIndex new.html
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
4. Configure hosts file (file location: C:\ Windows\ System32\ drivers\ etc\)
Add: 127.0.0.1 www.myself.com at the end of the file
5. Enter: http://www.myself.com in the browser to access the new.html file under the D disk.
This is the end of the content of "how to bind IP to multiple domain names by Appach server". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!