<rdf:RDF
    xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
    xmlns:s='http://snipsnap.org/rdf/snip-schema#'
    xml:base='http://bliki.rimuhosting.com/rdf'>
    <s:Snip rdf:about='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/miscapplications/svn+notes'
         s:cUser='retep'
         s:oUser=''
         s:mUser='john'>
        <s:name>knowledgebase/linux/miscapplications/svn notes</s:name>
        <s:content>1 BDB Errors?&#xD;&#xA;&#xD;&#xA;Getting errors like this:&#xD;&#xA;{code:node}&#xD;&#xA;[root@example ~]# svnadmin create  foo&#xD;&#xA;svn: Berkeley DB error while creating environment for filesystem foo/db:&#xD;&#xA;Function not implemented&#xD;&#xA;svn: bdb: unable to initialize mutex: Function not implemented&#xD;&#xA;svn: bdb: foo/db/__db.001: unable to initialize environment lock: Function not implemented&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;Then you may be on a server with TLS/NTPL disabled/unavailable (e.g. no /lib/tls directory).  This is typically the case on a UML VPS, and sometimes on Xen VPS (which can run TLS, but with a performance penalty).&#xD;&#xA;&#xD;&#xA;The solution is to specify a non-berkleydb storage type for the repository.  This is available in newer version of subversion (e.g. 1.1?)&#xD;&#xA;&#xD;&#xA;{code:none}&#xD;&#xA;svnadmin create --fs-type fsfs foo # other --fs-type option is bdb&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;1 Repository Location&#xD;&#xA;&#xD;&#xA;When you go to use Subversion, you&apos;ll have to choose a URL that your repository will be accessible under.  You have a few options: ssh, location tag in apache, virtual host with apache:&#xD;&#xA;&#xD;&#xA;1.1 SVN+SSH&#xD;&#xA;&#xD;&#xA;This method of access requires the users to be able to access the system shell. The authentication will be done against PAM, usually to the /etc/shadow password database.&#xD;&#xA;&#xD;&#xA;Choose a location to store your svn repositories. /var/svn is a recommended place:&#xD;&#xA;&#xD;&#xA;{code:none}&#xD;&#xA; mkdir /var/svn ; cd /var/svn&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;Create the new repository:&#xD;&#xA;&#xD;&#xA;{code:none}&#xD;&#xA; svnadmin create --fs-type fsfs repos&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;A few permissions must be set in that directory so your shell users are able to use this repository. Run the following commands to do that:&#xD;&#xA;&#xD;&#xA;{code:none}&#xD;&#xA;groupadd svn&#xD;&#xA; chgrp svn repos/ -R&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;And in order to preserve permissions:&#xD;&#xA;{code:none}&#xD;&#xA; chmod g+sw repos -R&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;In order to let your users access the repository, they must be added to the group svn. So try this:&#xD;&#xA;&#xD;&#xA;- Creating a new user:&#xD;&#xA;{code:none}&#xD;&#xA;useradd rimutest&#xD;&#xA;usermod -G svn rimutest&#xD;&#xA;# passwd rimutest&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;- Verifying it works, from a remote client&#xD;&#xA;&#xD;&#xA;{code:none}&#xD;&#xA;root@staff:~# svn co --username=rimutest svn+ssh://&lt;your address&gt;/var/svn/repos&#xD;&#xA;OR TRY&#xD;&#xA;svn co svn+ssh://rimutest@YOUR_IP/var/svn/repos&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;Another useful command is &apos;svnlook info /path/to/repo&apos;&#xD;&#xA;&#xD;&#xA;1.1 SVN over HTTP with Apache&#xD;&#xA;&#xD;&#xA;By using the HTTP method, you&apos;ll be able to use a separate authentication database, usually an htpasswd file, instead of using local (shell) user authentication.&#xD;&#xA;&#xD;&#xA;No matter whether you&apos;ll use &lt;Location&gt; or &lt;VirtualHost&gt; for configuring http access to the svn rep, first you have install the required packages:&#xD;&#xA;&#xD;&#xA;For Red Hat-based distros, including Fedora:&#xD;&#xA;{code:none}&#xD;&#xA;apt-get install mod_dav_svn subversion&#xD;&#xA;/etc/init.d/httpd restart&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;For Debian-based distros, including Ubuntu:&#xD;&#xA;&#xD;&#xA;{code:none}&#xD;&#xA;apt-get install libapache2-svn&#xD;&#xA;a2enmod dav_svn&#xD;&#xA;/etc/init.d/apache2 restart&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;Then configure access from apache to your repositories:&#xD;&#xA;&#xD;&#xA;{code:none}&#xD;&#xA;mkdir /var/svn&#xD;&#xA;chown apache /var/svn -R&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;For Debian-based distros, set &quot;www-data&quot; as the user instead of &quot;apache&quot;.&#xD;&#xA;&#xD;&#xA;Create the repository:&#xD;&#xA;&#xD;&#xA;{code:none}&#xD;&#xA;cd /var/svn&#xD;&#xA;svnadmin create repos&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;You must also create a HTPasswd file for using with this repository, using the htpasswd command. Be careful with the -c parameter - you should only use this option when creating a new htpasswd file.&#xD;&#xA;&#xD;&#xA;Reference: http://svnbook.red-bean.com/en/1.0/ch06s04.html&#xD;&#xA;&#xD;&#xA;{code:none}&#xD;&#xA;htpasswd -c /etc/subversion/repos.htpasswd  rimutest&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;1.1.1 Apache directory&#xD;&#xA;&#xD;&#xA;This is the simplest way to configure SVN for using with Apache. Add this to your Apache config:&#xD;&#xA;&#xD;&#xA;{code:none}&#xD;&#xA;&lt;Location /svn/repos&gt;&#xD;&#xA;DAV svn&#xD;&#xA;SVNPath /var/svn/repos&#xD;&#xA;AuthType Basic&#xD;&#xA;AuthName &quot;repos&quot;&#xD;&#xA;AuthUserFile /etc/subversion/repos.htpasswd&#xD;&#xA;Require valid-user&#xD;&#xA;#  or use this to allow anonymous read access&#xD;&#xA;#  &lt;LimitExcept GET PROPFIND OPTIONS REPORT&gt;&#xD;&#xA;#     Require valid-user&#xD;&#xA;#   &lt;/LimitExcept&gt;&#xD;&#xA;&lt;/Location&gt;&#xD;&#xA;&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;Your subversion repository will be accessible at http://&lt;your server&gt;/svn/repos. &#xD;&#xA;&#xD;&#xA;1.1.1 Apache virtual host&#xD;&#xA;&#xD;&#xA;If you&apos;re setting it up under Apache2, using a VirtualHost subdomain, your configuration might look something like this:&#xD;&#xA;&#xD;&#xA;{code:none}&#xD;&#xA;&lt;VirtualHost *:80&gt;&#xD;&#xA; ServerName svn.example.com&#xD;&#xA; DocumentRoot /var/www/someplace&#xD;&#xA;&#xD;&#xA; &lt;Location /repos/&gt;&#xD;&#xA;  DAV svn&#xD;&#xA;  SVNPath /var/svn/repos&#xD;&#xA; &lt;/Location&gt;&#xD;&#xA;&lt;/VirtualHost&gt;&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;Using this configuration, you&apos;ll be able access the repository at http://svn.example.com/repos/, and everything should work fine. But what if you don&apos;t want your repository to be at a subdirectory - what if you want it as http://svn.example.com/, as in:&#xD;&#xA;&#xD;&#xA;{code:none}&#xD;&#xA; &lt;Location /&gt;&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;This can be done, but you&apos;ll likely run into a couple of issues.&#xD;&#xA;&#xD;&#xA;Firstly, the folder that you specify as DocumentRoot (/var/www/someplace in the above example) must be accessible, even though it&apos;s never actually used. It should be completely empty - otherwise files in the directory and in the repository will clash, and you&apos;ll get a &apos;301 Moved Permanently&apos; when you check them out.&#xD;&#xA;&#xD;&#xA;Secondly, there&apos;s a bug in the standard client library that isn&apos;t scheduled to be fixed in the near future. Every now and then you&apos;ll get an out of date error when trying to commit changes, even right after updating. It&apos;s easy to fix (delete everything in the working copy&apos;s .svn/wcpropcs/), but annoying. More details are at http://subversion.tigris.org/issues/show_bug.cgi?id=1851&#xD;&#xA;&#xD;&#xA;A final thing to watch for is ErrorDocument. If you&apos;ve got a custom 404 ErrorDocument that&apos;s enabled under the repository location, you might be faced with &apos;500 Cannot load the requested SVN filesystem&apos; - solve this by reseting the ErrorDocument directive in the Location block; a working configuration is below:&#xD;&#xA;&#xD;&#xA;{code:none}&#xD;&#xA;&lt;VirtualHost *:80&gt;&#xD;&#xA; ServerName svn.example.com&#xD;&#xA; DocumentRoot /var/www/emptyfolder&#xD;&#xA;&#xD;&#xA; &lt;Location /&gt;&#xD;&#xA;  DAV svn&#xD;&#xA;  SVNPath /var/svn/repos&#xD;&#xA;  ErrorDocument 404 default&#xD;&#xA; &lt;/Location&gt;&#xD;&#xA;&lt;/VirtualHost&gt;&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;1 Install SVN Ruby bindings&#xD;&#xA;&#xD;&#xA;If you installed rails, using our rails.sh script, you&apos;ll find that Ruby is installed here: &#xD;&#xA;&#xD;&#xA;{code}&#xD;&#xA;# which ruby&#xD;&#xA;/usr/local/bin/ruby &#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;We normally install subversion per the distribution packages.&#xD;&#xA;&#xD;&#xA;{code}&#xD;&#xA;# which svn&#xD;&#xA;/usr/bin/svn&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;Both Debian and Red Hat based distros have a package for the svn ruby bindings.&#xD;&#xA;&#xD;&#xA;On Debian (Etch), you can install them with apt:&#xD;&#xA;&#xD;&#xA;{code}&#xD;&#xA;# apt-cache search subversion ruby&#xD;&#xA;libsvn-ruby - Ruby bindings \for Subversion (dummy \package)&#xD;&#xA;libsvn-ruby1.8 - Ruby bindings \for Subversion&#xD;&#xA;&#xD;&#xA;# apt-get install libsvn-ruby&#xD;&#xA;[...]&#xD;&#xA; The following NEW packages will be installed:&#xD;&#xA;  libsvn-ruby libsvn-ruby1.8 &#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;Only thing is Ruby won&apos;t find them where dpkg puts them, so you&apos;ll need to make some symlinks.  It may vary a little on different systems, and haven&apos;t tried it on ubuntu, but you&apos;ll need some links like this:&#xD;&#xA;&#xD;&#xA;{code}&#xD;&#xA;# ln -s /usr/lib/ruby/1.8/svn /usr/local/lib/ruby/site_ruby/1.8/i686-linux/svn&#xD;&#xA;# ln -s /usr/lib/ruby/1.8/i486-linux/svn/ext /usr/local/lib/ruby/site_ruby/1.8/i686-linux/svn/ext &#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;On an x86_64, they looked like this: &#xD;&#xA;&#xD;&#xA;{code}&#xD;&#xA;# ln -s /usr/lib/ruby/1.8/svn /usr/local/lib/ruby/1.8/svn&#xD;&#xA;# ln -s /usr/lib/ruby/1.8/i486-linux/svn/ext /usr/local/lib/ruby/1.8/svn/ext&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;After making these links I got a happy: &#xD;&#xA;&#xD;&#xA;{code}&#xD;&#xA;irb(main):001:0&gt; require &apos;svn/core&apos;&#xD;&#xA;=&gt; true &#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;On Fedora 6, I just installed this package with Yum: &#xD;&#xA;&#xD;&#xA;{code}&#xD;&#xA;# yum install subversion-ruby&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;And it just worked:&#xD;&#xA;&#xD;&#xA;{code}&#xD;&#xA;# ruby -e &apos;puts require(&quot;svn/core&quot;)&apos;&#xD;&#xA;true &#xD;&#xA;{code}</s:content>
        <s:mTime>2007-12-11 13:56:39.0</s:mTime>
        <s:cTime>2005-11-01 06:07:35.0</s:cTime>
        <s:comments
             rdf:type='http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag'/>
        <s:snipLinks>
            <rdf:Bag>
                <rdf:li rdf:resource='#snipsnap-search'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/miscapplications'/>
                <rdf:li rdf:resource='#knowledgebase'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/miscapplications/ruby on rails'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux'/>
                <rdf:li rdf:resource='#snipsnap-index'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/miscapplications/svn notes/Repository location'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/rimuhosting/rimuhosting ssh access'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/misc/ajax autocomplete'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/mail/postfix notes'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/misc/where has my disk space gone'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/misc/Preventing Brute Force SSH Attacks'/>
                <rdf:li rdf:resource='#alicia'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/remote server desktop with vnc'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/mail/maildrop with mysql support on debian sarge'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/mail/dovecot compile'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/miscapplications/grub'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/rimuhosting/vps setup on dedicated servers'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/miscapplications/'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/webserver/apache/installing and using mod_fastcgi'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/mail/qmail notes'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/webserver/apache'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/miscapplications/monit service monitoring'/>
                <rdf:li rdf:resource='#retep'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/webserver/proxy servers: squid'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/mail/dkfilter setup'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/rimuhosting/monthly CC billing not working'/>
                <rdf:li rdf:resource='#ghassan'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/webserver'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/java/tomcat on plesk'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/rimuhosting/vps backups'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/misc/quick and dirty memory checker'/>
            </rdf:Bag>
        </s:snipLinks>
        <s:attachments
             rdf:type='http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag'/>
    </s:Snip>
</rdf:RDF>
