Koozali.org: home of the SME Server

Accessing Nut-cgi scripts locally with the browser

Offline waldviertler

  • ***
  • 107
  • +0/-0
Accessing Nut-cgi scripts locally with the browser
« on: September 16, 2022, 06:10:31 PM »
Hello!

I have a SME 10 Server running and it is connected via USB with a USV since weeks. I had since installed nut and the cgi scripts as described here:

https://wiki.koozali.org/Uninterruptable_Power_Supply

The Nut-cgi Monitor scripts also like described in the wiki (part: Configure Nut-cgi Monitor Scripts).

Everything was ok, but since a few days I get this from the browser:

http://myserverip/nut/

Code: [Select]
Forbidden
You don't have permission to access /nut/ on this server.

And in the httpd-error log on the server:

Code: [Select]
[Fri Sep 16 14:26:46.499913 2022] [authz_core:error] [pid 10386] [client 192.168.1.73:58011] AH01630: client denied by server configuration: /opt/nut-cgi-bin/
I have double checked the permissions and chown of the 3 scripts in the directory  (upsimage.cgi, upsset.cgi, upsstats.cgi)

/opt/nut-cgi-bin

chown is root/www

The database is set to:
Code: [Select]
config setprop nut PublicAccess local
And I am accessing it only locally.

However, is was ok, but now I got the error. What can that be?

Best regards
Martin




Offline Jean-Philippe Pialasse

  • *
  • 2,746
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Accessing Nut-cgi scripts locally with the browser
« Reply #1 on: September 16, 2022, 07:08:00 PM »
please see the sme 10.1 update. https://wiki.koozali.org/SME_Server:10.1#Unable_to_access_to_a_specific_folder_in_my_ibay_using_http

the syntax in the how to is no more accepted with httpd 2.4


you need to convert to Require format.

all is explained in wiki page for sme 10.1 update. 
however, this wiki how to needs updating. 
thanks for pointing it. 

would you like to update it if i give you the access ?

Offline waldviertler

  • ***
  • 107
  • +0/-0
Re: Accessing Nut-cgi scripts locally with the browser
« Reply #2 on: September 17, 2022, 10:24:35 AM »
Although I'd really like to help out with the wiki, it's probably way above my capabilities.

I have changed 3 lines in the 92nutupscmon template:

Code: [Select]
      $OUT .= "    order deny,allow\n";
      $OUT .= "    deny from all\n";
      $OUT .= "    allow from $allow\n";

to

Code: [Select]
      $OUT .= "    Require all denied\n";
      $OUT .= "    Require host $allow\n";

expanded the template:

Code: [Select]
/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf
restarted httpd:

Code: [Select]
systemctl restart httpd-e-smith.service
but still have no access : You don't have permission to access /nut/ on this server.




Offline ReetP

  • *
  • 3,722
  • +5/-0
Re: Accessing Nut-cgi scripts locally with the browser
« Reply #3 on: September 17, 2022, 02:05:02 PM »
Although I'd really like to help out with the wiki, it's probably way above my capabilities.

If you are able to fix this the wiki is a doddle in comparison.
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline Jean-Philippe Pialasse

  • *
  • 2,746
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Accessing Nut-cgi scripts locally with the browser
« Reply #4 on: September 17, 2022, 08:48:06 PM »
The idea was there, but not at the required place.

see new version


Offline waldviertler

  • ***
  • 107
  • +0/-0
Re: Accessing Nut-cgi scripts locally with the browser
« Reply #5 on: September 18, 2022, 11:04:17 AM »
Thank you very much!!

Offline ReetP

  • *
  • 3,722
  • +5/-0
Re: Accessing Nut-cgi scripts locally with the browser
« Reply #6 on: September 18, 2022, 11:40:23 AM »
Thank you very much!!

Please post your solution for others.

Thanks.
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline Jean-Philippe Pialasse

  • *
  • 2,746
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Accessing Nut-cgi scripts locally with the browser
« Reply #7 on: September 18, 2022, 04:26:22 PM »
Please post your solution for others.

Thanks.
I updated  the wiki and it seems to do it.

If not just answer ;).