Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: Apache to Tomcat: timing out on web files |
|
Author |
|
pkasson
Joined: 15 Dec 2013 Posts: 3 Location: USA, Columbus
|
Posted: Sun 15 Dec '13 20:51 Post subject: Apache to Tomcat: timing out on web files |
|
|
Hi all,
First time configuring Apache (2.2 w/ mod_jk) and when running locally (192.168.1.x), no problem.
When configuring from a DynDns through my UVerse router, I get several JS and CSS 'not found' and of course bad rendered site.
It basically times out on those items and can't locate the issue -- help paid with Christmas cookies.
Thanks,
Peter |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Tue 31 Dec '13 12:04 Post subject: |
|
|
What happens when you call at timed out files itself over the Dyndns url? Does it load?
Anything in your apache access log or error log about that?
P.S.: I love cookies |
|
Back to top |
|
pkasson
Joined: 15 Dec 2013 Posts: 3 Location: USA, Columbus
|
Posted: Tue 31 Dec '13 12:35 Post subject: Apache - timing out ... |
|
|
Since I posted this originally, much of this area was new to me. I have since found out what has been happening, but hopefully THOSE with XSS / CORS experience can help as well.
The timeout was due to running my site from behind my router, as this router has a loop problem. When I run it from a site outside my location it works !
But .... now that I got past that, and since I put Apache in front of Tomcat, here is the problem that had been happening all along - cross domain call fail.
I have a JS (jQuery) that runs when the page is rendering, and have tried so many variations to allow this to work .. a cors servlet, Apache conf settings ...
Still getting:
[Error] XMLHttpRequest cannot load http://www.somewhere.com/getMenu.jsp. Origin http://192.168.1.112:8080 is not allowed by Access-Control-Allow-Origin. (diabetesagent, line 0)
When I run it outside, it does not use 192.168.1.112 (as that was internal) but instead the origin is somewhere.com.
I have verified that the header is not always modified to allow this to work, from how I understand CORS. Here is a snippet of my Apache config:
Header set Access-Control-Allow-Origin "*"
If this gets solved, I will pickup some cookies and send (just provide address |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Wed 01 Jan '14 12:09 Post subject: |
|
|
You have to use absolute paths without domain name.
e.g.
src="/getMenu.jsp"
at least that is how it works with mod_proxy_(http/ajp)
In some cases I have to use mod_proxy_html to correct that. I'm not sure if mod_proxy_html does work with mod_jk.
Well there is still mod_sed in apache 2.4. With it you can rewrite content of the delivered html before sending it to the client. |
|
Back to top |
|
pkasson
Joined: 15 Dec 2013 Posts: 3 Location: USA, Columbus
|
Posted: Wed 01 Jan '14 12:45 Post subject: |
|
|
Thanks for the reply.
I am not sure I can send parts (like just /getMenu.jsp) to the client. I have heard of re-writing but never understood it fully or saw the need, maybe now is the time.
I think in the end, there has to be a way to SUCCESSFULLY setup JS cross domain calls without doing this.
Thanks and Happy New Year ! |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Thu 02 Jan '14 10:27 Post subject: |
|
|
Well you might need a proxy script since no modern browsers allows cross domain js / ajax. |
|
Back to top |
|
|
|
|
|
|