<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>phpDevelopment &#124; Blog &#187; Linux Tutorials</title>
	<atom:link href="http://phpdev.ro/category/linux-tutorials/feed" rel="self" type="application/rss+xml" />
	<link>http://phpdev.ro</link>
	<description>Bringing you the best of the webdevelopement ecosphere</description>
	<lastBuildDate>Thu, 22 Jul 2010 14:06:04 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>[HOW TO] Setup a SVN server and use Zend Studio with it</title>
		<link>http://phpdev.ro/how-to-setup-a-svn-server-and-use-zend-studio-with-it.html</link>
		<comments>http://phpdev.ro/how-to-setup-a-svn-server-and-use-zend-studio-with-it.html#comments</comments>
		<pubDate>Sun, 03 Jan 2010 14:49:34 +0000</pubDate>
		<dc:creator>Andrei Gabreanu</dc:creator>
				<category><![CDATA[Linux Tutorials]]></category>

		<guid isPermaLink="false">http://phpdev.ro/?p=835</guid>
		<description><![CDATA[What is our goal
Subversion is the best open source version control system available so far. Our goal is to have a working SVN server on a Linux CentOS 5.3 alongside using it from a Zend Studio for Eclipse. The tutorial will guide you through the steps of installing SVN on your server via the root [...]]]></description>
			<content:encoded><![CDATA[<h2>What is our goal</h2>
<p><strong><a href="http://en.wikipedia.org/wiki/Subversion_%28software%29" target="_blank">Subversion</a></strong> is the best open source version control system available so far. Our goal is to have a working SVN server on a <strong>Linux CentOS 5.3</strong> alongside using it from a <strong>Zend Studio for Eclipse</strong>. The tutorial will guide you through the steps of <strong>installing SVN on your server</strong> via the root account, <strong>configure it to be public available</strong> or under password protection, <strong>configure a client</strong> to use the server but also <strong>avoid security holes like <a href="http://www.smashingmagazine.com/2009/09/25/svn-strikes-back-a-serious-vulnerability-found/" target="_blank">this one</a></strong>.</p>
<h2>Installation</h2>
<pre>
[root@server1 ~]# yum install mod_dav_svn subversion
</pre>
<p>The first thing to do is to install the svn packages. If you don&#8217;t have Apache installed already, it&#8217;ll go ahead and install it as well as a dependecy.</p>
<p>When you install from yum, there&#8217;s a longer list than the two packages above that will automatically resolve themselves. Some other things will be installed automatically. Depending on your packages, your mileage may vary. </p>
<h2>Configurating the services</h2>
<p><strong>Apache</strong></p>
<pre>
[root@server1 ~] nano /etc/httpd/conf/httpd.conf
[root@server1 ~] service httpd start
[root@server1 ~] chkconfig httpd on
</pre>
<p>You will need to ensure Apache is set up correctly first. I&#8217;m assuming this is a clean installation, so be careful if you already have Apache installed when changing stuff aroud. I&#8217;m also going to explain setting this up with basic password protection. You can easily let this out, however, if you want to allow access to the repos to the public.</p>
<p>In /etc/httpd/conf/httpd.conf make sure to at least change the ServerName directive to point out to your server (not the SVN server)</p>
<p>
<strong>SVN Apache Configuration</strong></p>
<pre>
[root@server1 ~] cd /etc/httpd/conf.d/
[root@server1 ~] nano subversion.conf

LoadModule dav_svn_module     modules/mod_dav_svn.so
LoadModule authz_svn_module   modules/mod_authz_svn.so

# Add the following lines of code to allow a basic authentication
# and point Apache to where the actual repository resides.
&lt;Location /repos&gt;
        DAV svn
        SVNPath /var/www/svn/repos
        AuthType Basic
        AuthName "Subversion repos"
        AuthUserFile /etc/svn-auth-conf
        Require valid-user
&lt;/Location&gt;
</pre>
<p>The location is what Apache will send to the URL bar. For example: http://example.com/repos will send to the SVN path that you have specified. The examples are just that, so feel free to put things where you want. Make sure you save the file when you are finished editing.</p>
<p>Next we have to actually create the password file that you specified in the previous step. Initially you&#8217;ll use the -cm arguments. This creates the file and also encrypts the password with MD5. If you need to add users make sure you simply use the -m flag, and not the -c after the initial creation.</p>
<pre>
[root@server1 ~] htpasswd -cm /etc/svn-auth-conf yourusername
New password:
Re-type new password:
Adding password for user yourusername
[root@server1 ~] htpasswd -m /etc/svn-auth-conf anotherusername
New password:
Re-type new password:
Adding password for user anotherusername
</pre>
<p><strong>Setup the repository</strong></p>
<pre>
[root@server1 ~] cd /var/www/
[root@server1 ~] mkdir svn
[root@server1 ~] cd svn
[root@server1 ~] svnadmin create repos
[root@server1 ~] chown -R apache.apache repos
[root@server1 ~] service httpd restart
</pre>
<p>Last step here is to create the actual SVN directories. </p>
<p>You can now access your repository from a web browser: http://example.com/repos. You should get a popup box asking for your username and password. Type in your credentials and you should be displayed with a Revision 0:/ page. That&#8217;s it for setting up a repo.</p>
<h2>Importing your first project from Zend Studio</h2>
<p><img src="http://phpdev.ro/wp-content/code_snippets/how-to-setup-a-svn-server-and-use-zend-studio-with-it/svn_1.jpg" /><br />
<br />
The first thing you need to do is share your project. </p>
<p><img src="http://phpdev.ro/wp-content/code_snippets/how-to-setup-a-svn-server-and-use-zend-studio-with-it/svn_2.jpg" /><br />
<br />
Select SVN from the list.</p>
<p><img src="http://phpdev.ro/wp-content/code_snippets/how-to-setup-a-svn-server-and-use-zend-studio-with-it/svn_3.jpg" /><br />
<br />
Select that you wish to create a new repository location</p>
<p><img src="http://phpdev.ro/wp-content/code_snippets/how-to-setup-a-svn-server-and-use-zend-studio-with-it/svn_4.jpg" /><br />
<br />
Enter your credentials and URL here.</p>
<p><img src="http://phpdev.ro/wp-content/code_snippets/how-to-setup-a-svn-server-and-use-zend-studio-with-it/svn_5.jpg" /><br />
<br />
Click next.</p>
<p><img src="http://phpdev.ro/wp-content/code_snippets/how-to-setup-a-svn-server-and-use-zend-studio-with-it/svn_6.jpg" /><br />
<br />
Click finish.</p>
<h2>Security issues</h2>
<p>To make sure nobody can view your .svn files (which basically contain EVERYTHING from your project), make sure you <strong>edit http.conf</strong> and add the following piece of code somewhere where it will be runned all the time</p>
<pre>
&lt;Directory ~ ".*\.svn"&gt;
	    Order allow,deny
	    Deny from all
	    Satisfy All
&lt;/Directory&gt;
</pre>
<h2>Conclusion</h2>
<p>Thats it! Now, if you make changes to your files in your project, just press CTRL + ALT + C (or Team => Commit) .<br />
When you want to retrieve the latest sources from SVN, press CTRL + ALT + U (or Team => Update) and wait for the update.</p>
<p>Enjoy you&#8217;r new SVN server!</p>
 <img src="http://phpdev.ro/wp-content/plugins/feed-statistics.php?view=1&post_id=835" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://phpdev.ro/how-to-setup-a-svn-server-and-use-zend-studio-with-it.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
