Thursday, 2 September 2010

Ubuntu - Subversion

Hi,
This is some tutorials I got when try using Subversion:
  1. Install:
    • Subversion:
      • sudo apt-get install subversion subversion-tools
      • sudo apt-get install libapache2-svn
    • Make dir to store your svn project:
      • sudo mkdir /home/svn
    • Change permission to access svn folder
      • sudo chmod 777 -R /home/svn
    • Create new project:
      • sudo svnadmin create /home/svn/example-svn
    • Set permission for group access svn folder (! Important):
      • sudo chown -R www-data:www-data /home/svn/
      • sudo chown -R www-data:www-data /home/web/svn/
    • Add user to access svn server:
      • sudo htpasswd -c /etc/apache2/dav_svn.passwd svn-user
  2. Configs:
    • Apache:
      • Create new virtual host file:
        • sudo vim /etc/apache2/sites-available/example-your-virtualhost
      • Insert at bellow this string:
        • <VirtualHost *:8080>
              ServerName svn
              DocumentRoot /home/svn
          
              <Location /svn>
                  DAV svn
          
                  # Set this to the path to your repository
                  #SVNPath /home/svn/example-svn
                  SVNParentPath /home/svn/
                  SVNListParentPath on
          
                  AuthType Basic
                  AuthName "Subversion Repository"
                  #AuthzSVNAccessFile /etc/apache2/svn_access_control
                  #Satisfy Any
                  AuthUserFile /etc/apache2/dav_svn.passwd
                  #AuthGroupFile /etc/apache2/dav_svn.group
                  Require valid-user
          
          
                  <LimitExcept GET PROPFIND OPTIONS REPORT>
                      Require valid-user
                  </LimitExcept>
              </Location>
          </VirtualHost>
      • Make a symbolic  to enable virtualhost
        • sudo ln -s /etc/apache2/sites-available/example-your-virtualhost /etc/apache2/sites-enabled/
      • Restart Apache
        • sudo /etc/init.d/apache2 restart
      • Testing
        • http://example-svn/svn/example-svn
    • Lighttpd:
    • Nginx:
  3. Config permissions:
    • Apache:
      • Create permission file:
        • sudo vim /etc/apache2/svn_access_control
          • [groups]
            admin = shin
            guess = shin, kitty
            
            [/]
            @admin = rw
            
            
            [project-name:/]
            @guess = r
            
      • Uncomment these line from virtual host file:
        • AuthzSVNAccessFile /etc/apache2/svn_access_control
        • Satisfy Any
    • Lighttpd:
    • Nginx:
  4. Tricks:
    1. Grant execute permissison for file:
      • Add permisison:
        • svn propset svn:executable ON <list of files>
      • Remove permission
        • svn propdel svn:executable <list of files>

Good luck!

No comments:

Post a Comment