开发者

Are 'www.example.net' and 'forum.example.com/content' two different web sites?

There is a website www.example.net and it has a Forum link on its home page which leads to forum.example.com/content.

I found out that the main site has been developed using the .NET F开发者_如何学Pythonramework, and the forum has been built using PHP based vBulletin.

Are these two different domains?

In other words, is the Forum some folder inside the Visual Studio Project www.example.net running as part of the ASP.NET website? Or is "forum.example.com/content a link to an altogether different website?


IIS can run PHP code, see here.

So if both are coming from the same server, chances are that the /content part is a virtual directory or application that runs php as part of the same site.

However, your domain names are different - .co.uk and .com can easily be different servers and sites. The easiest way to find out is to ping each domain and see if they are using different IP addresses. If so, they are most probably different servers and sites (though not absolutely certain).


It could be a variety of set-ups.

For example forum.blahblah.com/content and www.blahblah.co.uk can be on completely different machines at opposite ends of the Earth.

Just because the domain names are similar does not have to mean that the underlying implementations are joined.

Try doing a DNS lookup on the domain names and use some web tools to investigate the site's IP addresses - this might shed light on it.

See: http://www.dnsstuff.com/

Personally speaking, If my main site was .NET and I was adding a 3rd party PHP forum - I'd stick it on a different machine.

Update in response to the "Why Are You Asking" comment discussion, below

"basically trying to figure out how to make asp.net website and php based forum work together"

I wouldn't get too hung up on making them work together 'physically on a machine'. I've spend hours trying to untangle, separate and modularize my code and so I hate to see you struggling to merge yours together. ;o)

Keeping them as separate systems and defining the HTTP interface between them is probably simpler.

If you want 'one login' for both components, then that is possible to keep them separate AND share identity using things like OpenID - http://openid.net/developers

Quote: "OpenID is a decentralized authentication protocol"

This video on REST is a brilliant intro to the (often overlooked) power of HTTP - http://www.youtube.com/watch?v=YCcAE2SCQ6k

Quote: "REST is the architecture of the web as it works today...Shouldn't you be working with the architecture instead of against it"

And perhaps look up Eric Evan's chapter on 'Separate Ways' in his DDD book.

  • http://books.google.co.uk/books?id=7dlaMs0SECsC&lpg=PP1&dq=domain%20driven%20design&pg=PA335#v=onepage&q&f=false

Quote: "Integration is always expensive. Sometimes the benefit is small"

All these are non-language specific solutions.

Also you might find this talk about how the BBC integrate their website interesting. - http://www.infoq.com/presentations/web-20-bbc-scaling

Gist: They keep everything separated as much as possible, rarely sending messages between machines in anything other than simple HTTP requests. i.e They avoid remote-SQL queries because they are harder to track and log.

** Evil Character Encoding Issues **

When you start writing your own 'web readers' its worth being aware of character encoding issues too:

Read this article by, Mr Stackoverflow himself, Joel Spolsky:

The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!) - http://www.joelonsoftware.com/articles/Unicode.html

** What the users see**

OK - that was about getting the two systems working together over the web. But, if you want one interface, one domain name to act as the 'gateway', then you could choose to make either the ASP server, or the PHP Lamp Server the 'frontend'. This is where it can get complex. I only know about Apache, not MS..so

I run a number of sites that have different IP addresses, hosted on different machines - but the code for all of them sits on one machine. Each of the Satellite Sites simply proxies HTTP requests to my 'Origin Server' and forwards the reposnses back to the user.

This is done using the apache's proxy features. - http://httpd.apache.org/docs/2.0/mod/mod_proxy.html

Quote:

A typical usage of a reverse proxy is to provide Internet users access to a server that is behind a firewall. Reverse proxies can also be used to balance load among several back-end servers, or to provide caching for a slower back-end server. In addition, reverse proxies can be used simply to bring several servers into the same URL space.

Be prepared for headaches - but with dedication its possible to have two servers one domain name.

See: mod rewrite:

  • http://httpd.apache.org/docs/current/mod/mod_rewrite.html

Quote:

'proxy|P' (force proxy)

This flag forces the substitution part to be internally sent as a proxy request and immediately (rewrite processing stops here) put through the proxy module. You must make sure that the substitution string is a valid URI (typically starting with http://hostname) which can be handled by the Apache proxy module. If not, you will get an error from the proxy module. Use this flag to achieve a more powerful implementation of the ProxyPass directive, to map remote content into the namespace of the local server.

    Note: mod_proxy must be enabled in order to use this flag.

I, like you, also racked my brains trying to figure this stuff out. The trick is to know the right words.

The following phrases probably more likely to hold the key to your answers

  • network architecture
  • REST
  • gateway
  • proxy
  • syndication
  • XML/RPC
  • SOAP
  • API

...than these phrases:

  • make asp work with php
  • two different web sites
  • etc


It is possible to run Asp.NET and PHP on the same host server. So they may be on the same server.

The other way to find out if they are on different servers is to ping the URLs and see if they resolve to the same IP.


Literally, forum.blahblah.com is another website, as it's another domain.
If you are asking if it's the same webserver supports it, it's hard to tell for sure. But if you compare IP addresses of these 2 sites and it will be different, you can tell it's 2 different servers.


Basically, it's a folder, unless there's a complex setup. PHP and ASP.net can reside on the same server.

There are different scenarios:

  • Everything is normal, the same server serves both. which is highly most likely.
  • "forum.blahblah.com/content" is a directory on forum.blahblah.com, that includes a frame, that frame is on another server. You can easily tell if this is the case viewing the source at "forum.blahblah.com/content".
  • There's a complex setup, involving a proxy, that redirects "forum.blahblah.com/content" traffic to a server, and other ``"forum.blahblah.com"` traffic to another, you an tell if this is the case by looking at each's http headers.


It is possible to host sub-domains on completely different servers. So main site (example.com) and sub-domain (forum.example.com) can have different IP addr, and both can run different web-server.

And its also possible for IIS to run PHP sites.


Its not another domain, forum.blahblah.com is a subdomain of blahblah.com. A subdomain is "owned" by it's domain, in some cases it is run by other people (eg webhosting), but blahblah.com would ultimately have control over forum.blahblah.com.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜