help with reverse proxying cacti

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
golemlist
Posts: 6
Joined: Sun Sep 18, 2005 6:22 am

help with reverse proxying cacti

Post by golemlist »

Hi,
I was trying to use cati with an apache+mod_proxy reverse proxy
in front of the real web server.

I call a https://reverseproxy/cacti which calls http://internalserver/cacti
with a different hostname.
apache conf:
--------------------

Code: Select all

ProxyRequests Off 
ProxyPass /mycacti/ http://internalserver/cacti/
ProxyPassReverse /mycacti/ http://internalserver/cacti/
--------------
I use fedora C3 latest rpms with no selinux 8)

The internal installation works Ok
but when I try to use it from the reverse proxy
I can login but all the forms which
need posts do no post anything....

example cliccking this on useradd or device add
doesn't do anything:
<input type="image" src="images/button_save.gif" alt="Save" align="absmiddle">

I checked and the are no absolute urls in the ACTION of the <form> tags nor in the javascript I found...
Can any one suggest me why any POST is not working?
many thanks

G.
User avatar
egarnel
Cacti Pro User
Posts: 708
Joined: Thu Nov 21, 2002 8:55 am
Location: Austin, TX

Post by egarnel »

what shows up in /var/log/httpd/access_log on both the proxy & cacti servers?
Cacti1 OS: CentOS 5.6 | 300+ devices
Cacti2 OS: CentOS 5.6 | 300+ devices
King of the Elves
Local Anarchists Union #427
"Anarchism is founded on the observation that since few men are wise enough to rule themselves, even fewer are wise enough to rule others." -Edward Abbey
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

Um, I had this problem as well, long time ago and gave up. Haven't had a reason to do it again.

Something to do with sessions is screwing it up and paths that the code checks. That would be my guess.
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
golemlist
Posts: 6
Joined: Sun Sep 18, 2005 6:22 am

no hints in error / access log

Post by golemlist »

Hi,
I checked access and error logs both in reverse proxy and the server
and I can't see anything,
last request is the one for the image in <input type=image>:

10.1.1.58 - - [20/Sep/2005:10:39:33 +0200] "GET /cacti/images/button_save.gif HTTP/1.1" 200 1847 "https://externalserver.test.com/cacti/u ... _edit&id=1" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)"

The form doesn't get submitted
It is probably some javascript quirk...
the only error I get in javascript console is :

Error: [Exception... "'Error: No menu commaner found for URL: https://external.test.com/cacti/user_admin.php' when calling method: [nsIDOMEventListener::handleEvent]" nsresult: "0x8057001c (NS_ERROR_XPC_JS_THREW_JS_OBJECT)" location: "<unknown>" data: no]

which I don't think is related...
maybe it's because the <input type=image> tag is after the </form> closing tag?

PS: I changed the paths and now I have /cacti both on the https reverse proxy and the http internal one (still same problem)
Last edited by golemlist on Thu Sep 22, 2005 10:19 am, edited 2 times in total.
golemlist
Posts: 6
Joined: Sun Sep 18, 2005 6:22 am

some progress

Post by golemlist »

Hi,
I discovered that changing
in /lib/html_form.php

<input type='image' src='images/button_save.gif' alt='Save' align='absmiddle'>

to
<a href="fake.html" onclick="document.chk.submit();return false;"><img src="images/button_save.gif" alt="Save" align="absmiddle"></a>

submits the forum
but The application still doesn't get the parameters I changed...
I still think it's the closing </form> tag too early
any idea?
thanks

G.
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

Doesn't the reverse proxy attempt to fix the HTML? Can that be turned off?

I will be the first one to admit the cacti HTML could be cleaner, and will be cleaner in the next version.
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
golemlist
Posts: 6
Joined: Sun Sep 18, 2005 6:22 am

rewriting html

Post by golemlist »

No it's just a plain proxy,
If I knew how to fix it I'd do it 8)
that's what I do with base hrefs on OWA (microsoft exchange 's outlook web client)....

Do you think it could be possible to change the form template
so that the </form> closing tag could be after the last save button <input type=image> ?
thanks a lot


G.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests