Hey every one, I have a question about using 2 servers with only 1 domain. So this is what i want to, i have a site with multiple different section, so i want to have my main site on server#1 but lets say i want my payment system and forum on server#2 but i want everything to have the same domain such as main site (server#1) mysite.com and everything else (server#2) mysite.com/whatever or whatever.mysite.com. Im not sure how to entirely set this up, i have my own nameservers created and i see i am able to put more then 1 ip per host, is it as easy as just adding server#2 ips in the hosts and run a cPanel on server 2 with my domain and just make the directory i want and it will work ? Im really stumped on how to do this, Any help would be greatly appreciated. Thanks
If apache based, I believe you can do cross-server rewrite rules. The other idea would be (again using rewrite rules) to have a subdomain located on the other server, and use the rewrite to write the subdomain as a subdirectory.
That shouldn't be an issue. Just set the other sites up as fully qualified domain on the appropriate server e.g. name.domain.com, then set up an A Record in the DNS settings for the original domain to point to the other site. We run many things like that - ftp.domain.com, mail.domain.com, mysql.domain.com, sql.domain.com, www.domain.com, stats.domain.com, traffic.domain.com, newsite.domain.com, forum.domain.com - with every one of these sites operating on different servers. Not sure how you do it in Apache, but it's a breeze in Windows, so it shouldn't be a problem.
Sorry im still having trouble, I setup an account on server 2 called clients.mydomain.com do i setup any dns zones on this server ? Ok server 1 the main server where the domain is being pointed do i add a dns zone and if so what exactly is it ? Or do i have to add something at the domain registrar do i add another nameserver for the domain to point to ? Thanks
Edit/Update/Question Ok is it really this easy, the site i want on server#2 has a dedicated ip for example 11.22.33.44. All i did was on server #1 in the account with the domain i want to work on both server i added a dns zone client.mydomain.com and pointed it to 11.22.33.44 and now when i go to it is sends be to the site hosted on server #2 with the dedicated ip. I didn't have to do anything on server #2 or at the domain registrar. Can someone answered if this is right cause it seems a little to good to be true with how long i have been trying to dso this and how easy the solution is. Thanks as always Tom
You've done it correctly and it is that easy. DNS can seem a little complicated at first until you get your head around it. Server #2 didn't need to be on a dedicated IP, as long as there was an IP and a host header, it would still be found - even if that IP was shared. Sometimes, the simplest way to look at it is that EVERYTHING is a sub-domain of the main domain - even "www". So, www.domain.com, ftp.domain.com, pop.domain.com etc etc etc etc are all subdomains of the primary. The main domain controls the DNS for all the subdomains you create. You only need to add an A record at the main domain, with the correct IP for the subdomain if it exists on a different IP address (or server), for it to work. The other thing to remember is that if you're creating the subdomain on a different server then you need to use the fully qualified domain name i.e. you must use the full subdomain.domain.com nomenclature for setting up the site. Using just "subdomain" or only "domain.com" will lead to problems and it won't work.