How to configure multi-port and multi-hostname in Apache
This article shows you how to configure multi-port multi-host names in Apache, concise and easy to understand, definitely can make your eyes shine, through the detailed introduction of this article I hope you can gain something.
1. Domain name based virtual hosting (same IP and port for different domain names)
Provide the DNS service with the domain names of the virtual Web sites so that when you visit any of them, you end up accessing the same IP address.
2. Port-based virtual hosts (same IP for different ports)
Usually only used for the same Web site, its website name, IP address is often the same, but through different TCP ports to provide access to different web content service portal. When accessing non-port 80 Web servers in a browser, you need to explicitly indicate the port number of the server.
Experimental environment: one RHEL6.5 and one window7
operation steps
Go to httpd's main profile
Modify listening ports and domain names
Start httpd service, turn off firewall
html
Write a statement under httpd's site directory and generate index.html
Here you can see that the website has been provided
Create a file in the conf.d directory that ends with conf
and write these statements.
We want to use domain name to access here. We need to set up domain name resolution, set up named service and modify its various configuration files.
After completion, start the service and use host to see if it has been resolved
Create two files in the opt directory and create a website
Here we've seen that different domain names, the same IP and port, have been implemented.
Add these statements at the bottom of the file before entering
To implement different ports, we need to go into the main configuration file and add listening ports.
Create another website under opt
That's how to configure multiport multihost names in Apache. Have you learned anything or skills? If you want to learn more skills or enrich your knowledge reserves, please pay attention to the industry information channel.