Workshop_HTTPD_BIND_Virtual host 06/24/2010

 

1. install apache server, name server bind and caching-nameserver for reference of name server configuration, also install httpd-manual to make sure the related reference can be found when not sure about the configuration of HTTPD

2.configure HTTPD first, change last several lines into

vim /etc/httpd/conf/httpd.conf 
    DocumentRoot /var/www/web1
    ServerName  web1.ls.com
    DocumentRoot /var/www/web2
    ServerName  web2.ls.com
        
                Options Indexes Includes
                AllowOverride AuthConfig
        
 

they are two hosts, and the web2 will use password authentication. now configure the web pages and make them into the right folder. and configure the authentications: goes to /etc/httpd/conf/ htpasswd -cm .htpasswd rocky then type in password

now vim /etc/www/web2/.htaccess
AuthName        "Rocky test web2"
AuthType        Basic
AuthUserFile    /etc/httpd/conf/.htpasswd
Require         valid-user

start the httpd server. Before install the named server, configure /etc/hosts and add web1.ls.com and web2.ls.com into hostnames to test httpd work properly.

Now configure named server
cp /etc/named.caching-nameserver.conf  /etc/named.conf
change named.conf  to allow  anyone to use it
 listen-on port 53 { 127.0.0.1;any; };
        allow-query     { localhost;any; };
and diable views, then create a new zone
zone ls.com{
type master;
file  "ls.com.zone";
};
now edit the zone files
cp /var/named/localhost.zone /var/named/ls.com.zone
vim /var/named/ls.com.zone
                IN NS           @
web1            IN A            192.168.0.5
web2            IN A            192.168.0.5
                     IN A            127.0.0.1
                     IN AAAA         ::1
 
change the /etc/hosts and delete web1/web2 from host name.
now start named and ping web1.ls.com to see if it is working
 
goes to client and vim /etc/resolv.conf
add
nameserver 192.168.0.5
 

now open web2.ls.com to see if its working

 

 

About Lei

I am an IT specialist with over 10 year experience - years on Automation, on-Premise or Azure.

I am happy to develop however never want be a full time developer. Only do what I have to do. If it has to be PowerShell,HTML, PHP, CSS, C#, VBS or JS, front end or backend, so be it, doesn't matter!

Spent years with Windows, SCCM, SharePoint, SQL and Exchange servers. For last several years, I have been actively working under On Premise > Azure environment.

THERE IS NO WAY BACK!!!

Current Certificates:
    Microsoft® Certified-
  • -Enterprise Administrator
  • -Database Administrator
  • -SharePoint Administrator
  • -Administering and Deploying SCCM 2012
Red Hat Certified Technician
ITIL V3 Foundation - Practitioner

Working on Azure Certificates now and hopefully they can stop upgrading their questions one day! GIVE ME A BREAK!

Contact Lei

Name *
Email *
Comments *

Traffic since 10/08/2016

Today45
Yesterday83
This week669
This month1965
Total416325

Visitor Info

  • IP: 54.163.210.170
  • Browser: Unknown
  • Browser Version:
  • Operating System: Unknown

Who Is Online

2
Online

2017-12-17

Login