Solved

Dynamic subdomains to different vhosts

Posted on 2004-04-05
5
312 Views
Last Modified: 2010-03-04
With our current hanrdware setup, all the traffic goes through 1 IP address. We would like www.domain.com and domain.com to goto the standard directory (ie, /home/domain). All the dynamic subdomains (ie: foo.domain.com, bar.domain.com) should all point to /home/dynamicdomain/. How can I accomplish this?
0
Comment
Question by:dcman99
  • 2
5 Comments
 
LVL 2

Accepted Solution

by:
rrusch earned 250 total points
ID: 10761538
For Apache you just need a default virtualhost section. Normally the first in httpd.conf.
Additionally dns has to resolve *.domain.com to your ip.

--- Example httpd.conf ---
NameVirtualHost *
<VirtualHost *>
        DocumentRoot /home/dynamicdomain
</VirtualHost>

<VirtualHost *>
        ServerName www.domain.com
        ServerAlias domain.com
        DocumentRoot /home/domain
</VirtualHost>
0
 
LVL 10

Assisted Solution

by:Mercantilum
Mercantilum earned 250 total points
ID: 10857009
To my mind something is missing in the answer above,
Add
...
<VirtualHost *>
        ServerName foo.domain.com
        ServerAlias bar.domain.com xxx.domain.com
        DocumentRoot /home/dynamicdomain
</VirtualHost>

This way the 3 subdomains foo.domain.com, bar.domain.com and xxx.domain.com point to /home/dynamicdomain
0
 
LVL 10

Expert Comment

by:Mercantilum
ID: 10857014
And remove
<VirtualHost *>
        DocumentRoot /home/dynamicdomain
</VirtualHost>
0
 
LVL 15

Expert Comment

by:periwinkle
ID: 11760893
No comment has been added to this question in more than 21 days, so it is now classified as abandoned..
I will leave the following recommendation for this question in the Cleanup topic area:

    SPLIT: rrusch, Mercantilum

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

Periwinkle
EE Cleanup Volunteer
0

Featured Post

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now