1. Domain-based virtual host (same IP and port for different domains)
Provide the domain name of the virtual Web site to the DNS service so that when you access any of these virtual Web sites, you end up accessing the same IP address.
2. Port-based virtual host (same IP on different ports)
Typically used only for the same Web site, the names and IP addresses of their sites are often the same, but different TCP ports provide access to different Web content. When you access a Web server that is not a 80 port in a browser, you need to explicitly indicate the port number of the server.
Experimental environment: One RHEL6.5 a single window7
Operation Steps
Enter HTTPD's master profile
Modifying listening ports and domain names
Start the httpd service, turn off the firewall
Html
Write a statement in the HTTPD site directory and generate the index.html
Here you can see that the website has been provided.
Create a file that ends with conf in the CONF.D directory
and write these statements
We want to use the domain name to access here we need to build the domain name resolution, build named service and modify its various configuration files
When you are finished, start the service and use host to see if it resolves
Create two files and create a website in the OPT directory
We have seen the same IP and port for different domains.
Add these statements at the bottom of the file before entering
In order to implement different ports, we have to add a listening port to the master profile
Create another site in the OPT directory
same IP for different ports
Apache Multi-Port multiple host name configuration