Categories
General Java Web Development

Eclipse Subclipse SVN + Hostgator.com

If you use hostgator.com, you can use your hosting server as your SVN repository, assuming you are developing alone. If you are using Eclipse on Windows for development, this is the how-to for you.

Share

I use Hostgator as my hosting company. I love them – great service, tons of space and no long term obligations. And the servers are fast. Now, another reason to love them – running Subversion repositories on your server with the caveat – you can only have one account to account to access that repository. If you develop by yourself, and I do for now, it’s not a problem. So how do you do it – assuming you are a Java coder using Eclipse on Windows?

  1. Send Hostgator support a request to get SSH access to your server. They will ask you to send in a picture id and once that is cleared, you should be good to go. A matter of a day or two.
  2. Install Subclipse SVN plugin for Eclipse. The Subversive plugin DOES NOT WORK.
  3. Install the really good Tortoise SVN client
  4. Set up an environment variable called SVN_SSH. To do that, go to the Windows Control Panel -> System -> Advanced -> Environment Variable -> New (under the bottom Window). For variable name enter the value SVN_SSH and for its value enter c:\\Program Files\\TortoiseSVN\\bin\\TortoisePlink.exe (assuming you installed Tortoise SVN in the default location).
  5. Start Eclipse and go to the Subclipse options: Window -> Preferences -> Team -> SVN . There, for the SVN Interface select “SVNKit (Pure Java)”. Click OK to store the setting.
  6. Now, using Putty or some other SSH tool, SSH to your account. You will need to set up a repository for your project. To do that, create the directory that will be used as repository, say /myrepo. Now, create an Subversion repository inside that directory: svnadmin create myrepo.
  7. Create a new project by checking out the repository from SVN. To do that, in Eclipse, go to: File -> New -> Other -> SVN -> Checkout Project From SVN.
  8. The ‘Checkout from SVN’ window will appear. There select to create a new repository location
  9. For the URL, enter: svn+ssh://<your hostgator admin user name>@<your domain name>:2222/home/<your hostgator admin user name>/<Repository directory path>. In other words, if your domain is example.com, your admin user name is joey and the path to your repository is /myrepo, then your URL will be svn+ssh://joey@example.com:2222/home/joey/myrepo
  10. Another popup window will follow that will ask you for your SSH user name. Enter the details and make sure they are saved.

You should be good to go at that point as the rest of the process is the normal project checkout scheme used by Subclipse.

Two resources were helpful: The support message board post on the subject and this blog entry.

Hope this helps!

Share
Share