Xymon Mailing List Archive search

nginx as the web server

10 messages in this thread

list Asif Iqbal · Tue, 12 Nov 2013 13:27:29 -0500 ·
Hi All

I am using nginx instead of apache with xymon.
I set it up using the link
http://timedoctor.org/2010/09/setting-up-xymonhobbit-with-nginx/

I am using nginx with xymon_4.3.12_amd64.deb from sourceforge.

To make the cgi links work I needed to create symlinks as the link above
suggested.

/usr/lib/xymon/xymon-cgi -> /usr/lib/xymon/cgi-bin
/usr/lib/xymon/xymon-seccgi -> /usr/lib/xymon/cgi-secure

Is that how everyone using it with nginx?

Please advise.

-- 
Asif Iqbal
PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
list Mark Felder · Tue, 12 Nov 2013 12:53:12 -0600 ·
quoted from Asif Iqbal
On Tue, Nov 12, 2013, at 12:27, Asif Iqbal wrote:
Hi All

I am using nginx instead of apache with xymon.
I set it up using the link
http://timedoctor.org/2010/09/setting-up-xymonhobbit-with-nginx/

I am using nginx with xymon_4.3.12_amd64.deb from sourceforge.

To make the cgi links work I needed to create symlinks as the link above
suggested.

/usr/lib/xymon/xymon-cgi -> /usr/lib/xymon/cgi-bin
/usr/lib/xymon/xymon-seccgi -> /usr/lib/xymon/cgi-secure

Is that how everyone using it with nginx?

Please advise.
I wrote that article a long time ago. Looks like my friend updated his
blog to have a rather annoying theme :-)

I can't comment further as I needed to bring up Xymon on a test box and
I didn't want to use Apache. That seemed to work at the time. Scanning
the config again it doesn't seem completely out of place, but that
symlink solution was a hack that probably could have been avoided.
list Asif Iqbal · Mon, 18 Nov 2013 12:40:33 -0500 ·
quoted from Mark Felder
On Tue, Nov 12, 2013 at 1:53 PM, Mark Felder <user-db141d317836@xymon.invalid> wrote:
symlink solution was a hack that probably could have been avoided.

Any suggestion on how to avoid that symlink?
quoted from Asif Iqbal


-- 
Asif Iqbal
PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
list Mark Felder · Mon, 10 Nov 2014 09:52:30 -0600 ·
quoted from Asif Iqbal

On Mon, Nov 18, 2013, at 11:40, Asif Iqbal wrote:
On Tue, Nov 12, 2013 at 1:53 PM, Mark Felder <user-db141d317836@xymon.invalid> wrote:
symlink solution was a hack that probably could have been avoided.

Any suggestion on how to avoid that symlink?

I finally got around to figuring out Nginx + Xymon. You have to make
some changes due to the way Nginx handles fastcgi variables when aliases
are used.

http://blog.feld.me/posts/2014/11/setting-up-xymon-with-nginx/
list Bill Arlofski · Mon, 10 Nov 2014 11:55:23 -0500 ·
quoted from Mark Felder
On 11/10/2014 10:52 AM, Mark Felder wrote:

On Mon, Nov 18, 2013, at 11:40, Asif Iqbal wrote:
On Tue, Nov 12, 2013 at 1:53 PM, Mark Felder <user-db141d317836@xymon.invalid> wrote:
symlink solution was a hack that probably could have been avoided.

Any suggestion on how to avoid that symlink?

I finally got around to figuring out Nginx + Xymon. You have to make
some changes due to the way Nginx handles fastcgi variables when aliases
are used.

http://blog.feld.me/posts/2014/11/setting-up-xymon-with-nginx/
Hi Mark.  Thanks for that... As a matter of fact, just last week I set off to
lower memory use on a VM that runs my Xymon server so I thought ditching
Apache and using nginx would be a good idea.

Of course I ran into the same issues regarding the CGI directory names. I
opted for the symlink method and was happy with it - didn't know this thread
was ongoing. :)
Exerything worked fine, including all of the CGIs "acks", "endis", "event
logs" etc, except for the "edit critical systems" page.  It works fine under
Apache, but not under nginx.

Any ideas what I might have missed?

I had to modify ownership on some dirs for some of the CGIs to work (snapshot
reports for example: ~xymon/server/www/snap)

nginx logs just show http 200 result on submission of the critical systems form.

Thanks for any input. Would be nice to switch this VM to nxginx once and for all.

Bill


-- 
Bill Arlofski
Reverse Polarity, LLC
http://www.revpol.com/
-- Not responsible for anything below this line --
list Bill Arlofski · Mon, 10 Nov 2014 21:50:55 -0500 ·
quoted from Mark Felder
On 11/10/2014 10:52 AM, Mark Felder wrote:

On Mon, Nov 18, 2013, at 11:40, Asif Iqbal wrote:
On Tue, Nov 12, 2013 at 1:53 PM, Mark Felder <user-db141d317836@xymon.invalid> wrote:
symlink solution was a hack that probably could have been avoided.

Any suggestion on how to avoid that symlink?

I finally got around to figuring out Nginx + Xymon. You have to make
some changes due to the way Nginx handles fastcgi variables when aliases
are used.

http://blog.feld.me/posts/2014/11/setting-up-xymon-with-nginx/
Hi Mark

I ran across an issue when using http basic_auth for the CGI stuff,  the
username was not being pasted to the CGI.

So for example, when I disabled a test, clicking on a blue icon would show:

Disabled by: unknown @ 192.168.1.1

Turns out I had to add a line:

fastcgi_param REMOTE_USER $remote_user;

To the configuration.  Hope this helps someone else. (Thanks Matt)


I still can not get the Critical Systems editor CGI to work under nginx though.
quoted from Bill Arlofski


Bill


-- 
Bill Arlofski
Reverse Polarity, LLC
http://www.revpol.com/
-- Not responsible for anything below this line --
list Mark Felder · Tue, 11 Nov 2014 07:58:08 -0600 ·
quoted from Bill Arlofski

On Mon, Nov 10, 2014, at 20:50, Bill Arlofski wrote:
Turns out I had to add a line:

fastcgi_param REMOTE_USER $remote_user;

To the configuration.  Hope this helps someone else. (Thanks Matt)
Ahh, that's annoying. Didn't notice REMOTE_USER isn't in the default
fastcgi_params that ships with nginx. I'll throw that on my blog post.
quoted from Bill Arlofski
 
I still can not get the Critical Systems editor CGI to work under nginx
though.
Which part isn't working? I have never used it personally, but it
appears functional to me.
list Bill Arlofski · Tue, 11 Nov 2014 11:53:23 -0500 ·
quoted from Mark Felder
On 11/11/2014 08:58 AM, Mark Felder wrote:

On Mon, Nov 10, 2014, at 20:50, Bill Arlofski wrote:
Turns out I had to add a line:

fastcgi_param REMOTE_USER $remote_user;

To the configuration.  Hope this helps someone else. (Thanks Matt)
Ahh, that's annoying. Didn't notice REMOTE_USER isn't in the default
fastcgi_params that ships with nginx. I'll throw that on my blog post.
Oh cool.   Glad I (and my friend Matt) could help .:)
quoted from Mark Felder

I still can not get the Critical Systems editor CGI to work under nginx
though.
Which part isn't working? I have never used it personally, but it
appears functional to me.
Hi Mark,

When I try to add a host/test to the list and click "update record" nothing
happens, and the host/test is not added. The page does (quickly) reload
though, with the host and test pre-filled in.

Keep in mind, that for this to work quickly while testing, and have something
show up in the critical systems page, I choose a test that is currently red or
yellow and attempt to add it. :)

Also, you can get a quick indication that it worked or didn't by setting the
host/test in the form and clicking search after attempting to add it. A popup
will tell you if the host was not found.


Under apache, when I add a host/test and click "update record", I get a popup
that says (something like) "record added"

nginx logs show http 200 results on submission of the form, so there is not
much I have to go on.

Thanks for any help with this.
quoted from Bill Arlofski

Bill


-- 
Bill Arlofski
Reverse Polarity, LLC
http://www.revpol.com/
-- Not responsible for anything below this line --
list Bill Arlofski · Sat, 15 Nov 2014 16:23:58 -0500 ·
quoted from Bill Arlofski
On 11/11/2014 11:53 AM, Bill Arlofski wrote:
On 11/11/2014 08:58 AM, Mark Felder wrote:

On Mon, Nov 10, 2014, at 20:50, Bill Arlofski wrote:
Turns out I had to add a line:

fastcgi_param REMOTE_USER $remote_user;

To the configuration.  Hope this helps someone else. (Thanks Matt)
Ahh, that's annoying. Didn't notice REMOTE_USER isn't in the default
fastcgi_params that ships with nginx. I'll throw that on my blog post.
Oh cool.   Glad I (and my friend Matt) could help .:)

I still can not get the Critical Systems editor CGI to work under nginx
though.
Which part isn't working? I have never used it personally, but it
appears functional to me.
Hi Mark,

When I try to add a host/test to the list and click "update record" nothing
happens, and the host/test is not added. The page does (quickly) reload
though, with the host and test pre-filled in.

Keep in mind, that for this to work quickly while testing, and have something
show up in the critical systems page, I choose a test that is currently red or
yellow and attempt to add it. :)

Also, you can get a quick indication that it worked or didn't by setting the
host/test in the form and clicking search after attempting to add it. A popup
will tell you if the host was not found.


Under apache, when I add a host/test and click "update record", I get a popup
that says (something like) "record added"

nginx logs show http 200 results on submission of the form, so there is not
much I have to go on.

Thanks for any help with this.

Bill

 <facepalm>

Mark, list, et al

OK, I see what the problem is (was).

When you run the configure script for Xymon, it asks you what user name your
web server is running under.

This is so that when you run:

make install

it know what ownerships to set on some of the dirs in the www directory
(notes, snap, rep) and on the ~xymon/server/etc/critical.cfg file.

My critical.cfg file was 664 apache:apache from when I answered the "what user
does your web server run under" question on a previous install/upgrade.

I just changed my web server from apache to nginx, and of course the username
that nginx runs under is not "apache". ;)

I had caught this on the snap and rep dirs in www, but completely missed the
critical.cfg file in etc.

So this is 100% working under nginx now, but my only concern is that I got no
indication in any logs that the webserver (nginx) could not write to the
critical.cfg file, so that is kind of interesting.

Hopefully, sharing my embarrassment will same someone else the trouble. :)
quoted from Bill Arlofski

Bill


-- 
Bill Arlofski
Reverse Polarity, LLC
http://www.revpol.com/
-- Not responsible for anything below this line --
list Mark Felder · Mon, 17 Nov 2014 10:56:00 -0600 ·
quoted from Bill Arlofski
On Sat, Nov 15, 2014, at 15:23, Bill Arlofski wrote:
 <facepalm>

Mark, list, et al

OK, I see what the problem is (was).

When you run the configure script for Xymon, it asks you what user name
your
web server is running under.

This is so that when you run:

make install

it know what ownerships to set on some of the dirs in the www directory
(notes, snap, rep) and on the ~xymon/server/etc/critical.cfg file.

My critical.cfg file was 664 apache:apache from when I answered the "what
user
does your web server run under" question on a previous install/upgrade.

I just changed my web server from apache to nginx, and of course the
username
that nginx runs under is not "apache". ;)

I had caught this on the snap and rep dirs in www, but completely missed
the
critical.cfg file in etc.

So this is 100% working under nginx now, but my only concern is that I
got no
indication in any logs that the webserver (nginx) could not write to the
critical.cfg file, so that is kind of interesting.

Hopefully, sharing my embarrassment will same someone else the trouble.

:)
This is good info. I don't do manual installs -- I install it from
FreeBSD ports which handles the configuration of Xymon automatically.
And FreeBSD shares the user/group "www" between Apache and Nginx, which
avoids this problem.