Friday, July 26, 2013

AWS: how to install svn server on AWS

I signed up for an EC2 free tier tonight intending to use it as a Subversion server. The whole process took a couple of hours to setup, but can be compressed down to just a few minutes. If anybody else is looking to do the same, here is what I did:

1) Create the Linux-flavored micro instance.

2) Give it a Security Group that opens port 3690 to the sources of your choice. The following example allows SVN access from all Internet sources:

| tcp | 3690 | 3690 | 0.0.0.0/0
| udp | 3690 | 3690 | 0.0.0.0/0

3) SSH into the micro instance and run the command "sudo yum install subversion".

4) Create the directory to be used for subversion, for example "/home/ec2-user/svn".

5) Enter "svnadmin create /home/ec2-user/svn" (or whichever path you specified).

6) Edit two files: svnserve.conf and passwd both found in the "conf" directory of your newly created repository source.

In svnserve.conf, unremark the lines for "anon-access" (but change from "read" to "none") and "auth-access". Additionally, unremark the "password-db = passwd" line, but don't change it, and unremark the "realm =" line, providing a realm name of your choice.

In the passwd file, simply add a line entry with the user name(s) and password(s) to be used for access.

7) Finally, run "svnserve -d -r /home/ec2-user/svn" (or again, whichever path you specified) to kick off the instance.

Your Subversion server should now be available at the URL: svn://<yourinstancehostorip>/

Keep in mind the security for this quick and dirty setup is very minimal, and the daemon has not been configured for automatic startup at this point.

0 comments:

Post a Comment