I’ve wanted to setup an SVN server for personal use, and to keep files current between my fiance and me when we’re working on the same project.
So far I’ve resorted to using a flash drive, but sometimes it takes a while to check which machine or flash drive has the latest copy of my program source, or even sometimes losing the flash drive, and potentially having the latest copy lost.
Well, I switched hosts to hostgator not too long ago from Godaddy, which had been great for my static+php sites, but awful for wordpress, due to fetching from the database. Sometimes 60 seconds to load a basic page! (5 seconds max with hostgator, BTW)
I like hostgator a lot better, they make it easy to run CRON jobs, but could I finally have a basic SVN server using them?
Yep, here’s how I did it, although it took over 3 hours of pulling out hair:
How to create an SVN on hostgator
I mostly found my information based on this article (although it didn’t work for me – invalid port error):
First thing first, you have to enable SSH on your hostgator server. From their wonderful support portal:
- Login to the HostGator billing tool, GatorBill.
- Go to ‘Hosting Packages’ and click ‘View Hosting Packages’.
- Find the package you want to modify and click on ‘Enable Shell Access’.
Install TortoiseSVN, and just put the putty.exe somewhere you can find it.
Open Putty, under ‘Host Name’ enter your domain name, and under port enter 2222, then enter a name ( I used ‘puttyinterface’) into ‘Saved Sessions’ and click ‘Save’. Now double click on the puttyinterface below to connect.
Now, you’ll get a strange popup about putting the servers host key into the registery. this actually adds a key to the registry that allows tortoisesvn to connect!! (click yes)
When it loads (to something like a dos prompt), login using your CPanel username and password (nothing will show when you type in your password, but it works)
Next, create a repository using the command : ‘svnadmin create myrepo2’
(myrepo2 being the name of the svn folder you want on your server)
Lastly, just create a folder on your computer where you want the repository to download to, right click on it->SVNCheckout, and in ‘URL of repository’ enter:
(replacing doomtoo with whatever your CPanel login was, and myrepo2 with whatever you named the svn folder through putty in the previous step)
Now type in your CPanel password when it prompts you (sometimes several times) and it will create the repository!
Now you can create files in your local folder, right click on it and click ‘SVNCommit’ to commit files to svn on your server, and right click and select ‘SVNUpdate’ to grab any changes commited to your folder!
This will definitely save me some time staying up to date with the latest copies of my program, as well as get rid of my flash drives, and help keep projects organized with other people!
Let me know if you found this helpful, or found an easier way to do it!