{"id":225,"date":"2013-01-07T14:05:04","date_gmt":"2013-01-07T13:05:04","guid":{"rendered":"http:\/\/oprsteny.cz\/?p=225"},"modified":"2013-04-11T21:04:01","modified_gmt":"2013-04-11T20:04:01","slug":"install-subversion-and-websvn-on-ubuntu-server","status":"publish","type":"post","link":"https:\/\/oprsteny.cz\/?p=225","title":{"rendered":"Install Subversion and WebSvn on Ubuntu Server"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"371\" data-permalink=\"https:\/\/oprsteny.cz\/?attachment_id=371\" data-orig-file=\"https:\/\/oprsteny.cz\/wp-content\/uploads\/Ubuntu.jpg\" data-orig-size=\"50,48\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"Ubuntu\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/oprsteny.cz\/wp-content\/uploads\/Ubuntu.jpg\" class=\"alignleft size-full wp-image-371\" alt=\"Ubuntu\" src=\"http:\/\/oprsteny.cz\/wp-content\/uploads\/Ubuntu.jpg\" width=\"50\" height=\"48\" \/>Version control of your documents and code should be one of your first and major TO-DOs if you intend to develop application or website and you plan to maintain it during time with possibility to view changes made during it&#8217;s life cycle.<!--more--><\/p>\n<p>The first thing to do is install\u00a0<a href=\"http:\/\/subversion.tigris.org\/\">Subversion<\/a>\u00a0and apache package for\u00a0<a href=\"http:\/\/subversion.tigris.org\/\">Subversion<\/a>. All I need to do is:<\/p>\n<pre>sudo aptitude install subversion libapache2-svn<\/pre>\n<p>In the next step I need to create a directory where my repositories will be stored. In my case \/var\/sourcecontrol\/svn\/. The default location is \/var\/lib\/svn\/.<\/p>\n<p>This command will create de directory where all my repositories will be:<\/p>\n<pre>sudo mkdir \/var\/sourcecontrol\/svn<\/pre>\n<p>After create the directory I copied my entire repository backup from windows into this directory.<\/p>\n<p>Note if I need to create new repositories I just had to do:<\/p>\n<pre>sudo svnadmin create \/var\/sourcecontrol\/svn\/newRepository<\/pre>\n<p>newRepository is the name of the new repository.<\/p>\n<p>Next I need to change the owner of the files in order to access using apache. This can be done with this command:<\/p>\n<pre>sudo chown www-data:www-data\u00a0 \/var\/sourcecontrol\/svn\/repositoryName -R<\/pre>\n<p>repositoryName is the name of the repository.<\/p>\n<p>Next I just need to configure all my repositories to be access in apache. This can be done by editing the file \/etc\/apache2\/mods-available\/dav_svn.conf<\/p>\n<p>To edit I just run the command:<\/p>\n<pre>sudo nano \/etc\/apache2\/mods-available\/dav_svn.conf<\/pre>\n<p>Scroll all the way down and add the following code for each repository:<\/p>\n<pre>&lt;Location \/repositoryName&gt;\r\n  DAV svn\r\n  SVNPath \/var\/sourcecontrol\/svn\/repositoryName\r\n  AuthType Basic\r\n  AuthName \"Subversion repository repositoryName\"\r\n&lt;\/Location&gt;<\/pre>\n<p>Next restart the apache :<\/p>\n<pre>sudo \/etc\/init.d\/apache2 restart<\/pre>\n<p>Open a browser and type\u00a0http:\/\/[serverip]\/repositoryName\u00a0and the repository is now availably in browser.<\/p>\n<p>Notice the\u00a0<strong>\/repositoryName<\/strong>\u00a0in the location is the same as\u00a0<strong>\/repositoryName<\/strong>\u00a0in the url.<\/p>\n<p>After this step you can start doing some checkin&#8217;s \ud83d\ude1b<\/p>\n<p>The next step is to install\u00a0<a href=\"http:\/\/websvn.tigris.org\/\">WebSVN<\/a>.\u00a0<a href=\"http:\/\/websvn.tigris.org\/\">WebSVN<\/a>\u00a0is a very good web interface to see all repositories.<\/p>\n<p>The first thing to do is install the package. This can be done with the command:<\/p>\n<pre>sudo aptitude install websvn<\/pre>\n<p>To have syntax highlight in the source code just install enscript . This can be done with this command:<\/p>\n<pre>sudo aptitude install enscript<\/pre>\n<p>Now a few things you should know:<\/p>\n<p>During the install of\u00a0<a href=\"http:\/\/websvn.tigris.org\/\">WebSVN<\/a>\u00a0three screens will appear:<br \/>\n1 &#8211; Select the webserver for configuration.<br \/>\n2 &#8211; Specify the path of the subversion repositories, in this case (\/var\/sourcecontrol\/svn).<br \/>\n3 &#8211; If all repositories are in the same parent folder leave this in blank otherwise you will have to specify all repositories separated by comma.<\/p>\n<p>The package\u00a0<a href=\"http:\/\/websvn.tigris.org\/\">WebSVN<\/a>\u00a0is installed into \/usr\/share\/websvn\/, it&#8217;s necessary to copy to \/var\/www\/. This can be done with the command:<\/p>\n<pre>sudo cp -r \/usr\/share\/websvn\/ \/var\/www\/<\/pre>\n<p>After copy to \/var\/www it&#8217;s necessary to edit the file \/etc\/apache2\/mods-available\/dav_svn.conf, again with the command:<\/p>\n<pre>sudo nano \/etc\/apache2\/mods-available\/dav_svn.conf<\/pre>\n<p>Next, scroll down and add the following<\/p>\n<pre>&lt;Location \/websvn\/&gt;\r\nOptions FollowSymLinks\r\norder allow,deny\r\nallow from all\r\nAuthType Basic\r\nAuthName \"Subversion Repository\"\r\n&lt;\/Location&gt;<\/pre>\n<p>Save the file and restart apache by doing:<\/p>\n<pre>sudo \/etc\/init.d\/apache2 restart<\/pre>\n<p>Now just type\u00a0http:\/\/[serverip]\/websvn\u00a0and you will see the\u00a0<a href=\"http:\/\/websvn.tigris.org\/\">WebSVN<\/a>\u00a0page and your repositories.<\/p>\n<p>If for some reason your repositories have strange names in just edit the file \/etc\/websvn\/svn_deb_conf.inc with the command :<\/p>\n<pre>sudo nano \/etc\/websvn\/svn_deb_conf.inc<\/pre>\n<p>In this file you will have something like this:<\/p>\n<pre>&lt;?php\u00a0\r\n\/\/ please edit \/etc\/websvn\/config.php\u00a0\r\n\/\/ or use dpkg-reconfigure websvn\u00a0\r\n$config-&gt;parentPath(\"\/var\/sourcecontrol\/svn\/\");\u00a0\r\n$config-&gt;addRepository(\"repositoryName\\\", file:\/\/\/var\/sourcecontrol\/svn\/repositoryName1);\u00a0\r\n$config-&gt;addRepository(\"repositoryName\", \"file:\/\/\/var\/sourcecontrol\/svn\/repositoryName2\");\u00a0\r\n$config-&gt;setEnscriptPath(\"\/usr\/bin\");\u00a0\r\n$config-&gt;setSedPath(\"\/bin\");\u00a0\r\n$config-&gt;useEnscript();\u00a0\r\n?&gt;<\/pre>\n<p>Here it&#8217;s possible specify the parent path of all repositories and specify each repository name and location. it&#8217;s here also that it&#8217;s specified the path on enscript installed before.<\/p>\n<p>Hope you enjoy the source control.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Version control of your documents and code should be one of your first and major TO-DOs if you intend to develop application or website and you plan to maintain it during time with possibility to view changes made during it&#8217;s &hellip; <a href=\"https:\/\/oprsteny.cz\/?p=225\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[9,38,5],"tags":[55,54,52,51,53],"class_list":["post-225","post","type-post","status-publish","format-standard","hentry","category-development","category-software","category-tools","tag-development-2","tag-repository","tag-subversion","tag-svn","tag-websvn"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p3nYbe-3D","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/oprsteny.cz\/index.php?rest_route=\/wp\/v2\/posts\/225","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/oprsteny.cz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/oprsteny.cz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/oprsteny.cz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/oprsteny.cz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=225"}],"version-history":[{"count":4,"href":"https:\/\/oprsteny.cz\/index.php?rest_route=\/wp\/v2\/posts\/225\/revisions"}],"predecessor-version":[{"id":372,"href":"https:\/\/oprsteny.cz\/index.php?rest_route=\/wp\/v2\/posts\/225\/revisions\/372"}],"wp:attachment":[{"href":"https:\/\/oprsteny.cz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=225"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/oprsteny.cz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=225"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/oprsteny.cz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=225"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}