A virtual web host refers to running multiple Web sites on the same server, each of which does not actually occupy the entire server on its own, and is therefore referred to as a "virtual" web host. The web hosting service can make full use of the hardware resources of the server, which greatly reduces the cost of building and running the website.
Lab Environment: Website and DNS service provider: centos6.5
Client: Win7
Build different sites from the same IP address based on the same port
vim/etc/httpd/conf.d/host.conf//Edit the virtual host configuration file
Enter the following content
Namevirtualhost 192.168.10.10:80
<virtualhost 192.168.10.10:80>
ServerAdmin [email protected]
documentroot/opt/benet/
ServerName www.benet.com
Errorlog Logs/benet.com-error_log
Customlog Logs/benet.com-access_log Common
</VirtualHost>
<virtualhost 192.168.10.10:80>
ServerAdmin [email protected]
documentroot/opt/yun/
ServerName www.yun.com
Errorlog Logs/yun.com-error_log
Customlog Logs/yun.com-access_log Common
</VirtualHost>
echo "This was Benet" >/opt/benet/index.html//"This is Benet" for Bennet.com's home file
echo "This is Yun" >/opt/yun/index.html//"This is Yun" for Yun.com's home file
Building a DNS Resolution service
RPM-IVH/MNT/PACKAGES/BIND-9.8.2-0.17.RC1.EL6_4.6.X86_64.RPM//Installing the DNS environment package
vim/etc/named.conf//Edit DNS master configuration file
Vim/etc/named.rfc1912.zones//Edit Zone Profile
Zone "Benet.com" in {
Type master;
File "Benet.com.zone";
allow-update {none;};
};
Zone "Yun.com" in {
Type master;
File "Yun.com.zone";
allow-update {none;};
};
cd/var/named/
Cp-p Named.localhost Benet.com.zone
Vim Benet.com.zone
Cp-p Benet.com.zone Yun.com.zone
Vim Yun.com.zone
Clients visit each page: www.benet.com, www.yun.com
Bai Xiao Sheng take you to play Linux system service Building series----build Virtual Apacheweb Host