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 realize multiple virtual hosts by using server

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

Share

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

Today, I will talk to you about how to use the server to achieve multiple virtual hosts, which may not be well understood by many people. in order to make you understand better, the editor has summarized the following contents for you. I hope you can get something according to this article.

The server implements multiple virtual hosts, there are three main methods: using the same IP address, different ports; using different IP addresses; using the same IP and the same TCP port, different host heads.

1. Use the same IP address and different ports

Only one IP is needed to build the space through different ports.

Server {listen 80location location / {root html/abc;index index.html index.htm index.php;}} server {listen 8080 location / {root html/cbd;index index.html index.htm;}}

2. Use different IP addresses

Use the same port, different IP to implement. Each space is allocated an IP to make a distinction.

Server {listen 192.168.10.42 root html/abc;index index.html index.htm index.php; 80 location / {root html/cbd;index index.html index.htm;}} server {listen 192.168.10.52

3. Use the same IP and the same TCP port, but different host headers

After reading the above, do you have any further understanding of how to use the server to implement multiple virtual hosts? after reading the above, do you have any further understanding of how to use the server to implement multiple virtual hosts? after reading the above, do you have any further understanding of server {listen 80 serversionname www.abc.com;location / {root html/web1;index index.html index.htm;}} server {serveraccounname www.cbd.com;location / {root html/web2;index index.html index.htm;}} If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.

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