Koozali.org: home of the SME Server

Contribs.org Forums => Koozali SME Server 10.x Contribs => Topic started by: waldviertler on September 16, 2022, 06:10:31 PM

Title: Accessing Nut-cgi scripts locally with the browser
Post by: waldviertler 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 (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/ (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 (https://forums.koozali.org/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



Title: Re: Accessing Nut-cgi scripts locally with the browser
Post by: Jean-Philippe Pialasse 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 ?
Title: Re: Accessing Nut-cgi scripts locally with the browser
Post by: waldviertler 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.



Title: Re: Accessing Nut-cgi scripts locally with the browser
Post by: ReetP 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.
Title: Re: Accessing Nut-cgi scripts locally with the browser
Post by: Jean-Philippe Pialasse on September 17, 2022, 08:48:06 PM
The idea was there, but not at the required place.

see new version

Title: Re: Accessing Nut-cgi scripts locally with the browser
Post by: waldviertler on September 18, 2022, 11:04:17 AM
Thank you very much!!
Title: Re: Accessing Nut-cgi scripts locally with the browser
Post by: ReetP on September 18, 2022, 11:40:23 AM
Thank you very much!!

Please post your solution for others.

Thanks.
Title: Re: Accessing Nut-cgi scripts locally with the browser
Post by: Jean-Philippe Pialasse 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 ;).