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:
  #1  
Old January 7th, 2002, 07:53 PM
skeasor skeasor is offline
Masked Chicken
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Posts: 54 skeasor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 57 m 52 sec
Reputation Power: 8
Send a message via AIM to skeasor
Two domain names...

Hi,

I currently own 2 domain names. One, in which I have pointed to my server so I can host it. The other is just lying around doing nothing. I wanted to get the domain name back up and running. How do I add a second domain name to apache ?

Thanks,
Skeasor
__________________
____________
Thanks,
Skeasor

Got Debian Linux?
www.debian.org

Reply With Quote
  #2  
Old January 8th, 2002, 04:08 AM
vdschoor vdschoor is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 1999
Location: California
Posts: 43 vdschoor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
You need to disable the general server name set in the apache config file, and need to add a virtual host for EVERY domain you are hosting, so also for your servername for example.

<VirtualHost *>
ServerAdmin you@yourdomain.com
DocumentRoot /web/yourdomain.com/html
ServerName www.yourdomain.com
ErrorLog /web/yourdomain.com/logs/yourdomain.com-error_log
CustomLog /web/yourdomain.com/logs/yourdomain.com-access_log common
</VirtualHost>


Hope this helps!

Iwan van der Schoor

Reply With Quote
  #3  
Old January 8th, 2002, 09:14 AM
skeasor skeasor is offline
Masked Chicken
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Posts: 54 skeasor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 57 m 52 sec
Reputation Power: 8
Send a message via AIM to skeasor
DocumentRoot

If I setup a virtual host for all of my domains and use the DocumentRoot inside of the virtual host command, what should I do with the DocumentRoot thats not in the virtual host tag.

Thanks,
Skeasor

Reply With Quote
  #4  
Old January 8th, 2002, 09:22 AM
vdschoor vdschoor is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 1999
Location: California
Posts: 43 vdschoor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
Skeasor,

You can just leave that I think.
As far as I am aware, as soon as you start hosting more than 1 domain, it will always use one of the virtualhosts, so if you have your documentroots defined in there correctly you are ready to run.

Thanks,
Iwan

Reply With Quote
  #5  
Old January 9th, 2002, 03:43 PM
jonsagara's Avatar
jonsagara jonsagara is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2001
Location: USA
Posts: 286 jonsagara User rank is Private First Class (20 - 50 Reputation Level)jonsagara User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 7 m 23 sec
Reputation Power: 7
Will this same setup work for local machines? If I have a machine named "server", but I want to host two internal sites named "site1" and "site2", can I set up Apache to handle requests for "http://site1" and "http://site2"? Would I have to add DNS entries for "site1" and "site2"?
__________________
Jon Sagara

"Me fail English? That's unpossible!"

Reply With Quote
  #6  
Old January 9th, 2002, 03:56 PM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
>> Would I have to add DNS entries for "site1" and "site2"?

Just setup a Hosts file. For example,

/etc/hosts or C:\Windows\Hosts:

127.0.0.1 localhost site1.localdomain.com site2.localdomain.com

Reply With Quote
  #7  
Old January 9th, 2002, 03:59 PM
jonsagara's Avatar
jonsagara jonsagara is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2001
Location: USA
Posts: 286 jonsagara User rank is Private First Class (20 - 50 Reputation Level)jonsagara User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 7 m 23 sec
Reputation Power: 7
And then Apache's virtual hosting capabilities will point the request to the correct document root, right?

Reply With Quote
  #8  
Old January 9th, 2002, 04:29 PM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Apache reads /etc/resolv.conf and /etc/hosts. If you setup /etc/hosts correctly, Apache will recognize site1 and site2 and resolve to 127.0.0.1. This is the minimum DNS requirement in order for you to create <VirtualHost> and assign different ServerName and DocumentRoot based on the servername.

Reply With Quote
  #9  
Old January 9th, 2002, 04:31 PM
jonsagara's Avatar
jonsagara jonsagara is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2001
Location: USA
Posts: 286 jonsagara User rank is Private First Class (20 - 50 Reputation Level)jonsagara User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 7 m 23 sec
Reputation Power: 7
Cool, thanks for the info.

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationApache Development > Two domain names...


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


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





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