Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

i have name-based hosting, lets name it - my friend have 'white' ip and gave me virtual machine than i can access via ssh, also, he made some magic with ports and now after install apache i could access /var/www on the So, the question is how can i make subdomain like There are should be some magick with Apache's Listen Directive, but i cant figure it finally. Also, i know how to create local-available sites with apache, but it is not the same.

share|improve this question

closed as not constructive by John Gardeniers, Lucas Kauffman, Ward, Scott Pack, rnxrx Aug 25 '12 at 5:48

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

First you have to modify the DNS zone and add a record for to point to the server's IP address.

Then, you just add another <VirtualHost> directive or a ServerAlias directive into an existing <VirtualHost> if you want the subdomain to point to the same virtual host.

I suggest you read the Apache tutorial on name-based virtual hosts.

share|improve this answer

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