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

Build a virtual host-- based on domain name

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

Share

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

Virtual Web host

1. Run multiple Web sites on the same physical server, each of which is not independent

Take up a real computer

2. Types of virtual hosts supported by httpd

● domain name-based virtual host (commonly used, for enterprise use)

● virtual host based on IP address (at least 2 IP on one host, impractical)

● port-based virtual host

Three types: different IP, different port, different domain name

Experimental configuration

Open a Linux and a win7 host

1. Set the dns master configuration file

2. Set the dns zone configuration file

3. Set the dns zone data configuration file

(1) configure data content for kgc.com.zone

(2) configure data content for kgc02.com.zone

4. Add virtual host configuration under the configuration file of httpd

5. Prepare the web page documents for the virtual host

[root@www ~] # mkdir-p / var/www/html/kgc [root@www ~] # mkdir-p / var/www/html/kgc02 [root@www ~] # echo "this kgc web" > / var/www/html/kgc/index.html [root@www ~] # echo "this is kgc02 web" > / var/www/html/kgc02/index.html

6. Boot and load the virtual host configuration file in the httpd main configuration file

7. Turn off the firewall and security function. Start the httpd and named services. Win 7 visits two domain names and displays two different web pages.

Thank you for watching!

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