Sep 29, 2011 11:01 AM
Zenoss + Apache mod_proxy
-
Like (0)
Following this article, I could redirect all of the requests sent to http://mydomain.com/zport/dmd to zenoss very well.
RewriteEngine On
RewriteRule ^/(.*) http://5.191.28.77:8080/VirtualHostBase/http/%{SERVER_NAME}:80/$1 [P,L]
But, I need to redirect to zenoss only the requests sent to http://mydomain.com/monitor
How can I do that? Is it possible using a Location tag?
Bruno:
I want to be sure I understand- do you mean '/monitor' a variable for the monitor (collector)?
Thanks!
--Shane
Hi!
/monitor is only an URL Location. Like this:
<Location /monitor>
</Location>
Bruno:
Did you figure this out? I can only post an example of what we use, I can't claim to understand Apache rewrite rules well.
Best,
--Shane W. Scott (Hackman238)
I'd have to test this more but you may be able to change it to:
RewriteEngine On
RewriteRule ^/monitor/(.*) http://5.191.28.77:8080/VirtualHostBase/http/%{SERVER_NAME}:80/$1 [P,L]
Give that a try and let me know if it works. If it doesn't I can spend a few minutes figuring out the exact proxy/proxypass directives to do what you need.
--Dennis
oops...
You might need:
RewriteEngine On
RewriteRule ^/monitor/(.*) http://5.191.28.77:8080/VirtualHostBase/http/%{SERVER_NAME}:80/monitor/$1 [P,L]
--Dennis
Sorry dhopp, but not works..
This is the error when I try to access http://mydomain.com/monitor/
Here is my apache config.
NOTE: I have an OTRS system running at same machine that runs Zenoss. But it's doesn't matter.
<VirtualHost *:80>
Documentroot /var/www
ServerName mydomain.com
ServerAlias *.mydomain.com
ServerAdmin webmaster@mydomain.com
ProxyRequests Off
ProxyVia On
ProxyPreserveHost On
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
<Directory /var/www>
Order deny,allow
Allow from all
</Directory>
RewriteEngine on
RewriteRule ^/ajuda$ http://mydomain.com/otrs/public.pl?Action=PublicFAQZoom;ItemID=5 [NE]
RewriteRule ^/monitor/(.*) http://5.191.28.77:8080/VirtualHostBase/http/%{SERVER_NAME}:80/monitor/$1 [P,L]
<Location /painel>
ProxyPass http://5.191.28.77/otrs/index.pl
ProxyPassReverse http://5.191.28.77/otrs/index.pl
</Location>
<Location /cliente>
ProxyPass http://5.191.28.77/otrs/customer.pl
ProxyPassReverse http://5.191.28.77/otrs/customer.pl
</Location>
<Location /otrs-web>
ProxyPass http://5.191.28.77/otrs-web
ProxyPassReverse http://5.191.28.77/otrs-web
</Location>
<Location /otrs>
ProxyPass http://5.191.28.77/otrs
ProxyPassReverse http://5.191.28.77/otrs
</Location>
</VirtualHost>
Whatever %{SERVER_NAME} equates to is that resolvable in DNS?
You can try to take out the RewriteRule for /monitor and replace it with something like:
ProxyPass /monitor http://5.191.28.77:8080/VirtualHostBase/http/5.191.28.77:80/VirtualHostRoot/
ProxyPassReverse /monitor http://5.191.28.77:8080/VirtualHostBase/http/5.191.28.77:80/VirtualHostRoot/
Or possibly
<Location /monitor>
ProxyPass http://5.191.28.77:8080/VirtualHostBase/http/5.191.28.77:80/VirtualHostRoot/
ProxyPassReverse http://5.191.28.77:8080/VirtualHostBase/http/5.191.28.77:80/VirtualHostRoot/
</Location>
--Dennis
Bruno, I am working on the same problem.
Proxy Zenoss behind Apache.
Apache serves requests to http://myserver:80/oac, and redirects everything else to Zope
Users see a URL without the port number.
ServerName 10.2.0.85
ProxyPass /oac !
ProxyPass / http://10.2.0.85:8080/
ProxyPassReverse / http://10.2.0.85:8080/
This post makes it sound like this has never worked?
http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html
http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxyrequests
http://betabug.ch/blogs/ch-athens/437
http://wiki.zope.org/zope2/ZopeAndApache
In our case, we are not willing to change the Zope configuration underneath Zenoss, or any of the Zenoss configuration.
We just want a wrapper around standard Zenoss.
Whoa!
I think this works:
ProxyPass /oac !
ProxyPass / http://10.2.0.85:8080/
ProxyPassReverse / http://10.2.0.85:8080/
ProxyPassReverseCookieDomain 10.2.0.85:8080 10.2.0.85
ProxyPassReverseCookiePath / /oac
I am not at all sure the Cookie parameters are useful.
When you try it what do you get?
Not works:
The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request GET /zport/dmd/.
Reason: DNS lookup failure for: 5.191.28.77:8080zport
Bruno it looks like you are missing a slash?
Reason: DNS lookup failure for: 5.191.28.77:8080zport should be
5.191.28.77:8080/zport actually zport shouldn't be picked up at all for a DNS lookup.
Yes, you are right. It works, but, only for my FQDN address mydomain.com/ not for mydomain.com/monitor. I need access zenoss through mydomain.com/monitor.
If I try to access that address (with /monitor at the end) with this new configuration, the bellow error is showed:
The requested URL /monitor was not found on this server.
Here is my config:
ProxyPass /monitor !
ProxyPass / http://5.191.28.77:8080/
ProxyPassReverse / http://5.191.28.77:8080/
ProxyPassReverseCookieDomain 5.191.28.77:8080 5.191.28.77
ProxyPassReverseCookiePath / /monitor
Follow Us On Twitter »
|
Latest from the Zenoss Blog » | Community | Products | Services Resources | Customers Partners | About Us | ||
Copyright © 2005-2011 Zenoss, Inc.
|
||||||||