Hi, I am facing some problem with Apache to Tomcat forwarding. I have Tomcat (6.0.18) behind Apache (2.2). I want to use ‘https’ for receiving request from the client. This request, when forwarded by Apache to Tomcat, will use ‘http’. My application’s name is ‘abc’, which is deployed in Tomcat’s webapps dir. Both Tomcat & Apache are on the same machine. There is one more requirement: When a user just types the IP, it should, by default, forward it to the application’s (abc) login page i.e., both the below mentioned URL’s should point to the same page. https://IP/ http://IP:8080/abc I added the following lines in the httpd.conf file: ----------------------------------------------------- ProxyPass /abc http://IP:8080/abc/implement ProxyPass / http://IP:8080/abc/implement ----------------------------------------------------- Now there are two issues: ----------------------------------------------------- 1. When I try to use the https URL (https://IP/), it opens up the login page but the images are not visible. If I try the http one (http://IP:8080/abc/), then the page works fine. I thought of using the blank (appearing so) image’s URL (https://IP/abc/abc/images/logo_login.gif >>> abc 2 times is not a typo; the deployed directory’s name is ‘abc’ & there is a dir named ‘abc’ inside ‘abc’) and see where it’s pointing to. When I tried accessing it, it too was pointing to the same login page where http://IP:8080/abc/ OR https://IP/ are pointing. These are few results that might help you to understand my problem: https://IP/ (No logo; only the login page) https://IP/abc/abc/images/logo_login.gif (No logo; only the login page) (I have also noticed that whatever I append in the https URL after https://IP/abc/ it takes me to the login page with no image) http://IP:8080/abc/implement (Works perfectly. Login page with logo) http://IP:8080/abc/implement/abc/images/logo_login.gif (Login page with logo. I had no idea what this would display but at least I did not imagine that it would display ‘login + image’) http://IP:8080/abc/abc/images/logo_login.gif (Shows ONLY logo as it ideally should) 2. If we use IE6 to open https URL, then a warning box pops-up before the login page appears (without images). This behavior is absent in IE8. The warning message states “line 56 Object expected”. ----------------------------------------------------- Can anyone please guide me? Regards, GC
You have a few problems, the cause of them is not entirely clear.
One thing to bear in mind is this: when you're using Apache HTTPD in front of Tomcat, if you can get it working under normal HTTP then configuring HTTPS should be simple.
HTTP and HTTPS in Apache HTTPD are treated as separate VirtualHosts, so it should just be a case of ensuring that whatever configuration you've applied to the HTTP virtual host is also applied to the HTTPS host.
This can be achieved with ease, by placing all of the mod_jk or mod_proxy (in your case) configuration in an external file and using the 'include' mechanism.
The HTTP address you provide is using the port 8080, which Tomcat specifies as the default port for it's own HTTP connector - suggesting that you're not connecting via Apache HTTPD when you make that request.
The ProxyPass statements point both /abc and / to the same path, which is a subpath of the application /abc - this seems unusual. I'd expect to see the path http://server:8080/abc, without the '/implement' extension, this may be the source of some of the missing images.
The last issue, regarding the message "line 56 Object expected" is likely to be a Javascript problem, possibly caused by a script file experiencing the same 404 as the images.
In order to debug the problem, it would be better to start with a fresh configuration - discard whatever you have so far, or copy it to a backup.
The Fiddler or ieHttpHeader plugins for Internet Explorer will make it easier to examine which resources are, or are not being served correctly.
You will need to examine both the Apache HTTPD and Tomcat access logs to see which server is serving each request and check that the result is the expected one.
Configure the HTTP instance and test it thoroughly before attempting the HTTPS configuration.
Popular Links
Comments
Post new comment