Configuring Apache virtual host instance for Linux system

Time:2022-5-4

installapache,php:
yum install httpd php

Suppose the IP address of the VPS is 58.130.17.168, and there are two domain names pointing to the IP address, domain1.1 com, domain2. com,

Modify / etc / httpd / conf / httpd Conf, add at the end of the file:

ServerName 58.130.17.168
NameVirtualHost 58.130.17.168

<VirtualHost 58.130.17.168>
        ServerName domain1.com
        DocumentRoot /var/www/domain1.com
        <Directory “/var/www/domain1.com”>
            Options Indexes FollowSymLinks
            AllowOverride None
            Order allow,deny
            Allow from all
        </Directory>
</VirtualHost>

<VirtualHost 58.130.17.168>
        ServerName domain2.com
        DocumentRoot /var/www/domain2.com
        <Directory “/var/www/domain2.com”>
            Options Indexes FollowSymLinks
            AllowOverride None
            Order allow,deny
            Allow from all
        </Directory>
</VirtualHost>

Then at / var / www / domain1 COM and / var / www / domain2 Create different indexes under. Com HTML file:
echo “domain1”>/var/www/domain1.com/index.html
echo “domain2”>/var/www/domain2.com/index.html

Enter in the browser http://domain1.com and http://domain2.com You can see the effect
 

Recommended Today

SQL server cannot generate fruncm thread

SQL Server was unable to generate the fruncm thread. The database error log is as follows: Copy codeThe code is as follows: 2013-09-26 21:21:50.31 Server      Microsoft SQL Server 2005 – 9.00.1399.06 (Intel X86)Oct 14 2005 00:33:37 Copyright (c) 1988-2005 Microsoft CorporationEnterprise Edition on Windows NT 5.2 (Build 3790: Service Pack 2) 2013-09-26 21:21:50.31 Server      (c) […]