Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to configure multi-port and multi-hostname in Apache

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

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.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report