1 Installing Indefero on Ubuntu Precise Pangolin

May 6th, 2012   11:34 pm

Indefero is an open-source Git hosting web app, built on PHP (using the PLUF framework) and MySQL. I use it for some clients because it is shared hosting friendly (no need to set up Ruby on Rails or daemons, as with Gitorious). Here’s a quick guide to installing it on the latest (as of time of writing) Ubuntu release, Precise Pangolin v12.04 LTS.

Conveniently, someone (shockflash) has packaged Indefero for Ubuntu installation. As of time of writing, these packages were limited to Ubuntu Lucid Lynx v10.04, so there’s a couple of extra steps, but the install process is still relatively painless.

On a basic Ubuntu 12.04 install, I opted to enable the LAMP package set (which installs MySQL, PHP, and Apache web server all needed by Indefero). If you are installing on an existing Ubuntu server machine, you just need to install apache2, mysql-server, and various php5 packages.

  1. Install Indefero package
    • Make sure to have MySQL (server) installed in advance, along with apache2.
    • As per the instructions on this Launchpad page, you add their repository:
      sudo add-apt-repository ppa:shockflash/indefero
    • A quick edit of /etc/apt/sources.list.d/shockflash-indefero-precise.list and change the precise to lucid. This hack just tells apt to use the packages for the older lucid install (as these are the most recent packages available at the moment.
    • Update your repository cache by using apt-get update, or “u” within aptitude
    • Finally, install the packages added by this new repository. If your software was fully up to date, then you should see 5 new packages available to install. These packages are indefero, pluf, and any/all of the 3 other scm-specific packages indefero-git, indefero-hg, indefero-svn, as needed.
  2. Configuration
    • As noted during the install, the default admin login details are admin / pass
    • These packages automatically install at <your_server_hostname>/indefero/, though you may want to set up a more specific arrangement using virtual hosts, etc.
  3. Potential Apache config issue
    • There’s one slight issue that I found on a few installs. That is that the Indefero CRON script for synchronising Git keys breaks because it can’t determine the hostname (correctly, or at all). This means that after adding valid user SSH keys in Indefero, these keys won’t work because the cron script never gets to add them to the git user’s authorised keys. This problem also surfaces when you start/restart/configtest apache2 and get the message apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName. To fix this, simply fix your apache configuration! If you are not using virtual hosts, you can fix the base Ubuntu install by just adding ServerName <your server hostname> (or even ServerName <localhost>) at the start of the /etc/apache2/apache2.conf
  4. First steps using Indefero (Git)
    • Login as the default admin user
    • Create a new user, and add an SSH (private) key for that user. Of course, you can have that new user login and provide their own SSH key.
    • Create a new project, and add your new user to the team
    • You can follow the instructions on the project page for creating a new repository, or you can upload an existing repository as follows:
      # You probably want to remove any existing 'remote' (like GitHub,
      # Gitorious, or your own SCM hosting). If so...
      # List any existing remotes
      git remote
      # Remove any remote. Likely called 'origin', or whatever
      # is listed above.
      git remote rm origin
      
      # Now add your Indefero project as a remote
      git remote add origin git@__YOUR__SERVER__HOSTNAME__:___YOUR_PROJECT_NAME__.git
      # For example, if your server is 'scm' and your new project is 'test'...
      git remote add origin git@scm:test.git
      
      # Push your repository to its new origin, or home, on Indefero
      # in the 'master' branch.
      git push origin master
      
      # Thereafter, you can simply push any changes with
      git push

Comments:

Jul 2nd, 2013   2:15 pm

Thank you for this write up. I learned as much about git as I did about installing indefero! Subscribing to your feed as well. Your articles are fantastic!

Leave a Reply

Your email address will not be published. Required fields are marked *

css.php