Solved

Dynamic subdomains to different vhosts

Posted on 2004-04-05
5
316 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

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

As Wikipedia explains 'robots.txt' as -- the robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a websit…
It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

705 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