Apache Multi-Port multiple host name configuration

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.