Virtual Web Host

Source: Internet
Author: User


Configuration conditions


1:linux system

2:HTTPD Service, DNS service



Need to learn more about access control for HTTPD services

Primarily to control access to site resources, add access authorizations for specific site directories

Commonly used for client address restrictions, user authorization restrictions


Order configuration items, defining control order


1: First allow after deny, default deny all: Orderallow,deny

2: First deny after allow, default allows all: Order Deny,allow



Configure DNS Service Add resolution


Vim/var/named/chroot/var/named/benet.com.zone (manually created)


@ in NS dnssvr.jianyu.com.

Dnssvr in A 192.168.1.1

www in A 192.168.1.1


Vim/var/named/chroot/var/named/accp.com.zone

@ in NS dnssvr.accp.com.

www in A 192.168.1.1



Create a default Web page for two virtual hosts (you need to create one manually)


Mkdir-p/var/www/html/jianyucom

mkdir-p/var/www/html/ accpcom



Modify the virtual host configuration vim/usr/local/httpd/conf/extra/httpd-vhosts.conf


<directory '/var/www/html ' (advertise its web directory)

Order Allow,deny Access sequence

Allows all

</Directory>

Namevirtualhost 192.168.1.1:80

<virtualhost 192.168.1.1>

Documentroot/var/www/html/jianyuCOM (Default Web page directory)

ServerName www.jianyu.com (domain name)


Namevirtualhost 192.168.1.1:80

<virtualhost 192.168.1.1>

DOCUMENTROOT/VAR/WWW/HTML/ACCPCOM (Default Web page directory)

ServerName www.accp.com (domain name)



Editing a configuration file vim/usr/local/httpd/conf/httpd.conf

Remove the # before the http-vhosts.conf option configuration to apply

Include conf/extra/httpd-vhosts.conf (Load standalone configuration)


Restart Service /usr/local/httpd/bin/apachectl/start




2017.7.11

Jianyu

This article is from the "Jianyu" blog, make sure to keep this source http://jianyu97.blog.51cto.com/12222102/1946465

Virtual Web 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.