logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

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.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Apache to Tomcat: timing out on web files
Author
pkasson



Joined: 15 Dec 2013
Posts: 3
Location: USA, Columbus

PostPosted: Sun 15 Dec '13 20:51    Post subject: Apache to Tomcat: timing out on web files Reply with quote

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

PostPosted: Tue 31 Dec '13 12:04    Post subject: Reply with quote

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 Wink
Back to top
pkasson



Joined: 15 Dec 2013
Posts: 3
Location: USA, Columbus

PostPosted: Tue 31 Dec '13 12:35    Post subject: Apache - timing out ... Reply with quote

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 Wink
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7373
Location: Germany, Next to Hamburg

PostPosted: Wed 01 Jan '14 12:09    Post subject: Reply with quote

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

PostPosted: Wed 01 Jan '14 12:45    Post subject: Reply with quote

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

PostPosted: Thu 02 Jan '14 10:27    Post subject: Reply with quote

Well you might need a proxy script since no modern browsers allows cross domain js / ajax.
Back to top


Reply to topic   Topic: Apache to Tomcat: timing out on web files View previous topic :: View next topic
Post new topic   Forum Index -> Apache