LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Virtual server and domain forwarding (https://www.linuxquestions.org/questions/linux-server-73/virtual-server-and-domain-forwarding-623571/)

tiger.woods 02-24-2008 07:10 PM

Virtual server and domain forwarding
 
I have a domain setup at GoDaddy that I want to forward to a sub domain that is currently setup as a virtual server on my box, can this be done?

I made the changes I thought I needed to do but I'm getting the default website on the server - like the forwarder isn't sending the correct information in the header for Apache to parse...just a thought.

Hopefully some one can give some guidance..

Thanks.

TW,

dkm999 02-24-2008 07:51 PM

If I understand you right, you have a HTTP server set up on a box at home; for the sake of example, let's call it yourbox.somedomain.com. And you also have a GoDaddy account that contains a HTTP server.

In order to get users to be redirected to yourbox.somedomain.com, you need to do two things:

1. Make sure that the DNS system resolves yourbox.somedomain.com to the IP address of your box at home. It may not happen immediately when you make some change to some DNS server, because it takes some time before all DNS servers in the world notice the change you make. But once the DNS system comes up with the right IP address for your box at home, then you are in a good position to re-direct requests that currently go to your GoDaddy account.

2. According to the GoDaddy FAQ, if your domain is parked there (for HTTP purposes), then you can log in and tell it to redirect any queries to http://yourbox.somedomain.com. I guess that if your domain is not parked there, but is actually being served as an active site from their servers, this will not work. Perhaps you can get them to park your domain there, so that you can then redirect it to your box at home.

Good luck

tiger.woods 02-24-2008 08:21 PM

I host off of a box at my location - GoDaddy just houses the DNS records only.

The site yourbox.somedomain.com resolves and is currently active so all is good there. The problem is I want to create a new domain mydomain.com and have it forward to yourbox.somedomain.com.

The site yourbox.somedomain.com is set up on a linux box using virtual hosting and there is a default website for anything not resolving to any of the virtual hosts, normal setup I believe.

What's happening is that after making the changes at GoDaddy for forwarding and directing it to yourbox.somedomain.com the default website on the server is coming up.

Thanks,

dkm999 02-25-2008 11:58 AM

Thanks for the additional description; this narrows down the possibilites. If the Linux box (yourbox.somedomain.com) is running the Apache HTTP server, it should be writing logfiles that will give you some further information about exactly what is happening when a request arrives.

The configuration file (/etc/httpd/conf/httpd.conf on my machines) will specify where the logfiles are written. If you have VirtualHost containers defined for each virtual host on your machine, the logfile name(s) will be enclosed within the <VirtualHost> .... </VirtualHost> tags. The thing to look for is what the request looks like when you attempt to access the new website (mydomain.com). Check which logfile gets a new entry when you attempt such an access, and see what the request looks like. Note that the way virtual hosting works under Apache is that the requested site name must match the string specified in the <VirtualHost> block via the ServerName directive. If the incoming request does not match any declared virtual server name, it will be handled by the default (first-declared) virtual host.

Hope this helps.

tiger.woods 02-27-2008 01:51 PM

Thanks for the reply.

I managed to get it working by essentially creating the virtual host mydomain.com on the server and then pointing that host to the directory that contained the yourbox.somedomain.com files.

After a little tweaking on the configuration file it was good to go.

Thanks for your help in this matter.

TW,


All times are GMT -5. The time now is 01:30 AM.