Is it possible to use different technologies in one website
I was watching the tutorials for python and the guy told that he coded the Address books and spell checker for yahoo mail in python.
Now initially i was thinking that if i build the webs开发者_开发知识库ite then i have to use one language either php or java or asp or anything.
But i am confused how can we make make separate modules in diff languages and combine to make one website
Any ideas
Phisical architecture of web application can be different from the logical one visible through browser. Basically it is achieved by putting front web server (think of apache with mod_proxy, but it can be any other moder web server supporting reverse proxying) and mounting web application servers (java/python/whatever) to different paths (like /app1 for java app, /app1/subapp for python app, /app2 for php app). Of course those applications work independently by default, so if you want to pass some data between you have to establish some communication between (direct socket-to-socket or indirect with some messaging middleware or database).
In general it is very broad topic, so if you're interested, try with some basic keywords: application servers, load balancing, reverse proxy, url rewriting.
You can use any language to provide a web service, so you can for example provide a REST/SOAP web service that returns JSON or XML. The web service can be written in any language, and the language used to interact with the web service can be any language, as all languages nowadays have JSON and XML parsers.
You can setup different subdomains to be used by different servers and setup those applications in any language you'd like.
I know in Ruby on Rails, you can execute bash commands.
Example: puts ls
If you just need to call simple scripts from PHP, you can of course use exec(). I use it quite often to be able to code something in ruby, which I prefer for non-web tasks, and call the ruby script from PHP (it can of course be done the other way round).
If they're different pages, they can easily be created by different software. So if a mail application written in Java offers a link to an address book, the address book can easily be Python--that's just a matter of configuring the server.
If you need an addressbook component within the mail application, that's a bit more complicated, but still doable. Especially with Java and .NET it's possible to run various languages on the same platform (e.g. Jython and Ironpython run Python on the JAVA and .NET VMs respectively).
But i am confused how can we make make separate modules in diff languages and combine to make one website
Please read this: http://httpd.apache.org/docs/2.0/sections.html
Then read this: http://php.net/manual/en/configuration.changes.php
Then read this: http://code.google.com/p/modwsgi/
Then read this: http://www.modruby.net/en/
Then read this: http://tomcat.apache.org/
Apache can support a large number of languages via plug-in modules.
Using mod_rewrite as well as the fundamental "section" definitions available in Apache, you can separate your URI's into separate modules in different languages.
精彩评论