Forum Moderators: phranque

Message Too Old, No Replies

more domains without VirtualHost

How to have more than one domain without VirtualHost

         

arkturuz

9:17 am on Nov 17, 2005 (gmt 0)

10+ Year Member



Greetings!

I have, for example, a domain www.domain.com.
I am serving dynamic content through mod_perl application.
Now I need a second domain like newsite.domain.com.

The only difference between the two is the HTML template loading: I have a set of templates for www.domain.com and a different set for newsite.domain.com. The underlying functionality is the same.

When the user comes to www.domain.com I want him all the time to see www.domain.com/some_uri as the address, and when the different user comes to browse newsite.domain.com she must have that address all the time in address bar.

I would like to avoid using VirtualHost directives and I can in my mod_perl application differentiate between the two domains, but what config I must have for apache in order for this to work properly?

Is ServerAlias enough?
Sth like ServerAlias www.domain.com newsite.domain.com?

jdMorgan

1:59 pm on Nov 17, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



arkturuz,

Welcome to WebmasterWorld!

Yes you'll need a ServerAlias, and you'll also need to set up your DNS zone file so that newsite.example.com resolves to your server's IP address.

Jim

arkturuz

3:01 pm on Nov 17, 2005 (gmt 0)

10+ Year Member



Thank you for your answer!
Meanwhile, we (the root and I :-)) decided to use VirtualHost, because using ServerAlias did not get desired effect. We are using Apache2 and the config files are nightmare.

Now the newsite.domain.com seems to work but we cannot get the desired output.
All we got is: 'File does not exist: /htdocs', although no one is requesting htdocs.

arkturuz

3:05 pm on Nov 17, 2005 (gmt 0)

10+ Year Member



I forgot: DNS is configured to resolve newsite.domain.com to the IP address of www.domain.com.