Today I studied how to bind multiple domain names to a single host in Apache and use port 80. To put it bluntly, multiple websites are run on one host, and the website domain names are all port 80.
The specific method is as follows:
1. Go to the Apache conf directory and find httpd. conf. For example, my directory is c: \ Program Files (x86) \ apache group \ apache2 \ conf.
2. Open httpd. conf in notepad or another text editor and find the line # namevirtualhost *: 80 (or search for namevirtualhost ).
3. Read the following comments, including the notes for namevirtualhost and virtualhost.
4. Add the following information to your httpd. conf file:
NameVirtualHost 219.133.61.226:80<VirtualHost 219.133.61.226:80> ServerAdmin web1@web1.com DocumentRoot /usr/local/apache2/htdocs1 ServerName www.web1.com ErrorLog logs/web1.com-error_log CustomLog logs/web1.com-access_log common</VirtualHost><VirtualHost 219.133.61.226:80> ServerAdmin web2@web2.com DocumentRoot /usr/local/apache2/htdocs2 ServerName www.web2.com ErrorLog logs/web2.com-error_log CustomLog logs/web2.com-access_log common</VirtualHost>
Here namevirtualhost is the IP address and port number of your host.
<VirtualHost 219.133.61.226:80>
</VirtualHost>
The above indicates a virtual host. Here, you need to note that servername is your domain name. In this way, you can configure multiple domain names and bind them to port 80. Please try it.