subdomain "forwarding" for a vhost

subdomain "forwarding" for a vhost

am 08.06.2007 20:19:29 von Paul

I have a vhost in the conf file for, say, mydomain.com. I want to have a
subdomain called abc.mydomain.com to automatically go to URL, say,
abc.anotherdomain.com.

How would I do that?

Re: subdomain "forwarding" for a vhost

am 08.06.2007 20:31:25 von shimmyshack

On Jun 8, 7:19 pm, "Paul" wrote:
> I have a vhost in the conf file for, say, mydomain.com. I want to have a
> subdomain called abc.mydomain.com to automatically go to URL, say,
> abc.anotherdomain.com.
>
> How would I do that?

create a new vhost for abc.mydomain.com
inside the vhost put

RedirectPermanent / http://abc.anotherdomain.com/
#or
# RedirectMatch 301 (.*) http://abc.anotherdomain.com$1
#where 301 sends a permananent redirect, rather than a moved
temporarily [302] status

Re: subdomain "forwarding" for a vhost

am 08.06.2007 20:47:39 von Paul

"shimmyshack" wrote in message
news:1181327485.794174.141700@e65g2000hsc.googlegroups.com.. .
> On Jun 8, 7:19 pm, "Paul" wrote:
>> I have a vhost in the conf file for, say, mydomain.com. I want to have a
>> subdomain called abc.mydomain.com to automatically go to URL, say,
>> abc.anotherdomain.com.
>>
>> How would I do that?
>
> create a new vhost for abc.mydomain.com
> inside the vhost put
>
> RedirectPermanent / http://abc.anotherdomain.com/
> #or
> # RedirectMatch 301 (.*) http://abc.anotherdomain.com$1
> #where 301 sends a permananent redirect, rather than a moved
> temporarily [302] status
>


There's nothing for abs to point to so does the vhost for abc.mydomain.com
need a serveralias and doc root, like:


ServerName abc.mydomain.com
ServerAlias abc.mydomain.com
DocumentRoot /var/www/NOWHERE

RedirectPermanent / http://abc.anotherdomain.com/
temporarily [302] status

Re: subdomain "forwarding" for a vhost

am 08.06.2007 20:56:39 von Paul

I created a new vhost below:


ServerName abc.mydomain.com

RedirectPermanent / http://abc.anotherdomain.com/
temporarily [302] status



went to command prompt and :
> apachectl restart

Tried to open the web page, abc.mydomain.com, and it said "Server not found"
and mod_alias is there.

Any ideas?

Re: subdomain "forwarding" for a vhost

am 08.06.2007 22:41:26 von mark

"Paul" wrote in news:7Dhai.22466$dy1.16854@bigfe9:

> I created a new vhost below:
>
>
> ServerName abc.mydomain.com
>
> RedirectPermanent / http://abc.anotherdomain.com/
> temporarily [302] status
>

>

>
> went to command prompt and :
>> apachectl restart
>
> Tried to open the web page, abc.mydomain.com, and it said "Server not
> found" and mod_alias is there.
>
> Any ideas?
>
>
>

Yeah...do you have a DNS for abc.mydomain.com?




--

----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----

Re: subdomain "forwarding" for a vhost

am 08.06.2007 23:05:21 von Paul

"Mark" wrote in message
news:1181335286_44995@sp6iad.superfeed.net...
> "Paul" wrote in news:7Dhai.22466$dy1.16854@bigfe9:
>
>> I created a new vhost below:
>>
>>
>> ServerName abc.mydomain.com
>>
>> RedirectPermanent / http://abc.anotherdomain.com/
>> temporarily [302] status
>>

>>

>>
>> went to command prompt and :
>>> apachectl restart
>>
>> Tried to open the web page, abc.mydomain.com, and it said "Server not
>> found" and mod_alias is there.
>>
>> Any ideas?
>>
>>
>>
>
> Yeah...do you have a DNS for abc.mydomain.com?

No, my host only allows DNS sub.domain.tld entries for my main account which
is not one of the ones listed.

Re: subdomain "forwarding" for a vhost

am 09.06.2007 00:06:39 von mark

"Paul" wrote in news:Nvjai.22470$dy1.9104@bigfe9:

> "Mark" wrote in message
> news:1181335286_44995@sp6iad.superfeed.net...
>> "Paul" wrote in news:7Dhai.22466$dy1.16854@bigfe9:
>>
>>> I created a new vhost below:
>>>
>>>
>>> ServerName abc.mydomain.com
>>>
>>> RedirectPermanent / http://abc.anotherdomain.com/
>>> temporarily [302] status
>>>

>>>

>>>
>>> went to command prompt and :
>>>> apachectl restart
>>>
>>> Tried to open the web page, abc.mydomain.com, and it said "Server
>>> not found" and mod_alias is there.
>>>
>>> Any ideas?
>>>
>>>
>>>
>>
>> Yeah...do you have a DNS for abc.mydomain.com?
>
> No, my host only allows DNS sub.domain.tld entries for my main account
> which is not one of the ones listed.
>
>
>

Then you can test it by putting an entry into your client machine's hosts
file, as...

[ip_address] abc.mydomain.com


But, don't expect the rest of the world to see it until you can supply a
DNS entry to abc.mydomain.com




--

----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----

Re: subdomain "forwarding" for a vhost

am 09.06.2007 13:48:11 von shimmyshack

On Jun 8, 7:56 pm, "Paul" wrote:
> I created a new vhost below:
>
>
> ServerName abc.mydomain.com
>
> RedirectPermanent /http://abc.anotherdomain.com/
> temporarily [302] status
>

>

>
> went to command prompt and :
>
> > apachectl restart
>
> Tried to open the web page, abc.mydomain.com, and it said "Server not found"
> and mod_alias is there.
>
> Any ideas?

temporarily [302] status
should have been commented - it was part of the explanation line but
got wrapped


ServerName abc.mydomain.com
DocumentRoot /var/www/NOWHERE

RedirectPermanent / http://abc.anotherdomain.com/



you need a DNS entry poiting to that server - so the public can see it
or for just you to test it, you can have a hosts entry pointing
abc.mydomain.com to the server

As you host only allows DNS for sub.domain.tld (which is not one of
the ones listed) it seems to me that any rules you place in the
vhost.conf will only mean anything for clients whose hosts entries you
control. (or if you use a dynamic dns to point to the server IP - I
might be wrong I havent thought that out)
The hosting company might allow you to modify the vhost.conf but the
server will need to be restarted, if they are any good, (at least I
would think this a precaution) thy would parse through your vhost file
and remove anything that doesn't fit with their policies. (if they
machine is shared, you could add rules for domains thate exist on
others accounts, how would the behaviour be predictable in this case)

Sorry if I have repeated anything Mark said.

Re: subdomain "forwarding" for a vhost

am 11.06.2007 02:43:34 von Paul

"shimmyshack" wrote in message
news:1181389691.292034.283190@q69g2000hsb.googlegroups.com.. .
> On Jun 8, 7:56 pm, "Paul" wrote:
>> I created a new vhost below:
>>
>>
>> ServerName abc.mydomain.com
>>
>> RedirectPermanent /http://abc.anotherdomain.com/
>> temporarily [302] status
>>

>>

>>
>> went to command prompt and :
>>
>> > apachectl restart
>>
>> Tried to open the web page, abc.mydomain.com, and it said "Server not
>> found"
>> and mod_alias is there.
>>
>> Any ideas?
>
> temporarily [302] status
> should have been commented - it was part of the explanation line but
> got wrapped
>
>
> ServerName abc.mydomain.com
> DocumentRoot /var/www/NOWHERE
>
> RedirectPermanent / http://abc.anotherdomain.com/
>

>

>
> you need a DNS entry poiting to that server - so the public can see it
> or for just you to test it, you can have a hosts entry pointing
> abc.mydomain.com to the server
>
> As you host only allows DNS for sub.domain.tld (which is not one of
> the ones listed) it seems to me that any rules you place in the
> vhost.conf will only mean anything for clients whose hosts entries you
> control. (or if you use a dynamic dns to point to the server IP - I
> might be wrong I havent thought that out)
> The hosting company might allow you to modify the vhost.conf but the
> server will need to be restarted, if they are any good, (at least I
> would think this a precaution) thy would parse through your vhost file
> and remove anything that doesn't fit with their policies. (if they
> machine is shared, you could add rules for domains thate exist on
> others accounts, how would the behaviour be predictable in this case)
>
> Sorry if I have repeated anything Mark said.
>

great info - I'll give it a try.