Apache Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationApache Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
VeriSign Code Signing Digital Certificates provides assurance to end users. Read about this and more in the free white paper: “How to Digitally Sign Downloadable Code for Secure Content Transfer.” Learn More!
  #1  
Old October 25th, 2000, 02:43 PM
kbajwa kbajwa is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Location: Mountain City, TN
Posts: 34 kbajwa User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
I am having problem with setting up a Virtual Host on a machine. I have read quite a few books and other articles and now I am completely confused. He is my story:

I setup a Linux machine, I will call it “my.domain.net”. I successfully:

1. Added to new Zone ( & reverse zone) statement in /etc/named.conf file
2. Added a new zone database file for “domain.net”

Now I want to add a vhost www.abc.com. Do I need:

a. Add an entry in zone file for www.abc.com
b. Add a new database file for www.abc.com
c. Update http.conf to add <VirtualHost> directive

In one book, the above procedure is mentioned. In other articles, it says to add CNAME statement in the zone database file and update the http.conf file.

What is the actual procedure? Other than updating http.conf what other files needs to be updated/added. Please help! I HAVE READ SO MUCH STUFF THAT I AM READY TO BLOW UP!

Kirt



Reply With Quote
  #2  
Old November 1st, 2000, 12:22 AM
Frank Frank is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Posts: 6 Frank User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
It is really quite simple. Make sure each domain has a DNS entry. Then add a Virtual host block to your httpd.conf file.

For example,
<VirtualHost [ip]>
ServerName [virtualhostname]
DocumentRoot [directory]
</VirtualHost>

For example, one web site on my server is:
# dnsconnection.net
<VirtualHost 206.30.168.163>
ServerName www.dnsconnection.net DocumentRoot /home/dnsconnect/public_html/
ErrorLog "/home/dnsconnect/logs/error_log"
TransferLog "/home/dnsconnect/logs/transfer_log"
</VirtualHost>

Notes:
You need to tell Apache that a certain IP may have different host names. If you do not tell it, it will find the first match and use it. If 206.30.168.163 was your virtual host IP, you would add the following to your httpd.conf file:

NameVirtualHost 206.30.168.163

In order to make both www.domain.com and domain.com to work, you need to duplicate the Virtual Host block, but change the ServerName.

Reply With Quote
  #3  
Old November 1st, 2000, 06:45 AM
kbajwa kbajwa is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Location: Mountain City, TN
Posts: 34 kbajwa User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Frank:

Thanks for your answer. You left one items unexplained. What do yoy mean by "DNS entry"? Is it a "NS", CNAME, or what? I have no problem with updating the httpd.conf, my question is more towards what additional items are needed!

Your answer is highly appreciated. Can you give an example of DNS entry?

Kirt

Reply With Quote
  #4  
Old November 1st, 2000, 02:04 PM
Frank Frank is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Posts: 6 Frank User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Every domain needs a zone file and a zone statement in the named.conf file.

On my system, zone files are stored in /var/named. One example of a zone file on my system is /var/named/dnsconnection.net which contains:

<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
@ IN SOA ns.dnsconnection.net. hostmaster.dnsconnection.net
20001018002 ; serial
300 ; refresh
250 ; retry
325 ; expire
325 ; default_ttl
)

IN MX 5 dnsconnection.net.
@ IN NS ns.dnsconnection.net.
@ IN NS ns2.dnsconnection.net.
@ IN A 206.30.168.163

www IN CNAME dnsconnection.net
ftp IN CNAME 206.30.168.163
control IN CNAME 206.30.168.169
[/code]

In my /etc/named.conf file, I put:

<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
zone "dnsconnection.net"{
type master;
file "/var/named/dnsconnection.net";
};
zone "www.dnsconnection.net"{
type master;
file "/var/named/dnsconnection.net";
};
[/code]

That points each domain (or sub domain) to its zone file. I can even point sub domains to different IP addresses by creating different zone files.

O'Reilly has a good book called "DNS and Bind." http://www.amazon.com/exec/obidos/ASIN/1565925122/o/qid=973108167 /sr=8-1/ref=aps_sr_b_1_1/002-7672600-0937647

Best regards,
Frank


[This message has been edited by Frank (edited November 01, 2000).]

Reply With Quote
  #5  
Old November 1st, 2000, 03:04 PM
kbajwa kbajwa is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Location: Mountain City, TN
Posts: 34 kbajwa User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Frank:

My question still is not answered but I think we are close. If I take your last response and add another Virtual Host, are you saying that I should add another entry in zone file? If the answer is yes, then how that entry will look like. For Example, if I want to add a Virtual Site called www.abc.com, how I add an etry in the zone file? Is it a CNAME entry? Is the follwoing entry is correct:
ode:
--------------------------------------------------------------------------------

@ IN SOA ns.dnsconnection.net. hostmaster.dnsconnection.net 20001018002 ; serial 300 ; refresh 250 ; retry 325 ; expire 325 ; default_ttl ) IN MX 5 dnsconnection.net.@ IN NS ns.dnsconnection.net.@ IN NS ns2.dnsconnection.net.@ IN A 206.30.168.163www IN CNAME dnsconnection.netftp IN CNAME 206.30.168.163control IN CNAME 206.30.168.169 www.abc.com IN CNAME 206.30.168.169

--------------------------------------------------------------------------------

Then I update the /etc/named.conf by adding the www.abc.com as follows:

code:
--------------------------------------------------------------------------------

zone "dnsconnection.net"{ type master; file "/var/named/dnsconnection.net";};zone "www.dnsconnection.net"{ type master; file "/var/named/dnsconnection.net";};

zone "www.abc.com" {
type master;
file "/var/named/abc.com";
};


I think the confusion is about adding more than Virtual Site. REMEMBER I AM A NOVICE.

Kirt

--------------------------------------------------------------------------------


Reply With Quote
  #6  
Old November 1st, 2000, 03:29 PM
kbajwa kbajwa is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Location: Mountain City, TN
Posts: 34 kbajwa User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Frank:

My last msg might be confusing, so I will try to clerify it.

If I need to add a Virtual Web site, do I need to do the following:

1. Update httpd.conf - add <VirtualHost...
2. Update named.conf - add a zone statement
3. Create a new zone record

Is it correct?

Kirti

Reply With Quote
  #7  
Old November 1st, 2000, 10:12 PM
Frank Frank is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Posts: 6 Frank User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
You are correct. And once you have edited all those files, restart BIND and Apache.

On my system, BIND is restarted with:

ndc restart

And Apache with:

apachectl restart

However, in the default Red Hat installation, it was restarted with:

/etc/rc.d/init.d/httpd restart

I hope this helps.

Frank

Reply With Quote
  #8  
Old November 21st, 2000, 12:40 PM
kbajwa kbajwa is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Location: Mountain City, TN
Posts: 34 kbajwa User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Frank:

I am finally getting to testing this. I installed Apache_1.3.12 and noticed that the default httpd.conf is now in /usr/local/apache/???. Does it cause to problem??

Kirt

Reply With Quote
  #9  
Old November 22nd, 2000, 03:45 PM
webpro webpro is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2000
Posts: 2 webpro User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
There are 2 different issues going on here... DNS/Bind and Apache. Deal with the DNS issue first. Get the name to resolve to the ip address. Apache has nothing to do with this part. But typing http://www.abc.net/ into a browser won't work if the ip doesn't resolve properly. The zone file doesn't look right. You wouldn't have a CNAME record for www.abc.net under a SOA for dnswhatever.com. It would be in a abc.net zone file. That's the first issue I see. Get the 'nslookup www.abc.net' returning the right IP address then setup the virtualhost entry in httpd.conf, it appears you have the docs explaining how to do this.

------------------
Robert Porter
MCSE, MCP+I, CCNA

Reply With Quote
  #10  
Old November 22nd, 2000, 04:05 PM
kbajwa kbajwa is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Location: Mountain City, TN
Posts: 34 kbajwa User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Robert:

I agree with you. I should first handle DNS. I have read so many articles and books with conflicting information. I want to stick to CNAME entry in DNS. So help me out.

If my nameserver (NS) is ns1.mydomain.net and the Virtual Domain is www.abc.com, then the correct format for the CNAME entry is:
www.abc.com IN CNAME ns1.mydomain.net

Is it correct???

Kirt

Reply With Quote
  #11  
Old November 28th, 2000, 11:06 PM
ccbcreg ccbcreg is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2000
Posts: 7 ccbcreg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
PTR......
don't forget about that
man i always forget to do that...

i use ndc reload.... to restart BIND...
never seen restart.

ccbcreg


<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by webpro:
There are 2 different issues going on here... DNS/Bind and Apache. Deal with the DNS issue first. Get the name to resolve to the ip address. Apache has nothing to do with this part. But typing http://www.abc.net/ into a browser won't work if the ip doesn't resolve properly. The zone file doesn't look right. You wouldn't have a CNAME record for www.abc.net under a SOA for dnswhatever.com. It would be in a abc.net zone file. That's the first issue I see. Get the 'nslookup www.abc.net' returning the right IP address then setup the virtualhost entry in httpd.conf, it appears you have the docs explaining how to do this.

[/quote]



[This message has been edited by ccbcreg (edited November 28, 2000).]

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationApache Development > Virtual Hosts.. Everybody says it's EASY.. ??


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway