Bai Xiao Sheng take you to play Linux system service Building series----build Virtual Apacheweb Host

Source: Internet
Author: User
Tags web hosting

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.