Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Probably not the best title, but I am not sure how to describe in a few words.

Alright; I wish to have an "overall" domain to view my websites in browser. Like I would like to have, eg. testdomain.com to work as my "overall" domain, so I could access the sites I'm hosting like "mysite.com" - on "mysite.com.testdomain.com" (or somewhat near).

I need to locate the corresponding website, based on that subdomain, and serve it to the browser. Much like i can FTP into "testdomain.com" with the user "mysite.com" to access the FTP account.

Is this possbible and how can it be done? I hope I meane this clear.

Thank you!

share|improve this question
add comment

2 Answers 2

up vote 1 down vote accepted

It's a matter of configuring DNS correctly, combined with configuring virtual hosts on your web server. If you have the ability to manage your site's DNS entries and your web server configuration, this is easy enough to do.

share|improve this answer
    
I have, just have failed to do so. I will have to try again... –  meep Dec 2 '09 at 17:21
add comment

You might be interested in the VirtualDocumentRoot directive if you're using apache: http://httpd.apache.org/docs/2.0/vhosts/mass.html. It would allow you to use one configuration for many sites, e.g.:

<VirtualHost *>
    ServerName testsite.com
    VirtualDocumentRoot /www/%0/docs
</VirtualHost>

Now if you enter mysite.com.testsite.com in the browser it would try to load the files from /www/mysite.com.testsite.com/docs etc.

Configuring DNS for that is much easier. You just have to create a DNS record for *.testsite.com to point to your server`s IP address.

share|improve this answer
    
That's cool! I always like to explicitly name everything (I don't like surprises), so this option was unknown to me. I'll have to jot this one down for future reference. I can see where it might come in handy. –  Geoff Fritz Dec 2 '09 at 18:09
    
I am hosting multiple websites on a IP address (and using IIS) - is this still possible? I need to bind the subdomain-host name to the "mysite.com" files. So confusing! :P –  meep Dec 3 '09 at 7:20
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.