First of all, we say Apache add Multiport method, the concrete steps are as follows:
The apache\conf directory
Add Port Monitor
Vhost.conf simple to write and write
Here are the contents of Apache implementation of single IP multiport mappings
I use an Apache server. There are a few sites in my Apache root directory, such as test, child, and two sites. I want to do this, when I visit http://localhost, I access test, and I visit the child when I visit http://localhost:8080.
We need to configure Apache. The httpd.conf in the Conf under the Apache folder opens, searches for include conf/extra/httpd-vhosts.conf, and removes the previous comment. Then open the Conf/extra/httpd-vhosts.conf file and clear the contents, and write:
Namevirtualhost *:8080
<virtualhost *:8080>
ServerName
localhost serveralias localhosts DocumentRoot d:/development/www/child
</VirtualHost>
namevirtualhost *:80
<virtualhost * :80>
ServerName localhost
serveralias localhost
documentroot d:/development/www/test
</ Virtualhost>
Restarting the Apache server is OK.