Get the App
SLTechnology News&Howtos  ›  Servers  › 

Building a virtual host with linux

Shulou Source: shulou.com Published: 2022-06-02 17:51:06 10月04日 Update

Concept

Virtual web host

Multiple web sites are running on the same physical server, each of which does not occupy a real computer independently.

Three types of virtual hosts supported by httpd

Virtual host based on domain name

Virtual host based on IP address

Port-based virtual host

Construction of virtual host based on domain name

Install dns and http services

Change dns profile

Add the dns server address 192.168.149.129 on the test machine

Enable the service, turn off the firewall, and test whether the resolution is successful.

Add a subprofile directory extra to the configuration file of the httpd service, and add the virtual host configuration file within the directory

Create a site

Declare the main profile to the subprofile

Start the service to access the virtual web

* * Virtual hosts based on different ports

Change the configuration file of the virtual host

Create a website

Change listening port in configuration file

Start the service, test

Virtual host based on different IP

Add a network card to get the address automatically

Change the virtual host profile

Create a directory site

Change the listening address

Restart the service, testing

Tags: Host virtual host file configuration service address test directory site port different domain name server snooping success size multiple Akiko concept physics Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple Xiaomi Microsoft vpn Linux