2010년 7월 17일 토요일

Install Trac 0.11.7-1 on Ubuntu 10.04 LTS Lucid Lynx

Specifications.
- Multiple project support with Apache 2 web server
- mod_python module


Referenced documents

Another Ubuntu Hardy Heron mod_python HOWTO

Trac-0.11, Ubuntu 8.04, mod_python



1. Install trac from "Applications > Ubuntu software center"


2. Create trac folder

> sudo -i
> mkdir /home/trac
> chown www-data.www-data /home/trac

3. Setup password

> htpasswd -c /home/trac/password.txt admin
> chown www-data.www-data /home/trac/password.txt

4. Configure apache2

> vi /etc/apache2/sites-available/trac

Then, edit like below

<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        ServerName trac.example.com
        DocumentRoot /home/trac
        ErrorLog /var/log/apache2/error.trac.log
        CustomLog /var/log/apache2/access.trac.log combined

        <Location /projects>
                SetHandler mod_python
                PythonInterpreter main_interpreter
                PythonHandler trac.web.modpython_frontend
                PythonOption TracEnvParentDir /home/trac
                PythonOption TracUriRoot /projects
                PythonOption PYTHON_EGG_CACHE /tmp
        </Location>

        # use the following for one authorization for all projects 
        # (names containing "-" are not detected):
        <LocationMatch "/projects/[[:alnum:]]+/login">
            AuthType Basic
            AuthName "trac"
            AuthUserFile /home/trac/password.txt
            Require valid-user
        </LocationMatch>
</VirtualHost>
 
5. Install "libapache2-mod-python" package with "System > Management > Synaptic Package Manager"
6. Install "libapache2-svn" package with "System > Management > Synaptic Package Manager"
Then reload apache2

> a2dissite default
> a2ensite trac
> /etc/init.d/apache2 reload
 
7. Create your project
 
> svnadmin create /home/trac/junkyard_reposit
> trac-admin /home/trac/junkyard initenv
Creating a new Trac environment at /home/trac/junkyard

Trac will first ask a few questions about your environment 
in order to initialize and prepare the project database.

 Please enter the name of your project.
 This name will be used in page titles and descriptions.

Project Name [My Project]> Junk Yard
 
 Please specify the connection string for the database to use.
 By default, a local SQLite database is created in the environment
 directory. It is also possible to use an already existing
 PostgreSQL database (check the Trac documentation for the exact
 connection string syntax).

Database connection string [sqlite:db/trac.db]> 
 
 Please specify the type of version control system,
 By default, it will be svn.

 If you don't want to use Trac with version control integration,
 choose the default here and don't specify a repository directory.
 in the next question.

Repository type [svn]>                            

 Please specify the absolute path to the version control
 repository, or leave it blank to use Trac without a repository.
 You can also set the repository location later.

Path to repository [/path/to/repos]> /home/trac/junkyard_reposit
 
----------------------------------------------------------------------------------------------------------------------
Change folder owner
> chown -R www-data.www-data /home/trac/*
8. Setup subversion
Edit "/etc/apache2/mods-available/dav_svn.conf"
<Location /svn>
    # Uncomment this to enable the repository,
    DAV svn

    # Set this to the path to your repository
    SVNParentPath /var/lib/svn
 </Location>

댓글 없음:

댓글 쓰기