I know there are lots of topics related to Apache HTTP Server + Tomcat, but I didn't find the solution to my problem yet, but it's for sure someone has already met a problem like mine.
I installed XAMPP for Windows 1.6.8, and then Tomcat 6.0.20 Add-On, because we would like to serve some PHP AND Java contents too.
It's OK, Tomcat is working with the default XAMPP settings on the address http://localhost:8080. (Here's the actual server.xml in "c:\xampp\tomcat\conf\", the workers.properties in "c:\xampp\tomcat\conf\jk\" and the mod_jk.conf file in "c:\xampp\tomcat\conf\auto\".)
But I would like to set the Apache HTTP Server the way that it would directly serve PHP contents OR for given domains on which we would serve Java contents, it would redirect queries to Tomcat (to serve Java contents). We would like to serve more PHP- and Java-sites on the same server.
For example:
- We have already reserved the domain
example_page_1.hu, which is a PHP-based site, so Apache HTTP Server would deal with it. So when the user typesexample_page_1.huin his/her browser, we would serve a PHP-based site. - We have already reserved the domain
example_page_2.hutoo, which is a Java-based site, so Apache HTTP Server would redirect the query to Tomcat. So when the user typesexample_page_2.huin his/her browser, we would serve a Java-based site. - We have already reserved the domain
example_page_3.hu, which is also a Java-based site, so Tomcat would deal with it. - We have already reserved the domain
example_page_4.hu, which is a PHP-based site, so Apache HTTP Server would deal with it again. - etc...
What is the appropriate configuration for Apache HTTP Server (httpd.conf --> VirtualHost, etc.), and for Tomcat (server.xml, etc.) in XAMPP? I'm totally new in using Tomcat, so could you please write a step-by-step guide? (for example what I should write in my config files like according to the example)
I would be really grateful, because I just got the task to move some Java contents from a "pure" Tomcat server to our own server on which I installed XAMPP+Tomcat Add-On to serve PHP and Java contents too.
Thanks! :)
EDIT:
Assuming that we have registered example_page_1.hu domain (there's a real one working), the following is already working for the ROOT of Tomcat, so when the user types the http://example_page_1.hu address, he will see what I can see when typing localhost:8080, with the following lines in httpd.conf:
<VirtualHost *:80>
ServerName example_page_1.hu
ErrorLog c:/xampp/tomcat/logs/ajp.error.log
CustomLog c:/xampp/tomcat/logs/ajp.log combined
<Proxy *>
AddDefaultCharset Off
Order deny,allow
Allow from all
</Proxy>
ProxyPass / ajp://localhost:8009/
ProxyPassReverse / ajp://localhost:8009/
</VirtualHost>
It's OK, but there's a problem.
When I rename ROOT directory to ROOT_BACKUP, I can reach it via the following URL: http://example_page_1.hu/ROOT_BACKUP. Than I copy the contents from the original server to ROOT directory, but it doesn't work, I get an 503 (subdirs like ROOT_BACKUP can still be reached).
The mentioned stuff is some kind of Vaadin application, so the ROOT directory of the original Tomcat server (in webapps dir) consists of these subdirs: META-INF, VAADIN, WEB-INF, and there's one file too: vaadin-6.6.2.jar .
It also has some kind of certification for https-connections, so <Connector> tag in server.xml has a keystoreFile attribute with the path of the keyfile.
What should I do with it to work? Currently I would like to make the first application work, doesn't matter that it's in the ROOT... After solving this problem, we could solve the rest... :)