I have a server in which ubuntu is installed. apache2 , php , mysql are installed A CMS website is running in the server. Now I am told to install another website(jsp) which requires the following tomcat , jsp , wine , matlab framework and mysql (already installed). Well I can install this. The problem is how do i reference the next domain with the ip address. Is it possible?? Is there any documentation for installing 2 websites with completely new domains on the same server using different server softwares ??? Is there anything more that i need to know before starting. plz help . Thanks
How are you going to resolve the fact that you're going to have both apache and tomcat on the same device? They'll both try and use port 80. Usually you need either a seperate IP for each to bind to (in which case you don't need host headers really), or some kind of wrapper, which causes a performance hit, and you would use host headers for that
Apache & tomcat can both be configured to work on different ports, can't they? I thought Tomcat defaults to port 8080?
You'll need to proxy requests through apache and take a hit on perf if you're not prepared to get another ip. Code: <VirtualHost 192.168.1.1:80> ServerName www.yourseconddomainname.com DocumentRoot /var/www/html DirectoryIndex index.html ProxyPass / http://www.yourfirstdomainname.com:81/ ProxyPassReverse / http://www.yourfirstdomainname.com:81/ </VirtualHost> Have a read of mod_proxy
First of all, why would you want two web servers running on the same machine? I'm not familiar with Tomcat, but Apache could easily handle the two sites using name-based virtual hosts. (have a look at http://httpd.apache.org/docs/2.0/vhosts/) I'd say the time required to make both work would be better spent setting up the second site to run under Apache instead of Tomcat. (apache can work with jsp just as well. not familiar with matlab. wine? why would the site require wine?) If you absolutely must have the two servers running at the same time, you'll have to use a proxy. FuzzyOne already suggested how to use Apache for this. There's another solution: using a proxy like Squid. Make Apache and Tomcat run on ports 81 and 82 respectively (just examples) and Squid listen on port 80. Setting up Squid to fetch requests from those two ports based on the domain name shouldn't be very complicated. The advantage of this over FuzzyOne's solution is that the second site won't depend on the first one to run. You can easily stop or restart Apache if needed and this would not interfere with the other site. If Apache hangs for some reason (not very common, but ...), both sites would be unavailable, but if you use Squid, you can do whatever you want with each one of them (web server) without affecting the other.
i cant help with webservers on linux based machines, but on my windows server 2008 box, i have static ip addresses, that route to 2 different port numbers for each of the websites i host on my machine. the routing is dealt with by the router (BT peered ip addresses) each website is bound to a different port.
ofcourse you can configure wich port the server will use, its actually quite easy to configure two sites on one server. just use the host headers to point to the different locations of your site