开发者

Symfony page on subdomain with different IP address?

开发者 https://www.devze.com 2023-01-14 02:03 出处:网络
I am using Symfony 1.3.6 on Ubuntu, and I want to partition my website into a separate subdomain on a different IP address.

I am using Symfony 1.3.6 on Ubuntu, and I want to partition my website into a separate subdomain on a different IP address.

Is it possible to have a page that is on a subdomain with a different IP address?

For example, my main website is on http://www.mysite.com

and I want to have a page with a url like this:

http://www.pigeonfancier.mysite.com

But where the 2nd Url is on a different IP address - is that possible?

I know that it is possible to use subdomains using Symfony, by creating a class that derives from sfRoute, but what I am not sure of, is whether hav开发者_JS百科ing a different IP address would throw a spanner in the works.


It's completely possible and you probably wont need to make any child class of sfRoute, unless the subdomains are used in some sort of query or else. But if the different subdomains have different applications of the same project, it's dead simple.

You just need to configure the database host in both machine to a centralized one, and make DNS records A to map your different subdomains.


The second ip address should be binded to a different virtual host in your webserver configuration, or an alias from the main vhost in apache configuration.

If symfony application you can target specific application in the front controller (the index.php) upon hostame in superglobal $_SERVER. That may not be the most elegant solution but it is damn simple and easy to maintain

0

精彩评论

暂无评论...
验证码 换一张
取 消