Thursday, September 17, 2009

SVN progress!

OK – big couple of days.

As I left it on Monday, I’d downloaded RapidSVN to my Mac. When I tried to add a repository (which is the folder where we house all of the files we will work on through svn) through the program it prompted me to do this through the Terminal with command line prompts. I wasn’t sure how to log in to Strine through the Terminal, so I decided to wait until that evening after uni to ask the bf (who has some experience with the UNIX interface). As I mentioned in the last post, I’d also sent off an email to the hosting company hoping they might send out something that might help.

After leaving the uni meeting early on Monday, I got home and tried to set up a repository after the bf showed me how to log in. It didn’t seem to be working – I couldn’t even log into strine using RapidSVN but I wasn’t sure if I was just flaking out and doing something wrong due to being unwell. There was still no response from the hosting company. I decided sleep would be a better option. The bf kindly tried to work it out for me for a couple of hours using the command line and TortoiseSVN (the Windows SVN client he is used to using for work), but he couldn’t get a connection either.

I sent this to the hosting company the next morning:

From: "janet_tot@yahoo.com" janet_tot@yahoo.com
To: ticket@segpub.com.au
Sent: Tuesday, 15 September, 2009 9:46:52 AM
Subject: Problem setting up svn on strine.net.au

IP: 66.216.73.128I tried to set up subversion on strine.net.au last night by running svnserve. By default svnserve on bsd systems listens on an IPv6 TCP port, but because we need to access it over the internet I overrode this behaviour by specifying an IPv4 hostname. The command was:

svnserve -d --foreground -r . --listen-host 0.0.0.0

Using netstat I was able to determine that svnserve was listening on the default svn port, 3690, and using the svn client on the same host I was able to connect to the server.

I was not able to connect to the server from a machine on another computer. The svn clients I tried (TortoiseSVN on Windows, svn from the command line and RapidSVN on Mac) were timing out when trying to connect, which gives me the impression they were not able to connect to that machine:port. Are certain ports blocked?

Could you let me know how you set up subversion on the host? Did you just install subversion, or get as far as setting it up to accept connections, and if so what IP address, hostname, port and protocol (svn, svn+ssh, http?) we should be using to connect?


Thanks
Janet




I didn’t receive a reply from them that night, so the bf kindly had another go at fixing the problem the next night, while I recuperated in my sick bed. He tried to create a repository directly on the server, but was still unable to connect with it. The good thing was, he clearly fiddled enough with the host’s server to cause them alarm, so they actually responded the next morning:

From: "ticket@segpub.com.au" ticket@segpub.com.au
To: janet_tot@yahoo.com
Sent: Wednesday, 16 September, 2009 7:00:52 AM
Subject: [segpub.net #5371] re strine.net.au

Hi Janet,

Apologies for the delay in getting back to you.

In regards to SVN, please don't run any background servers on your account, this is not allowed. SVN has been setup over HTTP at svn.strine.net.au.If you look in your "svn" directory within your home folder, you'll see two files here: .svnpass & .svnaccess.

The first file is an htpasswd file where you add your users to. To add a new user, you'll need to SSH into your account and run:
htpasswd ~/.svn/.svnpass username
Where username is the user you want to add (or edit if they exist).
Secondly the next file determines permissions for what repositories the user can access. The format of that is as follows:
[repositoryname:/]
user = rw

In this example we've allowed the user "user" read/write access to the repository named "repositoryname".To create a new repository, you'll need to use the svnadmin program:

svnadmin create ~/svn/repositoryname

Where repositoryname is the name of the repository you're wanting to create. Once you've created the repository you'll need to set the permissions on the directory to be 775 recursively, so ideally you should run:
chmod -R 775 ~/svn/repositoryname
Once you've created the repository initially so that read/writes can happen correctly over HTTP.

-- Best Regards,
Segment Publishing Customer Support



Once again, invisible files were the cause of my pain! By logging into the host’s server via the terminal, which you do by typing

ssh username@siteaddress
i.e.
ssh strine@strine.net.au

And then by filling in the password at the prompt, you are logged into the server!
Then, I got into the svn folder by entering
cd svn
(which means ‘change directory’ to svn)

I then asked it to list the contents of the directory (ls), but the bit at the end means show all of the invisible files as well
ls -la

I could see that they had created the files as described, and had shifted all of the bf’s repository files into a folder called ‘old’. They’d done all of this at 6.45am. With the delays in emails and the times I was getting replies from them, I’m starting to think the hosting co is just some dude with a day job, dealing with help issues before/after work.

So I tried to follow the instructions and to create a username/password for myself, but it wasn’t letting me save anything. I CHMODed the directory and it looked like I only had read access to the file. I had the bf check this when he got home from work and I was right! (I can’t believe I know all of this stuff now!). So I sent off another email (and was glad I had put in the deadline for getting this set up as Saturday, with all of the unforseen hiccups!).

From: "janet_tot@yahoo.com" janet_tot@yahoo.com
To: ticket@segpub.com.au
Sent: Wednesday, 16 September, 2009 7:51:07 PM
Subject: Re: [segpub.net #5371] re strine.net.au

Hi, thanks for getting back to me
I've tried to follow the instructions below to add a new user, but it looks like I don't have permission to write to either .svnpass or .svnaccess
Could you please let me know what it is that I might have missed?

Janet


Fortunately the hosting co got back to me this morning

From: "ticket@segpub.com.au" ticket@segpub.com.au
To: janet_tot@yahoo.com
Sent: Thursday, 17 September, 2009 6:48:53 AM
Subject: [segpub.net #5371] re strine.net.au

Hi Janet,

Try again now, sorry.

-- Best Regards,Segment Publishing Customer Support


Do I did try again and it worked! I’ve set myself up with a user name and password.
I created the repository by calling for the unix visual editor by typing in
vi .svnaccess

which created a visually unappealing version of the svnaccess file. I typed ‘I’ which allowed me to insert text into this file. I followed the hosting co’s instructions and gave myself read/write access to the repository by entering
[strinerespos:/]
jto = rw

After exiting there, I went to the client RapidSVN. It took a bit of mucking about but I managed to log into the repository! Very exciting :-)

Tonight after work I plan to transfer the site files to the repository and check that it’s all working (and how it will all work). I will also set up user name/passwords for the team. And try to work out how to use RapidSVN to call on different versions of code.

Tomorrow I’ll look into seeing how we’re going to make it work with Strine online – i.e. how we update the files. I’ll also test how Pligg responds to having the files updated in this way (although considering Pligg itself uses SVN, I’m pretty sure it should be OK). It will also be a good chance to test the database backup that’s built into Pligg, before we put too much information into it.

Considering I’m working the next couple of days, that should pretty much fill all of my spare hours!

jct

No comments:

Post a Comment