Setting up an SVN server on my EC2 instance (on AWS), is a major
problem whenever we connect svn using key-file(key.pem for AWS).
Here’s my situation:
You don’t need to store your svn repos in
I had to do edit some
At my ubuntu Desktop (Client) :
Basically, you want to replicate the syntax that you would normally use for ssh-ing into your EC2 instance. In my case, this includes specifying the
So under that
And finally, let’s checkout that repo we made
Here’s my situation:
- I have a micro EC2 instance hosted with Amazon.
- I used a non-standard port for
ssh
access - I have a
pem
file provided by Amazon for access through ssh - I run Ubuntu 14.04 Server on my EC2 instance
- On the client side, I’m running Ububtu 14.04 Desktop
sudo apt-get install -y subversion
Then, on my EC2 instance, I want to create both the directory where
I’ll store repositories, and the subsequently, create the repository
itself. Permissions and ownership are of the utmost importance. This
worked for me:sudo mkdir -p /srv/svn/
sudo chown ubuntu:ubuntu /srv/svn/
svnadmin create /srv/svn/{repo_name}
Mind the {rep_name}
placeholder above
vim /svnrepos/conf/svnserve.confIn that file add these three lines:
anon-access = none auth-access = write password-db = passwdCreate a password file:
vi /svnrepos/conf/passwdIn that file add a line for your user:
# add users in the format : user = password tony = mypassword
You don’t need to store your svn repos in
/srv/svn/
. Wherever you’d like, so long as the permissions and ownership is okay. Also, ubuntu:ubuntu
is the username and group for my EC2 instance. I believe this is standard now for most AMIs, but change this if appropriate.I had to do edit some
subversion
configuration settings. Even command line wasn’t working, because first, we need to create a tunnelAt my ubuntu Desktop (Client) :
vi ~/.subversion/config
Now, under the [tunnels]
section, you want to define a rule.Basically, you want to replicate the syntax that you would normally use for ssh-ing into your EC2 instance. In my case, this includes specifying the
pem
file path and port I connect through.So under that
[tunnels]
section, I have something like this:ssh-AWS = ssh -q -i /Users/AWS/Keys/awsec2.pem
A couple things here:- It needs to be the full path to the
pem
file. You can’t use the~
here. - It needs to be in the
[tunnels]
section. I had it at the end of the file at one point, and the tunnel wouldn’t work
ssh-AWS
or ssh-tunnel
or what have you.And finally, let’s checkout that repo we made
svn co svn+ssh-AWS://ubuntu@1.1.1.1/srv/svn/{repo_name}
In the above case:ssh-AWS
is the name you gave to your tunnelubuntu
is the username for your EC2 connection (although I believeubuntu
is the default now)1.1.1.1
is the IP address (or host if you want) of your EC2 instance{repo_name}
is your repository’s name
No comments:
Post a Comment