wiki:linux/trac/Installation

Configuration, Installation, Permissions, Plugins, Plugins/manpagerenderer, Plugins/mercurial, Repository, Repository/add


Within Uberspace

Uberspace wiki

Update Genshi

Trac needs version ≥ 0.6

$ easy_install -U Genshi

Update Babel

Needed to install the SpamFilter plugin

$ easy_upgrade -U Babel

Install Trac

$ easy_install Trac

Install AccountManagerPlugin

$ easy_install https://trac-hacks.org/svn/accountmanagerplugin/tags/acct_mgr-0.4.4

Replace .../acct_mgr-0.4.4 with the newest stable version, see AccountManagerPlugin!

Install TracSpamFilter plugin

$ easy_install http://svn.edgewall.com/repos/trac/plugins/1.0/spam-filter

Install TagsPlugin

$ easy_install https://trac-hacks.org/svn/tagsplugin/tags/0.8

Replace .../tags/0.8 with the newest stable version, see TagsPlugin!

Create an environment

Initiate it

Note: [PATH_TO_ENVIRONMENT] includes the trac database, configuration and so on. It's not the url-path which will declared with the deploy parameter, see below...

$ trac-admin [PATH_TO_ENVIRONMENT] initenv

Use sendmail for sending mails

Edit [PATH_TO_ENVIRONMENT]/conf/trac.ini and change these settings:

[notification]
email_sender = SendmailEmailSender
sendmail_path = /usr/sbin/sendmail
smtp_enabled = true
smtp_from = [NAME]@[DOMAIN]
smtp_from_name = [YOUR_NAME]
smtp_password = [MAIL_ACCOUNT_PASSWORD]
smtp_port = 587
smtp_replyto = [NAME]@DOMAIN]
smtp_server = [SUB].uberspace.de
smtp_user = [MAIL_ACCOUNT_NAME]

Cause the file includes the password for your mail account:

$ chmod 0600 [PATH_TO_ENVIRONMENT]/conf/trac.ini

Attach the new environment with the webserver

Note: The install path ~/html/[URL_TO_ENVIRONMENT]/ in this example is the url-path over which the trac environment is reachable.

$ trac-admin [PATH_TO_ENVIRONMENT] deploy [PATH_TO_ENVIRONMENT]/deploy
$ mkdir -pm 0755 ~/html/[URL_TO_ENVIRONMENT]
$ install [PATH_TO_ENVIRONMENT]/deploy/cgi-bin/trac.fcgi ~/html/[URL_TO_ENVIRONMENT]/[NAME].fcgi
$ dos2unix ~/html/[URL_TO_ENVIRONMENT]/[NAME].fcgi

Create a ~/html/[URL_TO_ENVIRONMENT]/.htaccess with this content:

Options +ExecCGI
AddHandler fcgid-script .fcgi
# if your host is using ``mod_fastcgi`` instead of ``mod_fcgid``:
#AddHandler fastcgi-script .fcgi

RewriteEngine On
RewriteBase /[PATH_TO_ENVIRONMENT]
RewriteRule ^$ [NAME].fcgi  [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) [NAME].fcgi/$1  [QSA,L]

From now on the trac environment is callable via http://mutetella.org/[URL_TO_ENVIRONMENT]

Create a first user as admin

Use AccountManagerPlugin instead of trac's default

Edit [PATH_TO_ENVIRONMENT]/conf/trac.ini and add these lines:

[components]
trac.web.auth.loginmodule = disabled
acct_mgr.admin.* = enabled
acct_mgr.api.* = enabled
acct_mgr.db.sessionstore = disabled
acct_mgr.htfile.htdigeststore = enabled
acct_mgr.htfile.htpasswdstore = disabled
acct_mgr.http.* = disabled
acct_mgr.notification.* = enabled
acct_mgr.pwhash.* = enabled
acct_mgr.register.* = enabled
acct_mgr.svnserve.svnservepasswordstore = disabled
acct_mgr.web_ui.* = enabled
acct_mgr.web_ui.resetpwstore = disabled

[account-manager]
account_changes_notify_addresses = [NAME_OF_MAILADRESS]
htdigest_file = [PATH_TO_PASSWWORDFILE]/.htdigest
htdigest_realm = TracDigestRealm
notify_actions = new,change,delete
password_store = HtDigestStore
register_check = BasicCheck, EmailCheck, BotTrapCheck, UsernamePermCheck, RegistrationFilterAdapter
reset_password = True
verify_email = True

Create user and password file

Note: If you use another htdigest_realm Name as the default TracDigestRealm use it instead!

$ trac-admin [PATH_TO_ENVIRONMENT]/ permission add [USER] TRAC_ADMIN
$ htdigest -c [PATH_TO_PASSWORDFILE]/.htdigest TracDigestRealm [USER]
$ chmod 0600 [PATH_TO_PASSWORDFILE]/.htdigest

Setup TracSpamFilter plugin

Add this line to [PATH_TO_ENVIRONMENT]/conf/trac.ini:

[components]
...
tracspamfilter.* = enabled

The TracSpamFilter plugin needs an upgrade of your Trac environment to work:

$ trac-admin [PATH_TO_ENVIRONMENT] upgrade

The settings can be done within the Spam Filtering section in your Trac's admin area. Once done you can copy & paste the [spam-filter] section within your trac.ini to these environments which should use the same settings.

That's it! The new trac enviroment is now visible at [DOMAIN]/[URL_TO_ENVIRONMENT]

Last modified 3 years ago Last modified on Feb 5, 2016, 3:14:43 PM