Installing Trac with MySQL database
August 20th, 2008
1 comment
1. Follow the basic guide posted here.
2. Be sure to install python-mysqldb package.
3. Create MySQL database and user for trac.
CREATE DATABASE trac; CREATE USER trac IDENTIFIED BY 'trac'; GRANT ALL privileges ON trac.* TO 'trac'@'%'; |
4. Run the following command:
trac-admin <Your project dir> initenv |
5. When asked for the MySQL connection url enter something like the following:
#form: db-type://username:password@mysql-host:mysql-port/databasename mysql://trac:trac@localhost:3306/trac |
6. Configuring Apache2 (Make sure you have mod_python)
<Location /trac/test> SetHandler mod_python PythonInterpreter main_interpreter PythonHandler trac.web.modpython_frontend PythonOption TracEnv /var/trac/test PythonOption TracUriRoot /trac/test </Location> <LocationMatch "/trac/[^/]+/login"> AuthType Basic AuthName "Trac" AuthUserFile /var/trac/trac.htpasswd Require valid-user </LocationMatch> |
7. Add admin login data
htpasswd -c /var/trac/trac.htpasswd admin |
8. Grant TRAC_ADMIN to admin user
trac-admin /var/trac/test permission add admin TRAC_ADMIN |