This article will describe installing Trac which manages user with digest authentication.
Table of Contents
1 Install Trac
The following script will install Trac and create "test" project.
- Login to Trac via digest authentication.
- ADMIN_PASSWD is password of admin user for digest authentication.
- USER_NAME is user name of not admin user for digest authentication.
- USER_PASSWD is password name of not admin user for digest authentication.
#!/bin/sh set -e [ -z "${ADMIN_PASSWD}" ] && ADMIN_PASSWD="trac" [ -z "${USER_NAME}" ] && USER_NAME="trac" [ -z "${USER_PASSWD}" ] && USER_PASSWD="trac" trac_install() { sudo dnf install -y trac mod_wsgi mod_ssl sudo firewall-cmd --add-service=https --permanent sudo firewall-cmd --reload sudo setsebool -P httpd_unified on sudo mkdir /var/lib/trac sudo mkdir /var/www/html/trac sudo chown apache:apache /var/www/html/trac } create_project() { proj=${1} sudo trac-admin /var/lib/trac/"${proj}" initenv "${proj}" sqlite:db/trac.db sudo trac-admin /var/lib/trac/"${proj}" deploy /var/www/html/trac/"${proj}" sudo chown -R apache:apache /var/lib/trac/"${proj}" sudo chown -R apache:apache /var/www/html/trac/"${proj}" sudo chcon -R -t httpd_sys_content_t /var/lib/trac/"${proj}" yes "${ADMIN_PASSWD}" | \ sudo htdigest -c /var/lib/trac/"${proj}"/.htdigest "${proj}" admin sudo trac-admin /var/lib/trac/"${proj}" permission add admin TRAC_ADMIN yes "${USER_PASSWD}" | \ sudo htdigest /var/lib/trac/"${proj}"/.htdigest "${proj}" "${USER_NAME}" cat <<EOF | sudo tee /etc/httpd/conf.d/${proj}.conf WSGIScriptAlias /trac/${proj} /var/www/html/trac/${proj}/cgi-bin/trac.wsgi <Location /trac/${proj}> AuthType Digest AuthName "${proj}" AuthUserFile /var/lib/trac/${proj}/.htdigest Require valid-user </Location> EOF sudo systemctl restart httpd } trac_main() { trac_install create_project test create_project OtherProject } trac_main
2 Access to Trac
Access the following URL with browser. Accept this page's certification to browser.
https://<server>/trac/test
The dialog of digest authentication is displayed. Input admin to Username and ADMIN_PASSWD value to Password.
Trac page is displayed.