HTTP Configuration Instance

Source: Internet
Author: User

Second, the project operation:
Implemented using httpd-2.2 and httpd-2.4, respectively
1. Establish httpd service, request:
1) provide two name-based virtual host WWW1, WWW2; requires a separate error log and access log for each virtual host;
2) Provide status information through WWW1 's/server-status, and only allow 172.16.0.1 host access;
3) WWW2 does not allow access to any host in the 192.168.1.0/24 network;
1.WWW1 Configuration of virtual machines

<VirtualHost 172.16.11.11:80>        Servername  www.qmx.com        documentroot  "/mnt/web/www1/"          ErrorLog  "LOGS/ERROR_WWW1"          Loglevel warn        CustomLog  "LOGS/ACCESS_WWW1"  combined        <Directory  "/mnt/web/www1/" >                 options none                 allowoverride  none                 order deny,allow                 allow from all        </directory>         <Location /server-status>                 SetHandler server-status                 Order deny,allow                 Deny from all                 Allow from 172.16.0.1         </Location></VirtualHost>

Create a log file for WWW1

Touch Error_www1touch access_www1chmod 660 error_www1 chmod 660 access_www1 chgrp Apache error_www1 chgrp Apache ACCESS_WW W1

Create a Web site path

Mkdir-pv/mnt/web/www1

Configure the local Hosts file to complete the host header-based virtual host

Access to the WWW1 virtual host and its configured server status data query

Configuring WWW2 in the same vein

<VirtualHost 172.16.88.99:80>        Servername  www.qqzx.com        documentroot  "/mnt/web/www2/"          ErrorLog  "LOGS/ERROR_WWW2"          Loglevel warn        CustomLog  "LOGS/ACCESS_WWW2"  combined        <Directory  "/mnt/web/www2/" >                 options none                 allowoverride  none                 order deny,allow                 deny from 192.168.1.0/24        </directory></virtualhost> 

Verifying access control

2. Provide HTTPS services for the 2nd virtual host above;

Due to personal ability reasons, not yet completed, please look forward to



HTTP Configuration Instance

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.