|Version 2 (modified by 16 months ago) ( diff ),|
How to quickly get started with Trac on a new machine
This will set up a Trac system at localhost/trac/foo and a SVN repository at localhost/svn/foo with a test user named bar. You can change foo and bar to the names of your choosing, or create additional repositories and trac sites in parallel directories in the same manner.
- Get the .iso file for MX Linux. You can find it at DistroWatch. Many other distros would work but this was chosen because it's currently the top listed there, and because Mint had problems installing python modules.
- Get Virtualbox. You can get it at https://virtualbox.org for free and install it and create a new virtual machine with it and install the .iso file. You now have a fresh operating system installation on the new virtual machine.
- Issue the following commands (you probably don't need all of these packages. Someone with time to eliminate the unnecessary ones and test please do so and shorten the list. This has not been tested since being generified)
sudo apt update -y sudo apt full-upgrade -y, sudo apt-get -y install g++ trac default-jdk figlet apache2 subversion gufw libapache2-mod-python libapache2-mod-svn apache2-utils python-subversion libsvn-java openssh-server dconf-editor glogg tree traceroute curl apparmor apparmor-utils libapache2-mod-svn python-setuptools python-jinja2 python3-pip jq python-configparser python-tk certbot python3-certbot-apache sudo apt autoremove -y sudo mkdir -m 2660 /srv/auth /var/www/svn /var/www/trac sudo svnadmin create /var/www/svn/foo sudo trac-admin /var/www/trac/foo initenv sudo chmod -R g+rw /var/www/trac/ sudo chmod +x svn trac sudo trac-admin /var/www/trac/foo config set components "tracopt.versioncontrol.svn.*" enabled sudo trac-admin /var/www/trac/foo config set trac permission_policies AuthzSourcePolicy,ReadonlyWikiPolicy,DefaultPermissionPolicy,LegacyAttachmentPolicy sudo trac-admin /var/www/trac/foo config set trac authz_file /srv/auth/authz sudo trac-admin /var/www/trac/foo config set trac repository_dir /var/svn/foo sudo trac-admin /var/www/trac/shared permission add bar sudo reboot
- If you're running an actual system rather than a test site, you will want get a certificate for your domain name if you don't already have one. Then issue this command
Enter your email, confirm, choose to redirect to https
As a result, you will visit the site at https:// with the domain name that you own instead of http:
- Create file files using the (sudo featherpad commmand)
<Location /svn> AuthName "Auth" SVNParentPath /var/www/svn SVNListParentPath on AuthUserFile /srv/auth/htpasswd AuthzSVNAccessFile /srv/auth/authz DAV svn AuthType Basic Require valid-user </Location> <Location /trac> SetHandler mod_python PythonHandler trac.web.modpython_frontend PythonOption TracUriRoot /trac PythonOption TracEnvParentDir /var/www/trac </Location> <Location /trac/foo/login> AuthType Basic AuthName "trac" AuthUserFile /srv/auth/htpasswd Require valid-user </Location>
[/] * = r bar = rw
- Issue these commands
sudo chown www-data:www-data -R /var/www/* sudo htpasswd -c /var/www/auth/htpasswd bar sudo a2ensite trac.conf sudo apache2ctl restart
- Browse the website at http://localhost/trac for the trac site, and https://localhost/svn for the svn site.
(Someone can add here an example of checking in some documents and browsing them, creating a trac ticket, etc. for first time users to follow, and change the script to create the files above using heredoc so the user only needs to paste a script and run it on a fresh install.)