Gentoo Archives: gentoo-user

From: thelma@×××××××××××.com
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] [SOLVED] Another apache 2.4 - Forbidden: You don't have permission to access this resource.
Date: Thu, 03 Dec 2020 17:07:51
Message-Id: c9566b7b-f46e-5e0b-0c92-d378297ef0bd@sys-concept.com
In Reply to: Re: [gentoo-user] Another apache 2.4 - Forbidden: You don't have permission to access this resource. by Michael
1 On 12/03/2020 03:42 AM, Michael wrote:
2 > On Thursday, 3 December 2020 04:09:15 GMT thelma@×××××××××××.com wrote:
3 >> When I try to configure sql-ledger, /localhost/sql-ledger/index.html
4 >> I get an error: Forbidden: You don't have permission to access this
5 >> resource.
6 >>
7 >> Apache starts normally but there is an entry in /var/logs/apache/error_log
8 >> (how to make it go way)
9 >>
10 >> [:notice] [pid 5015] ModSecurity for Apache/2.9.3
11 >> (http://www.modsecurity.org/) configured. [:notice] [pid 5015] ModSecurity:
12 >> APR compiled version="1.7.0"; loaded version="1.7.0" [:notice] [pid 5015]
13 >> ModSecurity: PCRE compiled version="8.44 "; loaded version="8.44
14 >> 2020-02-12" [:notice] [pid 5015] ModSecurity: LIBXML compiled
15 >> version="2.9.10" [:notice] [pid 5015] ModSecurity: Status engine is
16 >> currently disabled, enable it by set SecStatusEngine to On.
17 >> [mpm_prefork:notice] [pid 5016] AH00163: Apache/2.4.46 (Unix)
18 >> OpenSSL/1.1.1g PHP/7.4.11 configured -- resuming normal operations Wed Dec
19 >> 02 20:38:26.746392 2020] [core:notice] [pid 5016] AH00094: Command line:
20 >> '/usr/sbin/apache2 -D DEFAULT_VHOST -D INFO -D SSL -D SSL_DEFAULT_VHOST -D
21 >> LANGUAGE -D PHP -D SECURITY -d /usr/lib64/apache2 -f
22 >> /etc/apache2/httpd.conf' [authz_core:error] [pid 4900] [client ::1:46226]
23 >> AH01630: client denied by server configuration:
24 >> /usr/local/sql-ledger/index.html
25 >>
26 >>
27 >> The above error log entry has nothing to with the below configuration except
28 >> the last line: [authz_core:error] [pid 4900] [client ::1:46226] AH01630:
29 >> client denied by server configuration: /usr/local/sql-ledger/index.html
30 >>
31 >> My sql-ledger_apache.config 2.4 config
32 >>
33 >> Alias /sql-ledger /usr/local/sql-ledger/
34 >> <Directory /usr/local/sql-ledger>
35 >> AllowOverride All
36 >> AddHandler cgi-script .pl
37 >> AddDefaultCharset On
38 >> Options ExecCGI Includes FollowSymlinks
39 >> Require ip 10.0.0.109
40 >> </Directory>
41 >>
42 >> <Directory /usr/local/sql-ledger/users>
43 >> Require all denied
44 >> </Directory>
45 >>
46 >> All the configuration entries are in main server (not in .htaccess)
47 >
48 > In the first instance try adding double quotes for all paths, e.g.
49 >
50 > Alias "/sql-ledger" "/usr/local/sql-ledger/"
51 > Directory "/usr/local/sql-ledger">
52 > ...
53 >
54 > and so on. Then restart the server.
55
56 Thanks Michael, the correct setting is:
57
58 Alias /sql-ledger /usr/local/sql-ledger/
59 AddHandler cgi-script .pl
60
61 <Directory /usr/local/sql-ledger>
62 Options ExecCGI Includes FollowSymlinks
63 AllowOverride all
64 Require all granted
65 </Directory>
66
67 <Directory /usr/local/sql-ledger/users>
68 AllowOverride none
69 Require all denied
70 </Directory>
71
72 But it wasn't my only problem, the old sql-ledger-2.8.35 was not
73 compatible with the newer software; the solution was to upgrade to newer
74 sql-ledger-3.2.9 that run with current postgresql-12
75 But this version of sql-ledger-3.2.9 has a bugs.
76 The backup script doesn't work correctly. It works with one database
77 but, with another database when trying to back it up it gave an error
78 (the backup doesn't work):
79 (The backup worked correctly on sql-ledger-2.8.35)
80
81 "Wide character in print at line 2060" and CPU goes 100%
82
83 The solution (fix, courtesy of my daughter) is to make a change in the
84 file:
85 sql-ledger/SL/AM.pm
86
87 (line #2040 add after "my $fields;" line:
88 my $myString;
89
90 (line #2059 after:
91 $fields .= join ',', map { $dbh->quote($_) } @arr;
92 $fields .= ")";
93
94 ------ replace --------
95 print OUT qq|$query $fields;\n|;
96 }
97 ------ end replace ------
98
99 ---- with ----------
100 $myString = qq|$query $fields;\n|;
101 $myString =~ s/[^\x00-\x7f]//g;
102 print OUT $myString;
103 }
104 --- end with ----------
105
106 Hope, it will save somebody hours of trying to troubleshoot this error.