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'm overwhelmed by the many choices one has in website design. I'm probalbly asking something really easy to set up, but since I don't have any experience, I'm looking for help.

Current Setup

  1. I've got a domain and ftp access to it. The apache webserver has mod_rewrite and perl installed (if that helps). I set up a subdomain that is currently pointing to the directory.

  2. I've created a draft website running in the werc framework on a different linux machine. This server has no domain name, I can access it using the static IP or werc supports virtual hosting, but I don't quite understand it and know if it helps me here. I'm running lighttp (w/ vhost and mod_rewrite) and have full root permission, so anything is possible on this end.


I would like to run the werc site inside the subdomain The URL in the browser should be, i.e. no apparent redirecting to the actual werc server IP should take place.

What's the best way to achieve that? I tried mod_rewrite on the machine, but I could only redirect. I think one could use a seperate "frame" for the werc hosted site, but that feels a little unclean. E.g. what would happen to the <title> tag?

What are my options? Thanks in advance.

share|improve this question

migrated from Nov 2 '11 at 6:57

This question came from our site for professional and enthusiast programmers.

I answered this here, instead, since it's purely a server configuration question. – Tim Post Nov 2 '11 at 7:04
up vote 1 down vote accepted

You should be able to solve this by adding a CNAME record for the sub domain with your DNS provider (or local name server, whichever you are using).

A CNAME says "This is just an alias for

Then, name your virtual host on the subdomain server, and you won't have to go through any kind of redirection or re-write rules for it to work.

I'm not sure where you host DNS for, but almost every provider out there lets you setup a CNAME record through the control panel. If you are locally hosting DNS (e.g. BIND on the Linux box), add this to the zone file for (e.g.):        CNAME

More on CNAME records can be found at Wikipedia.

share|improve this answer
thanks! This sounds promising. I'll give it a try. – Sebastian Nov 2 '11 at 7:41
OK, I just learnt that this provider doesn't allow CNAME records for other servers, only for directories on that server. sucks... I guess I have to live with redirect then? anyway, answer was very helpful -- accepted. – Sebastian Nov 2 '11 at 14:11
There are some excellent free DNS hosting providers that give you full access to your zone records. It would probably be worth it to investigate some for the future, as being able to add a quick work around (like this one) will really speed up your work. Some hosting compaies / registrars are just morons, unfortunately. – Tim Post Nov 3 '11 at 1:16

Your Answer


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.