Git, SVN and Hg (Mercurial) currently are the most popular version control systems. In this guide we are going to show how to host repositories for these systems on Windows with Microsoft IIS 7+.
We will be using a magnificent free and open source tool – SCM-Manager. This is simple and nifty looking manager tool for Git, SVN and HG written in Java. Probably the best thing about SCM-Manager is that it includes all dependencies inside and does not require you to download and compile any third party components. You don’t have to install Git or any other kind of servers to host repositories. It does require Python and Hg package to host Mercurial repositories, but these packages can be installed automatically into the SCM-Manager home directory directly form web interface. So if your host support hosting of Java applications you don’t need access to the server console to install some components or run additional commands.
Hosting Java applications with Helicon Zoo
First of all you need to configure your IIS server to host Java applications. The easiest way to do this is to use Web Platform Installer.
- Download and install Microsoft Web Platform Installer.
- Run Web Platform Installer and click “Options”.
- Add Helicon Zoo feed into “Display additional scenarios” box: http://www.helicontech.com/zoo/feed. New “Zoo” tab will appear.
- Go to the Zoo –> Templates and select Java (Jetty) project.
- Accept licenses to start installation process.
This will install all dependencies required to run Java application on IIS, including JVM, Helicon Zoo Module, etc. After installation of all dependencies is completed you will be presented with the standard Web Deploy dialog to create new web application:
Select “New web site” in the web site field and configure other options as usual.
Another good way to install all required dependencies is to install Zoo –> Packages –> Java Hosting Package. This package is usually installed on servers to allow them to host Java applications. The idea is that Java application can be simply moved from one IIS server to another just by copying web site folder, if both servers has Java Hosting Package installed.
Installing SCM-Manager
First you need to download SCM-Manager as a single WAR file here: https://bitbucket.org/sdorra/scm-manager/wiki/download Save this WAR file to the IIS web site folder and edit web.config file as follows:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<heliconZoo>
<application name="jetty.project" >
<environmentVariables>
<add name="CONTEXT_PATH" value="%APPL_VIRTUAL_PATH%" />
<add name="WAR_EXTRACT_PATH" value="%APPL_PHYSICAL_PATH%" />
<add name="WAR_FILE" value="scm-webapp-1.20.war" />
<add name="SCM_HOME" value="%APPL_PHYSICAL_PATH%/.scm" />
</environmentVariables>
</application>
</heliconZoo>
<handlers>
<add name="jetty.project#x86" scriptProcessor="java.jetty" path="*" verb="*" modules="HeliconZoo_x86"
preCondition="bitness32" resourceType="Unspecified" requireAccess="Script" />
<add name="jetty.project#x64" scriptProcessor="java.jetty" path="*" verb="*" modules="HeliconZoo_x64"
preCondition="bitness64" resourceType="Unspecified" requireAccess="Script" />
</handlers>
</system.webServer>
</configuration>
Here the WAR_FILE environment variable contains the downloaded WAR file name. The SCM_HOME points to the /.scm folder under web site home, this will instruct SCM-Manager to store all files and repositories inside a web site folder. Note that write permissions to the web site folder for the user running Web Application Pool are required.
Now navigate to the web site created. The first start usually takes some time as SCM-Manager will create files and folder structures, configurations and Java Virtual Machine also needs time to start-up. After application initialization you should see a login screen. Enter the following default credentials to log in:
login: scmadmin
password: scmadmin
Don’t forget to change default password later. Now welcome to the dashboard:
Working with SCM-Manager
After installation you can immediately start creating empty Git and SVN repositories. To start using Hg open Repository Types page under config section and start Configuration Wizard for Mercurial. Select “download and install” and required packages will be installed into /.scm folder under web site automatically.
More often users ask how to import your existing repositories into SCM-Manager. All repositories are stored in the folder /.scm/repositories inside your web site. If you have FTP access to these folders you can simply copy entire directory structure of your repositories to the corresponding folders under /.scm/repositories. For SVN this is the only viable option to import repository as it uses central repository storage. Then click on Import Repositories link on the dashboard and your repositories will be imported into SCM-Manager.
Since Git and Hg uses decentralized repository storage, you can simply create empty repositories with web interface and then push your local repositories to the new location.
Now you can create users and groups, manage permissions, view commits and sources. And the most important feature of SCM-Manager is that it provides central point to administer all of your repositories from different source controls on a remote servers and over internet. And it is so easy to start work with!