Fresh install (ubuntu) permissions issues
[email protected] Sat, 09 May 2026 11:49:35 -0400
| Newsgroups | gmane.comp.sysutils.backup.backuppc.general |
|---|---|
| Message-ID | <[email protected]> |
--===============6932209858973277041==
Content-Type: multipart/alternative;
boundary=86fe6bbcc552d3cd0ed278b77c852c2e2485d7b8
--86fe6bbcc552d3cd0ed278b77c852c2e2485d7b8
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
I had started another thread about my crashed backuppc server, and am working on G.W. Haywood's excellent instructions on recovering files from the external drive.
I had to first set up a new machine. The machine that crashed was a raspberry pi (with a nvme instead of an SD card - still crashed), so I am ditching that and went with a miniPC. I installed a flavor of ubuntu.
All previous times I have installed backuppc it worked out of the box. But this 26.04 LTS package seems broken, but I am trying to fix it. First issue was CGI scripts not running (binary file downloaded).
Was getting in my apache2 log (note, my hyphens are just there to delineate the file content, not part of the content):
---
client 192.168.0.84:59892] AH01630: client denied by server configuration: /usr/share/backuppc/cgi-bin/
---
but I fixed that (after searching) by adding:
---
<Directory "/var/www/html/cgi-bin">
Options +ExecCGI
AddHandler cgi-script .cgi .pl .bin
Require all granted
</Directory>
---
to /etc/apache2/sites-available/000-default.conf
My /etc/apache2/conf-enabled/backuppc.conf file is:
---
Alias /backuppc /usr/share/backuppc/cgi-bin/
<Directory /usr/share/backuppc/cgi-bin/>
AllowOverride None
# Uncomment the line below to ensure that nobody can sniff important
# info from network traffic during editing of the BackupPC config or
# when browsing/restoring backups.
# Requires that you have your webserver set up for SSL (https) access.
#SSLRequireSSL
Options ExecCGI FollowSymlinks
AddHandler cgi-script .cgi
DirectoryIndex index.cgi
AuthUserFile /etc/backuppc/htpasswd
AuthType basic
AuthName "BackupPC admin"
<RequireAll>
# Comment out this line once you have setup HTTPS and uncommented SSLRequireSSL
# Require local
# This line ensures that only authenticated users may access your backups
Require valid-user
</RequireAll>
</Directory>
---
After restarting apache2 I got the CGI interface working and no longer had errors written to the apache2 log.
But now the CGI interface can't write config files, getting "TextFileWrite: Failed to write /etc/backuppc/localhost.pl.new" when I try to save changes
I looked at the permissions in /etc/backuppc and saw:
---
/etc/backuppc$ ls -la
total 212
drwxr-xr-x 2 backuppc www-data 4096 May 8 10:54 .
drwxr-xr-x 141 root root 12288 May 8 11:30 ..
-rw-r----- 1 backuppc backuppc 0 May 9 10:03 LOCK
-rw-r--r-- 1 backuppc www-data 835 May 8 12:00 apache.conf
-rw-r--r-- 1 backuppc www-data 88554 Feb 2 15:19 config.pl
-rw-r--r-- 1 backuppc www-data 88392 Feb 2 15:19 config.pl.sample
-rw-r--r-- 1 backuppc www-data 2243 Feb 2 15:19 hosts
-rw-r--r-- 1 backuppc www-data 2243 Feb 2 15:19 hosts.sample
-rw-r----- 1 backuppc www-data 47 May 8 10:54 htpasswd
-rw-r--r-- 1 backuppc www-data 427 Feb 2 15:19 localhost.pl
lrwxrwxrwx 1 root root 13 May 8 10:54 pc -> /etc/backuppc
---
I saw the apache user group (www-data) didn't have write access so I added group write access to the directory and some files:
---
/etc/backuppc$ ls -la
total 212
drwxrwxr-x 2 backuppc www-data 4096 May 8 10:54 .
drwxr-xr-x 141 root root 12288 May 8 11:30 ..
-rw-r----- 1 backuppc backuppc 0 May 9 10:03 LOCK
-rw-r--r-- 1 backuppc www-data 835 May 8 12:00 apache.conf
-rw-rw-r-- 1 backuppc www-data 88554 Feb 2 15:19 config.pl
-rw-r--r-- 1 backuppc www-data 88392 Feb 2 15:19 config.pl.sample
-rw-rw-r-- 1 backuppc www-data 2243 Feb 2 15:19 hosts
-rw-r--r-- 1 backuppc www-data 2243 Feb 2 15:19 hosts.sample
-rw-r----- 1 backuppc www-data 47 May 8 10:54 htpasswd
-rw-rw-r-- 1 backuppc www-data 427 Feb 2 15:19 localhost.pl
lrwxrwxrwx 1 root root 13 May 8 10:54 pc -> /etc/backuppc
---
But still isn't working.
Apache is running as www-data (user and group):
---
$ apachectl -S
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
VirtualHost configuration:
*:80 127.0.1.1 (/etc/apache2/sites-enabled/000-default.conf:1)
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex default: dir="/run/apache2/" mechanism=default
Mutex watchdog-callback: using_defaults
PidFile: "/run/apache2/apache2.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
Define: ENABLE_USR_LIB_CGI_BIN
User: name="www-data" id=33 not_used
Group: name="www-data" id=33 not_used
---
Any suggestions? Maybe whatever I did to get the CGI interface working wasn't enough to get it working with the correct permissions?
--86fe6bbcc552d3cd0ed278b77c852c2e2485d7b8
Content-Type: text/html
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE html><html><head><title></title></head><body><div style=3D"fon=
t-family:Verdana;">I had started another thread about my crashed backupp=
c server, and am working on G.W. Haywood's excellent instructions on rec=
overing files from the external drive.</div><div type=3D"cite" id=3D"qt"=
style=3D""><div style=3D"font-family:Verdana;"><br></div><div style=3D"=
font-family:Verdana;">I had to first set up a new machine. The mac=
hine that crashed was a raspberry pi (with a nvme instead of an SD card =
- still crashed), so I am ditching that and went with a miniPC. I instal=
led a flavor of ubuntu.</div><div style=3D"font-family:Verdana;"><br></d=
iv><div style=3D"font-family:Verdana;">All previous times I have install=
ed backuppc it worked out of the box. But this 26.04 LTS package s=
eems broken, but I am trying to fix it. First issue was CGI script=
s not running (binary file downloaded).</div><div style=3D"font-family:V=
erdana;"><br></div><div style=3D"font-family:Verdana;">Was getting in my=
apache2 log (note, my hyphens are just there to delineate the file cont=
ent, not part of the content):</div><div style=3D"font-family:Verdana;">=
<br></div><div style=3D"font-family:Verdana;">---</div><div style=3D"fon=
t-family:Verdana;">client 192.168.0.84:59892] AH01630: client denied by =
server configuration: /usr/share/backuppc/cgi-bin/</div><div style=3D"fo=
nt-family:Verdana;">---</div><div style=3D"font-family:Verdana;"><br></d=
iv><div style=3D"font-family:Verdana;">but I fixed that (after searching=
) by adding:</div><div style=3D"font-family:Verdana;"><br></div><div sty=
le=3D"font-family:Verdana;">---</div><div style=3D"font-family:Verdana;"=
><Directory "/var/www/html/cgi-bin"></div><div style=3D"font-famil=
y:Verdana;"> Options +ExecCGI</div><div style=3D"font-=
family:Verdana;"> AddHandler cgi-script .cgi .pl .bin<=
/div><div style=3D"font-family:Verdana;"> Require all =
granted</div><div style=3D"font-family:Verdana;"></Directory></div=
><div style=3D"font-family:Verdana;">---</div><div style=3D"font-family:=
Verdana;"><br></div><div style=3D"font-family:Verdana;">to /etc/apache2/=
sites-available/000-default.conf</div><div style=3D"font-family:Verdana;=
"><br></div><div style=3D"font-family:Verdana;">My /etc/apache2/conf-ena=
bled/backuppc.conf file is:</div><div style=3D"font-family:Verdana;"><br=
></div><div style=3D"font-family:Verdana;">---</div><div style=3D"font-f=
amily:Verdana;">Alias /backuppc /usr/share/backuppc/cgi-bin/</div><div s=
tyle=3D"font-family:Verdana;"><br></div><div style=3D"font-family:Verdan=
a;"><Directory /usr/share/backuppc/cgi-bin/></div><div style=3D"fo=
nt-family:Verdana;"> AllowOver=
ride None</div><div style=3D"font-family:Verdana;"><br></div><div style=3D=
"font-family:Verdana;"> # Unco=
mment the line below to ensure that nobody can sniff important</div><div=
style=3D"font-family:Verdana;"> &nbs=
p; # info from network traffic during editing of the BackupPC config or<=
/div><div style=3D"font-family:Verdana;"> &=
nbsp; # when browsing/restoring backups.</div><div style=3D"font-f=
amily:Verdana;"> # Requires th=
at you have your webserver set up for SSL (https) access.</div><div styl=
e=3D"font-family:Verdana;"> #S=
SLRequireSSL</div><div style=3D"font-family:Verdana;"><br></div><div sty=
le=3D"font-family:Verdana;"> O=
ptions ExecCGI FollowSymlinks</div><div style=3D"font-family:Verdana;">&=
nbsp; AddHandler cgi-script .cgi</di=
v><div style=3D"font-family:Verdana;"> &nbs=
p; DirectoryIndex index.cgi</div><div style=3D"font-family:Verdana=
;"><br></div><div style=3D"font-family:Verdana;">  =
; AuthUserFile /etc/backuppc/htpasswd</div><div style=3D=
"font-family:Verdana;"> AuthTy=
pe basic</div><div style=3D"font-family:Verdana;"> &nbs=
p; AuthName "BackupPC admin"</div><div style=3D"font-f=
amily:Verdana;"><br></div><div style=3D"font-family:Verdana;"> &nbs=
p; <RequireAll></div><div style=3D"f=
ont-family:Verdana;"> &nb=
sp; # Comment out this line once you=
have setup HTTPS and uncommented SSLRequireSSL</div><div style=3D"font-=
family:Verdana;"> &=
nbsp; # Require local</div><div style=3D"f=
ont-family:Verdana;"><br></div><div style=3D"font-family:Verdana;"> =
;  =
; # This line ensures that only authenticated users may acce=
ss your backups</div><div style=3D"font-family:Verdana;"> &nb=
sp; &nb=
sp; Require valid-user</div><div style=3D"font-family:Verdana;"> &n=
bsp; </RequireAll></div><div style=3D=
"font-family:Verdana;"></Directory></div><div style=3D"font-family=
:Verdana;">---</div><div style=3D"font-family:Verdana;"><br></div><div s=
tyle=3D"font-family:Verdana;">After restarting apache2 I got the CGI int=
erface working and no longer had errors written to the apache2 log.</div=
><div style=3D"font-family:Verdana;"><br></div><div style=3D"font-family=
:Verdana;">But now the CGI interface can't write config files, getting "=
TextFileWrite: Failed to write /etc/backuppc/localhost.pl.new" when I tr=
y to save changes</div><div style=3D"font-family:Verdana;"><br></div><di=
v style=3D"font-family:Verdana;">I looked at the permissions in /etc/bac=
kuppc and saw:</div><div style=3D"font-family:Verdana;"><br></div><div s=
tyle=3D"font-family:Verdana;">---</div><div style=3D"font-family:Verdana=
;">/etc/backuppc$ ls -la</div><div style=3D"font-family:Verdana;">total =
212</div><div style=3D"font-family:Verdana;">drwxr-xr-x 2 ba=
ckuppc www-data 4096 May 8 10:54 .</div><div style=3D"font-f=
amily:Verdana;">drwxr-xr-x 141 root root &n=
bsp; 12288 May 8 11:30 ..</div><div style=3D"font-fami=
ly:Verdana;">-rw-r----- 1 backuppc backuppc  =
; 0 May 9 10:03 LOCK</div><div style=3D"font-family:Verdana;=
">-rw-r--r-- 1 backuppc www-data 835 May 8=
12:00 apache.conf</div><div style=3D"font-family:Verdana;">-rw-r--r--&n=
bsp; 1 backuppc www-data 88554 Feb 2 15:19 config.pl</div><d=
iv style=3D"font-family:Verdana;">-rw-r--r-- 1 backuppc www-=
data 88392 Feb 2 15:19 config.pl.sample</div><div style=3D"font-fa=
mily:Verdana;">-rw-r--r-- 1 backuppc www-data 2243 Feb=
2 15:19 hosts</div><div style=3D"font-family:Verdana;">-rw-r--r--=
1 backuppc www-data 2243 Feb 2 15:19 hosts.samp=
le</div><div style=3D"font-family:Verdana;">-rw-r----- 1 bac=
kuppc www-data 47 May 8 10:54 htpasswd</div><div=
style=3D"font-family:Verdana;">-rw-r--r-- 1 backuppc www-da=
ta 427 Feb 2 15:19 localhost.pl</div><div style=3D"fon=
t-family:Verdana;">lrwxrwxrwx 1 root =
root 13 May 8 10:54 pc =
-> /etc/backuppc</div><div style=3D"font-family:Verdana;">---</div><d=
iv style=3D"font-family:Verdana;"><br></div><div style=3D"font-family:Ve=
rdana;">I saw the apache user group (www-data) didn't have write access =
so I added group write access to the directory and some files:</div><div=
style=3D"font-family:Verdana;"><br></div><div style=3D"font-family:Verd=
ana;">---</div><div style=3D"font-family:Verdana;">/etc/backuppc$ ls -la=
</div><div style=3D"font-family:Verdana;">total 212</div><div style=3D"f=
ont-family:Verdana;">drwxrwxr-x 2 backuppc www-data 40=
96 May 8 10:54 .</div><div style=3D"font-family:Verdana;">drwxr-xr=
-x 141 root root 12288 M=
ay 8 11:30 ..</div><div style=3D"font-family:Verdana;">-rw-r-----&=
nbsp; 1 backuppc backuppc 0 May 9 10=
:03 LOCK</div><div style=3D"font-family:Verdana;">-rw-r--r-- =
1 backuppc www-data 835 May 8 12:00 apache.conf</div>=
<div style=3D"font-family:Verdana;">-rw-rw-r-- 1 backuppc ww=
w-data 88554 Feb 2 15:19 config.pl</div><div style=3D"font-family:=
Verdana;">-rw-r--r-- 1 backuppc www-data 88392 Feb 2 1=
5:19 config.pl.sample</div><div style=3D"font-family:Verdana;">-rw-rw-r-=
- 1 backuppc www-data 2243 Feb 2 15:19 hosts</di=
v><div style=3D"font-family:Verdana;">-rw-r--r-- 1 backuppc =
www-data 2243 Feb 2 15:19 hosts.sample</div><div style=3D"fo=
nt-family:Verdana;">-rw-r----- 1 backuppc www-data &nbs=
p; 47 May 8 10:54 htpasswd</div><div style=3D"font-family:Ve=
rdana;">-rw-rw-r-- 1 backuppc www-data 427 Feb&n=
bsp; 2 15:19 localhost.pl</div><div style=3D"font-family:Verdana;">lrwxr=
wxrwx 1 root root &=
nbsp; 13 May 8 10:54 pc -> /etc/backuppc</div=
><div style=3D"font-family:Verdana;">---</div><div style=3D"font-family:=
Verdana;"><br></div><div style=3D"font-family:Verdana;">But still isn't =
working.</div><div style=3D"font-family:Verdana;"><br></div><div style=3D=
"font-family:Verdana;">Apache is running as www-data (user and group):</=
div><div style=3D"font-family:Verdana;"><br></div><div style=3D"font-fam=
ily:Verdana;">---</div><div style=3D"font-family:Verdana;">$ apachectl -=
S</div><div style=3D"font-family:Verdana;">AH00558: apache2: Could not r=
eliably determine the server's fully qualified domain name, using 127.0.=
1.1. Set the 'ServerName' directive globally to suppress this message</d=
iv><div style=3D"font-family:Verdana;">VirtualHost configuration:</div><=
div style=3D"font-family:Verdana;">*:80 &nb=
sp; &nb=
sp; 127.0.1.1 (/etc/apache2/sites-enabled/000-default.conf:1)</div><div =
style=3D"font-family:Verdana;">ServerRoot: "/etc/apache2"</div><div styl=
e=3D"font-family:Verdana;">Main DocumentRoot: "/var/www/html"</div><div =
style=3D"font-family:Verdana;">Main ErrorLog: "/var/log/apache2/error.lo=
g"</div><div style=3D"font-family:Verdana;">Mutex default: dir=3D"/run/a=
pache2/" mechanism=3Ddefault</div><div style=3D"font-family:Verdana;">Mu=
tex watchdog-callback: using_defaults</div><div style=3D"font-family:Ver=
dana;">PidFile: "/run/apache2/apache2.pid"</div><div style=3D"font-famil=
y:Verdana;">Define: DUMP_VHOSTS</div><div style=3D"font-family:Verdana;"=
>Define: DUMP_RUN_CFG</div><div style=3D"font-family:Verdana;">Define: E=
NABLE_USR_LIB_CGI_BIN</div><div style=3D"font-family:Verdana;">User: nam=
e=3D"www-data" id=3D33 not_used</div><div style=3D"font-family:Verdana;"=
>Group: name=3D"www-data" id=3D33 not_used</div><div style=3D"font-famil=
y:Verdana;">---</div><div style=3D"font-family:Verdana;"><br></div><div =
style=3D"font-family:Verdana;">Any suggestions? Maybe whatever I d=
id to get the CGI interface working wasn't enough to get it working with=
the correct permissions?</div><div style=3D"font-family:Verdana;"><br><=
/div><div style=3D"font-family:Verdana;"><br></div></div><div style=3D"f=
ont-family:Verdana;"><br></div></body></html>
--86fe6bbcc552d3cd0ed278b77c852c2e2485d7b8--
--===============6932209858973277041==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
--===============6932209858973277041==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
BackupPC-users mailing list
[email protected]
List: https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki: https://github.com/backuppc/backuppc/wiki
Project: https://backuppc.github.io/backuppc/
--===============6932209858973277041==--