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
I've got a domain mydomain.com and ftp access to it. The apache webserver has mod_rewrite and perl installed (if that helps). I set up a subdomain user.mydomain.com that is currently pointing to the
http://www.mydomain.com/user
directory.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
mywebsite.dyndns.org
. werc supports virtual hosting, but I don't quite understand it and know if it helps me here. I'm running lighttp (w/vhost
andmod_rewrite
) and have full root permission, so anything is possible on this end.
Problem
I would like to run the werc site inside the subdomain user.mydomain.com. The URL in the browser should be user.mydomain.com, 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 mydomain.com 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.
You should be able to solve this by adding a
CNAME
record for the sub domainuser.mydomain.com
with your DNS provider (or local name server, whichever you are using).A
CNAME
says "Thisuser.mydomain.com
is just an alias formywebsite.dyndns.org
.Then, name your virtual host on the subdomain server
user.mydomain.com
, 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
mydomain.com
, but almost every provider out there lets you setup aCNAME
record through the control panel. If you are locally hosting DNS (e.g. BIND on the Linux box), add this to the zone file formydomain.com
(e.g.):More on CNAME records can be found at Wikipedia.