Build Ubuntu Server 9.10 64 bit All-in-One LAMP server – Linux Apache MySQL PHP Subversion Trac and Samba – Part 3

This guide is provided for users who want to test these in testing environment. Please use this guide at your own risk.

Part 3 will focus on installing Subversion/Trac and Samba

Install Subversion

aptitude install subversion

Add a group for svn access

addgroup svn

Add users to svn groups

adduser user svn

Create a svn directory and a svn repository

mkdir -p /var/lib/svn/repos
chown user:svn /var/lib/svn/repos
chmod 2775 /var/lib/svn/repos
svnadmin create /var/lib/svn/repos

* Updated – Typo in permission 2774 is fixed to 2775. There may be some permission issues. Try the following to correct them.

find /var/lib/svn -type d -exec chmod 2775 {} \;
find /var/lib/svn -type f -exec chmod 775 {} \;

Now svn is accessible via svn+ssh://192.168.1.10/var/lib/svn/repos
* It is recommended to set up a key pair ssh authentication for convenience

Install Trac

aptitude install trac libapache2-mod-python

Create a trac directory and initialize

mkdir -p /var/lib/trac
chown www-data:www-data /var/lib/trac
chmod 2775 /var/lib/trac
trac-admin /var/lib/trac initenv

* Updated – There may be some permission issues. Try the following to correct them.

find /var/lib/trac -type d -exec chmod 2775 {} \;
find /var/lib/trac -type f -exec chmod 775 {} \;

Create VirtualHost for trac

emacs /etc/apache2/sites-available/trac

Example file content
* Updated – Example is updated to use port 8000 for trac (Feb. 6 2010)

Listen 8000
<VirtualHost *:8000>
             DocumentRoot /var/lib/trac
             <Location />
                          SetHandler mod_python
                          PythonInterpreter main_interpreter
                          PythonHandler trac.web.modpython_frontend
                          PythonOption TracEnvParentDir /var/lib/trac
                          PythonOption TracEnv /var/lib/trac
                          PythonOption TracUriRoot /
                          PythonOption PYTHON_EGG_CACHE /tmp
             </Location>
</VirtualHost>

Enable site trac for Apache

a2ensite trac

Restart Apache

/etc/init.d/apache2 restart

Install Samba

aptitude install samba

* Samba will allow anyone to read/write files
Create a public share directory

mkdir -p /data/fileshare
chown nobody:sambashare /data/fileshare
chmod 2775 /data/fileshare

Add the public share section to the end of samba configuration

emacs /etc/samba/smb.conf

Example file content

...
security = share
[fileshare]
        comment = Public File Share
        path = /data/fileshare
        read only = no
        guest ok = yes
        create mask = 0664
        directory mask = 2775

Restart Samba

/etc/init.d/samba restart

Leave a Reply

Your email address will not be published. Required fields are marked *