In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
[TOC]
Article directory 1, virtual host overview 2, experiment preparation 3, based on domain name-building virtual host 3.1, DNS parsing 3.2, preparing web documents for virtual host 3.3, virtual host configuration 3.4, httpd service 3.5, result verification 4, based on port-building virtual host 4.1, experimental environment 4.2, experimental process 5, building virtual host based on IP- 5.1, Application example 5.2, Experimental Operation 1, Virtual Host Overview Virtual Web host runs multiple Web sites on the same server Each of these sites does not independently occupy a real computer httpd-supported virtual host type domain name-based virtual host IP address-based virtual host port-based virtual host 2. The experiment is going to build two virtual Web sites: website: www.test.com, www.demo.com confirm the installation of httpd, bind software turn off the firewall
! [1576742150233] (C:\ Users\ wang\ Desktop\ New folder (2)\ 1576742150233.png)
Third, based on domain name-build virtual host website: www.accp.com, IP: 192.168.111.132 website: www.kgc.com, IP: 192.168.111.1323.1, DNS parsing 1, main configuration file of DNS
! [1576742382621] (C:\ Users\ wang\ Desktop\ New folder (2)\ 1576742382621.png)
2. Modification of zone configuration file
! [1576742423809] (C:\ Users\ wang\ Desktop\ New folder (2)\ 1576742423809.png)
! [1576742590949] (C:\ Users\ wang\ Desktop\ New folder (2)\ 1576742590949.png)
3. Regional data file
! [1576742674523] (C:\ Users\ wang\ Desktop\ New folder (2)\ 1576742674523.png)
! [1576742721451] (C:\ Users\ wang\ Desktop\ New folder (2)\ 1576742721451.png)
* all parsed are www, so you can copy test.com.zone directly.
! [1576742789571] (C:\ Users\ wang\ Desktop\ New folder (2)\ 1576742789571.png)
Configuration of win10 system
! [1576742945641] (C:\ Users\ wang\ Desktop\ New folder (2)\ 1576742945641.png)
You can verify that the configuration of DNS is successful, use the nslookup command in the win10 system
3.2. Prepare web documents for virtual hosts
! [1576743127825] (C:\ Users\ wang\ Desktop\ New folder (2)\ 1576743127825.png)
1. Create a web page document and set the web page content for the two files respectively.
! [1576743216748] (C:\ Users\ wang\ Desktop\ New folder (2)\ 1576743216748.png)
3.3. Virtual host configuration 1. Add virtual host configuration
! [1576743445189] (C:\ Users\ wang\ Desktop\ New folder (2)\ 1576743445189.png)
! [1576743641599] (C:\ Users\ wang\ Desktop\ New folder (2)\ 1576743641599.png)
/ / DocumentRoot: the web page of the site is put inside / / ServerName: domain name / / Errorlog: the location of the error log file / / Customlog: access log / / Directory: you can write the site, and the permission path of the directory you want to control should be written. / / Require all granted: allow everyone to access 3.4.The httpd service 1, edit the httpd main configuration file
! [1576743898501] (C:\ Users\ wang\ Desktop\ New folder (2)\ 1576743898501.png)
! [1576743971000] (C:\ Users\ wang\ Desktop\ New folder (2)\ 1576743971000.png)
2. Enable httpd service
! [1576744015373] (C:\ Users\ wang\ Desktop\ New folder (2)\ 1576744015373.png)
3.5. result verification, final verification, in the browser of win10
! [1576751321594] (C:\ Users\ wang\ Desktop\ New folder (2)\ 1576751321594.png)
! [1576751380334] (C:\ Users\ wang\ Desktop\ New folder (2)\ 1576751380334.png)
4. Based on port-build virtual host 4.1and experimental environment to build 2 virtual Web sites with www.kgc.com,IP address, port 192.168.111.132:80www.kgc01.com, IP address and port 192.168.111.132pur80800.When accessing the two ports in the browser, different contents will be displayed, 4.2.The experiment process will be modified based on the previous experiment 1, create a new one under / var/www/html
! [1576751736260] (C:\ Users\ wang\ Desktop\ New folder (2)\ 1576751736260.png)
2. Modify the configuration file vhost.conf of the virtual host
! [1576752029622] (C:\ Users\ wang\ Desktop\ New folder (2)\ 1576752029622.png)
3. Change the listening address. The same ip address corresponds to different ports.
! [1576752077702] (C:\ Users\ wang\ Desktop\ New folder (2)\ 1576752077702.png)
! [1576752156484] (C:\ Users\ wang\ Desktop\ New folder (2)\ 1576752156484.png)
4. Restart the service
! [1576752298436] (C:\ Users\ wang\ Desktop\ New folder (2)\ 1576752298436.png)
5. Final verification
! [1576752421036] (C:\ Users\ wang\ Desktop\ New folder (2)\ 1576752421036.png)
! [1576752492520] (C:\ Users\ wang\ Desktop\ New folder (2)\ 1576752492520.png)
5. Build virtual host 5.1 based on IP-, build two virtual Web sites www.accp.com based on application example, IP address is 192.168.111.132 www.appc01.com.com IP address is 192.168.111.136 when accessing the two IP in the browser, respectively display different content 5.2, experiment operation 1, add a new network card, check the IP address
! [1576752773342] (C:\ Users\ wang\ Desktop\ New folder (2)\ 1576752773342.png)
2. Because there are two IP addresses, you need to modify the zone file and domain name resolution file in the DNS configuration.
! [1576753102540] (C:\ Users\ wang\ Desktop\ New folder (2)\ 1576753102540.png)
! [1576753167473] (C:\ Users\ wang\ Desktop\ New folder (2)\ 1576753167473.png)
! [1576753251252] (C:\ Users\ wang\ Desktop\ New folder (2)\ 1576753251252.png)
! [1576753278715] (C:\ Users\ wang\ Desktop\ New folder (2)\ 1576753278715.png)
Start the service
! [1576753330103] (C:\ Users\ wang\ Desktop\ New folder (2)\ 1576753330103.png)
3. Prepare web documents for the virtual host
! [1576753445083] (C:\ Users\ wang\ Desktop\ New folder (2)\ 1576753445083.png)
4. Modify the configuration of the virtual host. My two network card IP addresses correspond to a site 192.168.111.132 www.accp.com192.168.111.136 www.accp01.com.
! [1576753588701] (C:\ Users\ wang\ Desktop\ New folder (2)\ 1576753588701.png)
! [1576753953217] (C:\ Users\ wang\ Desktop\ New folder (2)\ 1576753953217.png)
Modify the main configuration file of a web page
! [1576754000301] (C:\ Users\ wang\ Desktop\ New folder (2)\ 1576754000301.png)
! [1576754053817] (C:\ Users\ wang\ Desktop\ New folder (2)\ 1576754053817.png)
Turn on the service and check the status of port 80
! [1576754127539] (C:\ Users\ wang\ Desktop\ New folder (2)\ 1576754127539.png)
Finally, verify in the win10 browser
! [1576754225423] (C:\ Users\ wang\ Desktop\ New folder (2)\ 1576754225423.png)
! [1576754255930] (C:\ Users\ wang\ Desktop\ New folder (2)\ 1576754255930.png)
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.