# $NetBSD: backuppc.conf,v 1.3 2020/10/20 22:16:16 tnn Exp $
#
# BackupPC sample configuration file fragment for Apache.
#
# Note that you have to perform some manual steps to make this work:
#
# 1) Install the setuid cgi-bin wrapper binary:
#
# gcc -o /usr/pkg/share/BackupPC/htdocs/BackupPC_Admin.cgi \
#   /usr/pkg/share/examples/BackupPC/cgiwrapper.c
# chown backuppc:www \
#   /usr/pkg/share/BackupPC/htdocs/BackupPC_Admin.cgi
# chmod 4510 /usr/pkg/share/BackupPC/htdocs/BackupPC_Admin.cgi
#
# 2) Set an admin password:
#
# htpasswd -c /usr/pkg/etc/BackupPC/htpasswd admin
# chmod 400 /usr/pkg/etc/BackupPC/htpasswd
# chown www:www /usr/pkg/etc/BackupPC/htpasswd
#
# 3) Edit /usr/pkg/etc/BackupPC/config.pl and add the
#    admin user to $Conf{CgiAdminUsers}.

<IfModule mod_alias.c>
    Alias /BackupPC "/usr/pkg/share/BackupPC/htdocs/"
</IfModule>

<Directory "/usr/pkg/share/BackupPC/htdocs">
  AddHandler cgi-script .cgi
  DirectoryIndex BackupPC_Admin.cgi
  Options ExecCGI
  AuthUserFile /usr/pkg/etc/BackupPC/htpasswd
  AuthType basic
  AuthName "BackupPC login"
  <RequireAll>
    require all granted
    require valid-user
  </RequireAll>
</Directory>
