Page 1 of 1

Apache proxy for nagios

Posted: Tue Jun 10, 2014 2:52 am
by abcklocki
I want to proxy nagios using apache virtual host: eg. nagios.example.com
My apache is working on 192.168.0.133, my nagios is on 192.168.0.31
I have tried to use some examples from net but i have problem with /nagios/cgi-bin

my config:

Code: Select all

<VirtualHost 192.168.0.133:80>
    ServerName nagios.example.com
    DirectoryIndex index.cgi

    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec FollowSymLinks

    LogLevel debug
    CustomLog /var/log/httpd/nagios-ssl.log combined
    ErrorLog  /var/log/httpd/nagios-ssl.error

    ProxyPass / http://192.168.0.31/nagios/
    ProxyPassReverse / http://192.168.0.31/nagios/

    ProxyPass /nagios/cgi-bin http://192.168.0.31/nagios/cgi-bin
    ProxyPassReverse /nagios/cgi-bin http://192.168.0.31/nagios/cgi-bin
</VirtualHost>

I can access to main nagios page using proxy, but i can't use link on site ( every links in left panel have wrong address :The requested URL /nagios/nagios/cgi-bin/status.cgi was not found on this server.)

Can anybody tell me what I'm doing wrong ? or what is correct config of apache proxy virtual host ?
Thanks a lot

Re: Apache proxy for nagios

Posted: Tue Jun 10, 2014 4:21 pm
by abrist
What do your apache logs show?

Code: Select all

tail -25 /var/log/httpd/error_log
tail -25 /var/log/httpd/access_log
Lets look at your running vhost config:

Code: Select all

httpd -S

Re: Apache proxy for nagios

Posted: Wed Jun 11, 2014 2:24 am
by abcklocki
I don't have bigger problems with proxying to joomla, bugzilla, nconf, own wiki page, and zimbra mail system.
I have problem only with nagios (but i still don't know why)

results of httpd -S

Code: Select all

[root@serverwww-clone httpd]# httpd -S
[Wed Jun 11 08:38:25.000751 2014] [so:warn] [pid 26624:tid 139661041264704] AH01574: module php5_module is already loaded, skipping
[Wed Jun 11 08:38:25.001231 2014] [so:warn] [pid 26624:tid 139661041264704] AH01574: module proxy_ajp_module is already loaded, skipping
[Wed Jun 11 08:38:25.009608 2014] [proxy:info] [pid 26624:tid 139661041264704] AH01145: Sharing worker 'http://192.168.0.31/nagios/' instead of creating new worker 'http://192.168.0.31/nagios/cgi-bin'
VirtualHost configuration:
192.168.0.133:80         is a NameVirtualHost
         default server example.com (/etc/httpd/conf.d/example.com.conf:1)
         port 80 namevhost example.com (/etc/httpd/conf.d/example.com.conf:1)
                 alias www.example.com
         port 80 namevhost nagios.example.com (/etc/httpd/conf.d/example.com.conf:30)
ServerRoot: "/etc/httpd"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/etc/httpd/logs/error_log"
Mutex authdigest-opaque: using_defaults
Mutex proxy-balancer-shm: using_defaults
Mutex rewrite-map: using_defaults
Mutex authdigest-client: using_defaults
Mutex ssl-stapling: using_defaults
Mutex proxy: using_defaults
Mutex authn-socache: using_defaults
Mutex ssl-cache: using_defaults
Mutex default: dir="/run/httpd/" mechanism=default
Mutex mpm-accept: using_defaults
PidFile: "/run/httpd/httpd.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="apache" id=48
Group: name="apache" id=48
I cleaned configurations to simplify and i have two virtual hosts : example.com and nagios.example.com
Interesting line (is this correct ?) : [Wed Jun 11 08:38:25.009608 2014] [proxy:info] [pid 26624:tid 139661041264704] AH01145: Sharing worker 'http://192.168.0.31/nagios/' instead of creating new worker 'http://192.168.0.31/nagios/cgi-bin'

loaded modules of apache:

Code: Select all

Loaded Modules:
 core_module (static)
 so_module (static)
 http_module (static)
 access_compat_module (shared)
 actions_module (shared)
 alias_module (shared)
 allowmethods_module (shared)
 auth_basic_module (shared)
 auth_digest_module (shared)
 authn_anon_module (shared)
 authn_core_module (shared)
 authn_dbd_module (shared)
 authn_dbm_module (shared)
 authn_file_module (shared)
 authn_socache_module (shared)
 authz_core_module (shared)
 authz_dbd_module (shared)
 authz_dbm_module (shared)
 authz_groupfile_module (shared)
 authz_host_module (shared)
 authz_owner_module (shared)
 authz_user_module (shared)
 autoindex_module (shared)
 cache_module (shared)
 cache_disk_module (shared)
 data_module (shared)
 dbd_module (shared)
 deflate_module (shared)
 dir_module (shared)
 dumpio_module (shared)
 echo_module (shared)
 env_module (shared)
 expires_module (shared)
 ext_filter_module (shared)
 filter_module (shared)
 headers_module (shared)
 include_module (shared)
 info_module (shared)
 log_config_module (shared)
 logio_module (shared)
 mime_magic_module (shared)
 mime_module (shared)
 negotiation_module (shared)
 remoteip_module (shared)
 reqtimeout_module (shared)
 rewrite_module (shared)
 setenvif_module (shared)
 slotmem_plain_module (shared)
 slotmem_shm_module (shared)
 socache_dbm_module (shared)
 socache_memcache_module (shared)
 socache_shmcb_module (shared)
 status_module (shared)
 substitute_module (shared)
 suexec_module (shared)
 unique_id_module (shared)
 unixd_module (shared)
 version_module (shared)
 vhost_alias_module (shared)
 mpm_worker_module (shared)
 proxy_module (shared)
 lbmethod_bybusyness_module (shared)
 lbmethod_byrequests_module (shared)
 lbmethod_bytraffic_module (shared)
 lbmethod_heartbeat_module (shared)
 proxy_ajp_module (shared)
 proxy_balancer_module (shared)
 proxy_connect_module (shared)
 proxy_express_module (shared)
 proxy_fcgi_module (shared)
 proxy_fdpass_module (shared)
 proxy_ftp_module (shared)
 proxy_http_module (shared)
 proxy_scgi_module (shared)
 ssl_module (shared)
 systemd_module (shared)
 cgid_module (shared)
 php5_module (shared)

My error.log immediately after start:

Code: Select all

[root@serverwww-clone httpd]# cat error_log
[Wed Jun 11 08:43:59.199742 2014] [core:notice] [pid 26635:tid 140473072064576] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
[Wed Jun 11 08:43:59.201331 2014] [suexec:notice] [pid 26635:tid 140473072064576] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Wed Jun 11 08:43:59.235288 2014] [so:warn] [pid 26635:tid 140473072064576] AH01574: module php5_module is already loaded, skipping
[Wed Jun 11 08:43:59.235377 2014] [so:warn] [pid 26635:tid 140473072064576] AH01574: module proxy_ajp_module is already loaded, skipping
[Wed Jun 11 08:43:59.238756 2014] [proxy:info] [pid 26635:tid 140473072064576] AH01145: Sharing worker 'http://192.168.0.31/nagios/' instead of creating new worker 'http://192.168.0.31/nagios/cgi-bin'
[Wed Jun 11 08:43:59.260718 2014] [auth_digest:notice] [pid 26635:tid 140473072064576] AH01757: generating secret for digest authentication ...
[Wed Jun 11 08:43:59.261949 2014] [lbmethod_heartbeat:notice] [pid 26635:tid 140473072064576] AH02282: No slotmem from mod_heartmonitor
[Wed Jun 11 08:43:59.262055 2014] [ssl:warn] [pid 26635:tid 140473072064576] AH01873: Init: Session Cache is not configured [hint: SSLSessionCache]
[Wed Jun 11 08:43:59.303879 2014] [mpm_worker:notice] [pid 26635:tid 140473072064576] AH00292: Apache/2.4.9 (Fedora) OpenSSL/1.0.1e-fips PHP/5.5.4 configured -- resuming normal operations
[Wed Jun 11 08:43:59.303937 2014] [core:notice] [pid 26635:tid 140473072064576] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
I have switched Loglevel to debug to show every message:
Below content of nagios.log

Code: Select all

[root@serverwww-clone httpd]# cat nagios.log
192.168.0.1 - - [11/Jun/2014:08:44:38 +0200] "GET / HTTP/1.1" 401 477 "-" "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.114 Safari/537.36"
192.168.0.1 - - [11/Jun/2014:08:44:48 +0200] "GET / HTTP/1.1" 200 874 "-" "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.114 Safari/537.36"
192.168.0.1 - - [11/Jun/2014:08:44:48 +0200] "GET /side.php HTTP/1.1" 200 4631 "http://nagios.example.com:81/" "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.114 Safari/537.36"
192.168.0.1 - - [11/Jun/2014:08:44:48 +0200] "GET /main.php HTTP/1.1" 200 4743 "http://nagios.example.com:81/" "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.114 Safari/537.36"
192.168.0.1 - - [11/Jun/2014:08:44:48 +0200] "GET /rss-newsfeed.php HTTP/1.1" 200 572 "http://nagios.example.com:81/main.php" "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.114 Safari/537.36"
192.168.0.1 - - [11/Jun/2014:08:44:48 +0200] "GET /rss-corefeed.php HTTP/1.1" 200 1055 "http://nagios.example.com:81/main.php" "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.114 Safari/537.36"
192.168.0.1 - - [11/Jun/2014:08:44:53 +0200] "GET /nagios/cgi-bin/status.cgi?host=all HTTP/1.1" 404 306 "http://nagios.example.com:81/side.php" "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.114 Safari/537.36"
You can see - I have access to nagios main page (08:44:48) but i have problem with first link: host status - 08:44:53

And last file - nagios.error log file:

Code: Select all



[root@serverwww-clone httpd]# cat nagios.error
[Wed Jun 11 08:43:59.300876 2014] [proxy:debug] [pid 26637:tid 140473072064576] proxy_util.c(1766): AH00925: initializing worker http://192.168.0.31/nagios/ shared
[Wed Jun 11 08:43:59.300933 2014] [proxy:debug] [pid 26637:tid 140473072064576] proxy_util.c(1808): AH00927: initializing worker http://192.168.0.31/nagios/ local
[Wed Jun 11 08:43:59.300954 2014] [proxy:debug] [pid 26637:tid 140473072064576] proxy_util.c(1843): AH00930: initialized pool in child 26637 for (192.168.0.31) min=0 max=25 smax=25
[Wed Jun 11 08:43:59.301660 2014] [proxy:debug] [pid 26638:tid 140473072064576] proxy_util.c(1766): AH00925: initializing worker http://192.168.0.31/nagios/ shared
[Wed Jun 11 08:43:59.301702 2014] [proxy:debug] [pid 26638:tid 140473072064576] proxy_util.c(1808): AH00927: initializing worker http://192.168.0.31/nagios/ local
[Wed Jun 11 08:43:59.301743 2014] [proxy:debug] [pid 26638:tid 140473072064576] proxy_util.c(1843): AH00930: initialized pool in child 26638 for (192.168.0.31) min=0 max=25 smax=25
[Wed Jun 11 08:43:59.303365 2014] [proxy:debug] [pid 26645:tid 140473072064576] proxy_util.c(1766): AH00925: initializing worker http://192.168.0.31/nagios/ shared
[Wed Jun 11 08:43:59.303414 2014] [proxy:debug] [pid 26645:tid 140473072064576] proxy_util.c(1808): AH00927: initializing worker http://192.168.0.31/nagios/ local
[Wed Jun 11 08:43:59.303436 2014] [proxy:debug] [pid 26645:tid 140473072064576] proxy_util.c(1843): AH00930: initialized pool in child 26645 for (192.168.0.31) min=0 max=25 smax=25
[Wed Jun 11 08:43:59.304106 2014] [proxy:debug] [pid 26659:tid 140473072064576] proxy_util.c(1766): AH00925: initializing worker http://192.168.0.31/nagios/ shared
[Wed Jun 11 08:43:59.304144 2014] [proxy:debug] [pid 26659:tid 140473072064576] proxy_util.c(1808): AH00927: initializing worker http://192.168.0.31/nagios/ local
[Wed Jun 11 08:43:59.304164 2014] [proxy:debug] [pid 26659:tid 140473072064576] proxy_util.c(1843): AH00930: initialized pool in child 26659 for (192.168.0.31) min=0 max=25 smax=25
[Wed Jun 11 08:43:59.304890 2014] [proxy:debug] [pid 26687:tid 140473072064576] proxy_util.c(1766): AH00925: initializing worker http://192.168.0.31/nagios/ shared
[Wed Jun 11 08:43:59.304925 2014] [proxy:debug] [pid 26687:tid 140473072064576] proxy_util.c(1808): AH00927: initializing worker http://192.168.0.31/nagios/ local
[Wed Jun 11 08:43:59.304952 2014] [proxy:debug] [pid 26687:tid 140473072064576] proxy_util.c(1843): AH00930: initialized pool in child 26687 for (192.168.0.31) min=0 max=25 smax=25
[Wed Jun 11 08:44:38.305870 2014] [authz_core:debug] [pid 26637:tid 140472659310336] mod_authz_core.c(828): [client 192.168.0.1:52426] AH01628: authorization result: granted (no directives)
[Wed Jun 11 08:44:38.306039 2014] [proxy:debug] [pid 26637:tid 140472659310336] mod_proxy.c(1155): [client 192.168.0.1:52426] AH01143: Running scheme http handler (attempt 0)
[Wed Jun 11 08:44:38.306053 2014] [proxy_ajp:debug] [pid 26637:tid 140472659310336] mod_proxy_ajp.c(713): [client 192.168.0.1:52426] AH00894: declining URL http://192.168.0.31/nagios/
[Wed Jun 11 08:44:38.306063 2014] [proxy_fcgi:debug] [pid 26637:tid 140472659310336] mod_proxy_fcgi.c(768): [client 192.168.0.1:52426] AH01076: url: http://192.168.0.31/nagios/ proxyname: (null) proxyport: 0
[Wed Jun 11 08:44:38.306071 2014] [proxy_fcgi:debug] [pid 26637:tid 140472659310336] mod_proxy_fcgi.c(771): [client 192.168.0.1:52426] AH01077: declining URL http://192.168.0.31/nagios/
[Wed Jun 11 08:44:38.306091 2014] [proxy:debug] [pid 26637:tid 140472659310336] proxy_util.c(2094): AH00942: HTTP: has acquired connection for (192.168.0.31)
[Wed Jun 11 08:44:38.306100 2014] [proxy:debug] [pid 26637:tid 140472659310336] proxy_util.c(2169): [client 192.168.0.1:52426] AH00944: connecting http://192.168.0.31/nagios/ to 192.168.0.31:80
[Wed Jun 11 08:44:38.306216 2014] [proxy:debug] [pid 26637:tid 140472659310336] proxy_util.c(2304): [client 192.168.0.1:52426] AH00947: connected /nagios/ to 192.168.0.31:80
[Wed Jun 11 08:44:38.308540 2014] [proxy:debug] [pid 26637:tid 140472659310336] proxy_util.c(2792): AH00962: HTTP: connection complete to 192.168.0.31:80 (192.168.0.31)
[Wed Jun 11 08:44:38.309618 2014] [proxy:debug] [pid 26637:tid 140472659310336] proxy_util.c(2132): AH00943: http: has released connection for (192.168.0.31)
[Wed Jun 11 08:44:48.266515 2014] [authz_core:debug] [pid 26638:tid 140472542557952] mod_authz_core.c(828): [client 192.168.0.1:52428] AH01628: authorization result: granted (no directives)
[Wed Jun 11 08:44:48.266679 2014] [proxy:debug] [pid 26638:tid 140472542557952] mod_proxy.c(1155): [client 192.168.0.1:52428] AH01143: Running scheme http handler (attempt 0)
[Wed Jun 11 08:44:48.266692 2014] [proxy_ajp:debug] [pid 26638:tid 140472542557952] mod_proxy_ajp.c(713): [client 192.168.0.1:52428] AH00894: declining URL http://192.168.0.31/nagios/
[Wed Jun 11 08:44:48.266702 2014] [proxy_fcgi:debug] [pid 26638:tid 140472542557952] mod_proxy_fcgi.c(768): [client 192.168.0.1:52428] AH01076: url: http://192.168.0.31/nagios/ proxyname: (null) proxyport: 0
[Wed Jun 11 08:44:48.266709 2014] [proxy_fcgi:debug] [pid 26638:tid 140472542557952] mod_proxy_fcgi.c(771): [client 192.168.0.1:52428] AH01077: declining URL http://192.168.0.31/nagios/
[Wed Jun 11 08:44:48.266728 2014] [proxy:debug] [pid 26638:tid 140472542557952] proxy_util.c(2094): AH00942: HTTP: has acquired connection for (192.168.0.31)
[Wed Jun 11 08:44:48.266736 2014] [proxy:debug] [pid 26638:tid 140472542557952] proxy_util.c(2169): [client 192.168.0.1:52428] AH00944: connecting http://192.168.0.31/nagios/ to 192.168.0.31:80
[Wed Jun 11 08:44:48.266875 2014] [proxy:debug] [pid 26638:tid 140472542557952] proxy_util.c(2304): [client 192.168.0.1:52428] AH00947: connected /nagios/ to 192.168.0.31:80
[Wed Jun 11 08:44:48.267651 2014] [proxy:debug] [pid 26638:tid 140472542557952] proxy_util.c(2792): AH00962: HTTP: connection complete to 192.168.0.31:80 (192.168.0.31)
[Wed Jun 11 08:44:48.269855 2014] [proxy:debug] [pid 26638:tid 140472542557952] proxy_util.c(2132): AH00943: http: has released connection for (192.168.0.31)
[Wed Jun 11 08:44:48.418512 2014] [authz_core:debug] [pid 26638:tid 140472542557952] mod_authz_core.c(828): [client 192.168.0.1:52428] AH01628: authorization result: granted (no directives), referer: http://nagios.example.com:81/
[Wed Jun 11 08:44:48.418559 2014] [proxy:debug] [pid 26638:tid 140472542557952] mod_proxy.c(1155): [client 192.168.0.1:52428] AH01143: Running scheme http handler (attempt 0), referer: http://nagios.example.com:81/
[Wed Jun 11 08:44:48.418569 2014] [proxy_ajp:debug] [pid 26638:tid 140472542557952] mod_proxy_ajp.c(713): [client 192.168.0.1:52428] AH00894: declining URL http://192.168.0.31/nagios/side.php, referer: http://nagios.example.com:81/
[Wed Jun 11 08:44:48.418576 2014] [proxy_fcgi:debug] [pid 26638:tid 140472542557952] mod_proxy_fcgi.c(768): [client 192.168.0.1:52428] AH01076: url: http://192.168.0.31/nagios/side.php proxyname: (null) proxyport: 0, referer: http://nagios.example.com:81/
[Wed Jun 11 08:44:48.418583 2014] [proxy_fcgi:debug] [pid 26638:tid 140472542557952] mod_proxy_fcgi.c(771): [client 192.168.0.1:52428] AH01077: declining URL http://192.168.0.31/nagios/side.php, referer: http://nagios.example.com:81/
[Wed Jun 11 08:44:48.418592 2014] [proxy:debug] [pid 26638:tid 140472542557952] proxy_util.c(2094): AH00942: HTTP: has acquired connection for (192.168.0.31)
[Wed Jun 11 08:44:48.418599 2014] [proxy:debug] [pid 26638:tid 140472542557952] proxy_util.c(2169): [client 192.168.0.1:52428] AH00944: connecting http://192.168.0.31/nagios/side.php to 192.168.0.31:80, referer: http://nagios.example.com:81/
[Wed Jun 11 08:44:48.418608 2014] [proxy:debug] [pid 26638:tid 140472542557952] proxy_util.c(2304): [client 192.168.0.1:52428] AH00947: connected /nagios/side.php to 192.168.0.31:80, referer: http://nagios.example.com:81/
[Wed Jun 11 08:44:48.419349 2014] [proxy:debug] [pid 26638:tid 140472542557952] proxy_util.c(2792): AH00962: HTTP: connection complete to 192.168.0.31:80 (192.168.0.31)
[Wed Jun 11 08:44:48.420876 2014] [authz_core:debug] [pid 26645:tid 140472659310336] mod_authz_core.c(828): [client 192.168.0.1:52427] AH01628: authorization result: granted (no directives), referer: http://nagios.example.com:81/
[Wed Jun 11 08:44:48.421026 2014] [proxy:debug] [pid 26645:tid 140472659310336] mod_proxy.c(1155): [client 192.168.0.1:52427] AH01143: Running scheme http handler (attempt 0), referer: http://nagios.example.com:81/
[Wed Jun 11 08:44:48.421040 2014] [proxy_ajp:debug] [pid 26645:tid 140472659310336] mod_proxy_ajp.c(713): [client 192.168.0.1:52427] AH00894: declining URL http://192.168.0.31/nagios/main.php, referer: http://nagios.example.com:81/
[Wed Jun 11 08:44:48.421050 2014] [proxy_fcgi:debug] [pid 26645:tid 140472659310336] mod_proxy_fcgi.c(768): [client 192.168.0.1:52427] AH01076: url: http://192.168.0.31/nagios/main.php proxyname: (null) proxyport: 0, referer: http://nagios.example.com:81/
[Wed Jun 11 08:44:48.421059 2014] [proxy_fcgi:debug] [pid 26645:tid 140472659310336] mod_proxy_fcgi.c(771): [client 192.168.0.1:52427] AH01077: declining URL http://192.168.0.31/nagios/main.php, referer: http://nagios.example.com:81/
[Wed Jun 11 08:44:48.421077 2014] [proxy:debug] [pid 26645:tid 140472659310336] proxy_util.c(2094): AH00942: HTTP: has acquired connection for (192.168.0.31)
[Wed Jun 11 08:44:48.421086 2014] [proxy:debug] [pid 26645:tid 140472659310336] proxy_util.c(2169): [client 192.168.0.1:52427] AH00944: connecting http://192.168.0.31/nagios/main.php to 192.168.0.31:80, referer: http://nagios.example.com:81/
[Wed Jun 11 08:44:48.421190 2014] [proxy:debug] [pid 26645:tid 140472659310336] proxy_util.c(2304): [client 192.168.0.1:52427] AH00947: connected /nagios/main.php to 192.168.0.31:80, referer: http://nagios.example.com:81/
[Wed Jun 11 08:44:48.421898 2014] [proxy:debug] [pid 26645:tid 140472659310336] proxy_util.c(2792): AH00962: HTTP: connection complete to 192.168.0.31:80 (192.168.0.31)
[Wed Jun 11 08:44:48.426124 2014] [proxy:debug] [pid 26638:tid 140472542557952] proxy_util.c(2132): AH00943: http: has released connection for (192.168.0.31)
[Wed Jun 11 08:44:48.430505 2014] [proxy:debug] [pid 26645:tid 140472659310336] proxy_util.c(2132): AH00943: http: has released connection for (192.168.0.31)
[Wed Jun 11 08:44:48.760036 2014] [authz_core:debug] [pid 26645:tid 140472659310336] mod_authz_core.c(828): [client 192.168.0.1:52427] AH01628: authorization result: granted (no directives), referer: http://nagios.example.com:81/main.php
[Wed Jun 11 08:44:48.760115 2014] [proxy:debug] [pid 26645:tid 140472659310336] mod_proxy.c(1155): [client 192.168.0.1:52427] AH01143: Running scheme http handler (attempt 0), referer: http://nagios.example.com:81/main.php
[Wed Jun 11 08:44:48.760126 2014] [proxy_ajp:debug] [pid 26645:tid 140472659310336] mod_proxy_ajp.c(713): [client 192.168.0.1:52427] AH00894: declining URL http://192.168.0.31/nagios/rss-corefeed.php, referer: http://nagios.example.com:81/main.php
[Wed Jun 11 08:44:48.760134 2014] [proxy_fcgi:debug] [pid 26645:tid 140472659310336] mod_proxy_fcgi.c(768): [client 192.168.0.1:52427] AH01076: url: http://192.168.0.31/nagios/rss-corefeed.php proxyname: (null) proxyport: 0, referer: http://nagios.example.com:81/main.php
[Wed Jun 11 08:44:48.760141 2014] [proxy_fcgi:debug] [pid 26645:tid 140472659310336] mod_proxy_fcgi.c(771): [client 192.168.0.1:52427] AH01077: declining URL http://192.168.0.31/nagios/rss-corefeed.php, referer: http://nagios.example.com:81/main.php
[Wed Jun 11 08:44:48.760152 2014] [proxy:debug] [pid 26645:tid 140472659310336] proxy_util.c(2094): AH00942: HTTP: has acquired connection for (192.168.0.31)
[Wed Jun 11 08:44:48.760160 2014] [proxy:debug] [pid 26645:tid 140472659310336] proxy_util.c(2169): [client 192.168.0.1:52427] AH00944: connecting http://192.168.0.31/nagios/rss-corefeed.php to 192.168.0.31:80, referer: http://nagios.example.com:81/main.php
[Wed Jun 11 08:44:48.760171 2014] [proxy:debug] [pid 26645:tid 140472659310336] proxy_util.c(2304): [client 192.168.0.1:52427] AH00947: connected /nagios/rss-corefeed.php to 192.168.0.31:80, referer: http://nagios.example.com:81/main.php
[Wed Jun 11 08:44:48.761014 2014] [proxy:debug] [pid 26645:tid 140472659310336] proxy_util.c(2792): AH00962: HTTP: connection complete to 192.168.0.31:80 (192.168.0.31)
[Wed Jun 11 08:44:48.767082 2014] [authz_core:debug] [pid 26638:tid 140472542557952] mod_authz_core.c(828): [client 192.168.0.1:52428] AH01628: authorization result: granted (no directives), referer: http://nagios.example.com:81/main.php
[Wed Jun 11 08:44:48.767147 2014] [proxy:debug] [pid 26638:tid 140472542557952] mod_proxy.c(1155): [client 192.168.0.1:52428] AH01143: Running scheme http handler (attempt 0), referer: http://nagios.example.com:81/main.php
[Wed Jun 11 08:44:48.767157 2014] [proxy_ajp:debug] [pid 26638:tid 140472542557952] mod_proxy_ajp.c(713): [client 192.168.0.1:52428] AH00894: declining URL http://192.168.0.31/nagios/rss-newsfeed.php, referer: http://nagios.example.com:81/main.php
[Wed Jun 11 08:44:48.767165 2014] [proxy_fcgi:debug] [pid 26638:tid 140472542557952] mod_proxy_fcgi.c(768): [client 192.168.0.1:52428] AH01076: url: http://192.168.0.31/nagios/rss-newsfeed.php proxyname: (null) proxyport: 0, referer: http://nagios.example.com:81/main.php
[Wed Jun 11 08:44:48.767172 2014] [proxy_fcgi:debug] [pid 26638:tid 140472542557952] mod_proxy_fcgi.c(771): [client 192.168.0.1:52428] AH01077: declining URL http://192.168.0.31/nagios/rss-newsfeed.php, referer: http://nagios.example.com:81/main.php
[Wed Jun 11 08:44:48.767182 2014] [proxy:debug] [pid 26638:tid 140472542557952] proxy_util.c(2094): AH00942: HTTP: has acquired connection for (192.168.0.31)
[Wed Jun 11 08:44:48.767189 2014] [proxy:debug] [pid 26638:tid 140472542557952] proxy_util.c(2169): [client 192.168.0.1:52428] AH00944: connecting http://192.168.0.31/nagios/rss-newsfeed.php to 192.168.0.31:80, referer: http://nagios.example.com:81/main.php
[Wed Jun 11 08:44:48.767198 2014] [proxy:debug] [pid 26638:tid 140472542557952] proxy_util.c(2304): [client 192.168.0.1:52428] AH00947: connected /nagios/rss-newsfeed.php to 192.168.0.31:80, referer: http://nagios.example.com:81/main.php
[Wed Jun 11 08:44:48.767831 2014] [proxy:debug] [pid 26638:tid 140472542557952] proxy_util.c(2792): AH00962: HTTP: connection complete to 192.168.0.31:80 (192.168.0.31)
[Wed Jun 11 08:44:49.286028 2014] [proxy:debug] [pid 26638:tid 140472542557952] proxy_util.c(2132): AH00943: http: has released connection for (192.168.0.31)
[Wed Jun 11 08:44:49.499873 2014] [proxy:debug] [pid 26645:tid 140472659310336] proxy_util.c(2132): AH00943: http: has released connection for (192.168.0.31)
[Wed Jun 11 08:44:53.082934 2014] [authz_core:debug] [pid 26645:tid 140472659310336] mod_authz_core.c(828): [client 192.168.0.1:52427] AH01628: authorization result: granted (no directives), referer: http://nagios.example.com:81/side.php
[Wed Jun 11 08:44:53.083028 2014] [proxy:debug] [pid 26645:tid 140472659310336] mod_proxy.c(1155): [client 192.168.0.1:52427] AH01143: Running scheme http handler (attempt 0), referer: http://nagios.example.com:81/side.php
[Wed Jun 11 08:44:53.083039 2014] [proxy_ajp:debug] [pid 26645:tid 140472659310336] mod_proxy_ajp.c(713): [client 192.168.0.1:52427] AH00894: declining URL http://192.168.0.31/nagios/nagios/cgi-bin/status.cgi?host=all, referer: http://nagios.example.com:81/side.php
[Wed Jun 11 08:44:53.083047 2014] [proxy_fcgi:debug] [pid 26645:tid 140472659310336] mod_proxy_fcgi.c(768): [client 192.168.0.1:52427] AH01076: url: http://192.168.0.31/nagios/nagios/cgi-bin/status.cgi?host=all proxyname: (null) proxyport: 0, referer: http://nagios.example.com:81/side.php
[Wed Jun 11 08:44:53.083054 2014] [proxy_fcgi:debug] [pid 26645:tid 140472659310336] mod_proxy_fcgi.c(771): [client 192.168.0.1:52427] AH01077: declining URL http://192.168.0.31/nagios/nagios/cgi-bin/status.cgi?host=all, referer: http://nagios.example.com:81/side.php
[Wed Jun 11 08:44:53.083065 2014] [proxy:debug] [pid 26645:tid 140472659310336] proxy_util.c(2094): AH00942: HTTP: has acquired connection for (192.168.0.31)
[Wed Jun 11 08:44:53.083073 2014] [proxy:debug] [pid 26645:tid 140472659310336] proxy_util.c(2169): [client 192.168.0.1:52427] AH00944: connecting http://192.168.0.31/nagios/nagios/cgi-bin/status.cgi?host=all to 192.168.0.31:80, referer: http://nagios.example.com:81/side.php
[Wed Jun 11 08:44:53.083084 2014] [proxy:debug] [pid 26645:tid 140472659310336] proxy_util.c(2304): [client 192.168.0.1:52427] AH00947: connected /nagios/nagios/cgi-bin/status.cgi?host=all to 192.168.0.31:80, referer: http://nagios.example.com:81/side.php
[Wed Jun 11 08:44:53.083779 2014] [proxy:debug] [pid 26645:tid 140472659310336] proxy_util.c(2792): AH00962: HTTP: connection complete to 192.168.0.31:80 (192.168.0.31)
[Wed Jun 11 08:44:53.087327 2014] [proxy:debug] [pid 26645:tid 140472659310336] proxy_util.c(2132): AH00943: http: has released connection for (192.168.0.31)

My conclusion:
Links in left panel leads me to wrong directory :
Services - > (http://nagios.example.com:81/nagios/cgi ... i?host=all) give me below result:

Code: Select all

Not Found
The requested URL /nagios/nagios/cgi-bin/status.cgi was not found on this server.
Apache/2.2.15 (CentOS) Server at 192.168.0.31 Port 80


But when will I do modifications (delete nagios from url) (put http://nagios.example.com:81/cgi-bin/st ... i?host=all) i can see content of page (but without good formating: no background, no colors, only text)

Re: Apache proxy for nagios

Posted: Wed Jun 11, 2014 5:01 pm
by tmcdonald
We're not really an Apache forum, but we'll help with what we can. However you might want to try posting on an Apache forum since they would be more knowledgeable about it.

I'm not too familiar with the proxy settings, but maybe you have your mapping set incorrectly? That /nagios/nagios/ part makes me think it's processing the rewrite rule twice, so your links are failing. If you just type in the IP address to the address bar does it still bring you to the Nagios web page? If so you might need to remove a /nagios/ from your proxy somewhere since the redirection is already being done.

Re: Apache proxy for nagios

Posted: Thu Jun 12, 2014 7:58 am
by abcklocki
Many thanks for suggestions - I tried to change combination of proxypass directives and it looks like everything is working.
It seems that previos configuration does not prevent dual rewrite - warning "Sharing worker 'http://192.168.0.31/nagios/' instead of creating new worker 'http://192.168.0.31/nagios/cgi-bin' " has big sesne.

I think we can close this topic.

Fixed config (working)

Code: Select all

    ProxyPass /nagios/stylesheets/  http://192.168.0.31/nagios/stylesheets/
    ProxyPassReverse /nagios/stylesheets/  http://192.168.0.31/nagios/stylesheets/

    ProxyPass /nagios/images/  http://192.168.0.31/nagios/images/
    ProxyPassReverse /nagios/images/  http://192.168.0.31/nagios/images/

    ProxyPass /nagios/cgi-bin http://192.168.0.31/nagios/cgi-bin
    ProxyPassReverse /nagios/cgi-bin http://192.168.0.31/nagios/cgi-bin

    ProxyPass /nagios/js http://192.168.0.31/nagios/js
    ProxyPassReverse /nagios/js http://192.168.0.31/nagios/js

    ProxyPass /pnp4nagios http://192.168.0.31/pnp4nagios
    ProxyPassReverse /pnp4nagios http://192.168.0.31/pnp4nagios

    ProxyPass / http://192.168.0.31/nagios/
    ProxyPassReverse / http://192.168.0.31/nagios/

Re: Apache proxy for nagios

Posted: Thu Jun 12, 2014 9:43 am
by tmcdonald
Awesome! I'll be closing this thread now, but feel free to open another if you need anything in the future.