Archive for December, 2011

Installing Project Pier on Ubuntu Server

As of late, I have undertaken the quest in search of a small-business, open-source, project management/wiki/file storage solution.  Oh, and I hope the “open-source” adjective conveyed that it needs to be a free (as in beer) solution as well.

I initially thought JobsWorth was the solution I was looking for, but after many many many many many many many…many hours of getting the server setup, only to find it too buggy for my tastes, I gave up.  The installation for JobsWorth works however, and if you want to give it a try, I have the steps listed in this blog entry.

I have looked at many other options during my quest, such as Redmine, Trac, SugarCRM, TWiki, etc.  Without going into all that detail, the winner was Project Pier.  It fits all the criteria above, and while I immediately found a bug, I submitted an issue ticket, and BAM, WAP, ZOOM the developer is working to get it fixed, so I am very optimistic.  And since it is on GIThub, applying the fix, will be cake 🙂

All that said, here is a tutorial to get Project Pier, version 0.8.8, setup on Ubuntu 10.04 Server Edition.

These of course are taken from the Project Pier Installation page (http://www.projectpier.org/manual/installation/).

My Setup:

  • Ubuntu 10.04 Server Edition (32-bit)
    • JobsWorth Install - Server Settings
    • During Server Setup chose (as seen in screenshot):
      • LAMP Server
      • OpenSSH Server
      • SAMBA Server

Prerequisites:

  1. Webmin
    • This is for easy setup of apache – to install, follow the instructions here: http://www.webmin.com/deb.html.  Go to section “Using the Webmin APT repository”.
  2. GIT
    • sudo apt-get install git-core

The Steps:

  1. sudo apt-get install php5-gd
  2. sudo git clone git://github.com/phpfreak/Project-Pier.git /var/www/projectpier
  3. Locate the following directories and change the permissions to 777 (read/write/execute for all users):
    • sudo chmod -v 777 /var/www/projectpier/public/files;sudo chmod -v 777 /var/www/projectpier/cache;sudo chmod -v 777 /var/www/projectpier/upload;sudo chmod -v 777 /var/www/projectpier/config;sudo chmod -v 777 /var/www/projectpier/tmp
  4. Locate the following file(s) and change the permissions to 777 (read/write/execute for all users):
    • sudo chmod -v 777 /var/www/projectpier/cache/autoloader.php;sudo chmod -v 777 /var/www/projectpier/cache/log.php;sudo chmod -v 777 /var/www/projectpier/upload/attributes.php
  5. You MUST create tho database first
    • echo "CREATE DATABASE projectpier DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; GRANT ALL ON projectpier.* TO 'projectpierDBA'@'localhost' IDENTIFIED BY 'keepitsecretkeepitsafe'; FLUSH PRIVILEGES;" | mysql -u root -p
  6. Create a Virtual Host on your Apache Server (see screenshots)
    • Create Virtual Host with Webmin
    • Create Project Pier Virtual Host
  7. Restart Apache
    • sudo /etc/init.d/apache2 restart
  8. Open up FireFox, and navigate to:
    • http://localhost/projectpier/public/install/
  9. Follow the instructions
    • When you get to “Step 3: Database configuration” (see screenshot)
      • Project Pier Installation - Step 3
    • If all goes well you’ll see:
      • Project Pier Installation - Success
  10. Locate the following file(s) and change the permissions to 777 (read/write/execute for all users):
    • sudo chmod -v 777 /var/www/projectpier/config/config.php
  11. In FireFox, navigate to:
    • http://localhost/projectpier/public/
  12. You will now be asked to set up an Admin user
  13. Get going, and enjoy Project Pier 🙂

Hope this was helpful.

Comments, questions, and corrections are always welcome 🙂  Just leave them below.

End Of Line.

Advertisements

2 Comments

Setting up a JobsWorth Server in Ubuntu

JobsWorth is a branch of the very awesome Rails application called Clocking IT.  So in order to do my part to help out, I would like to provide a how-to for setting up JobsWorth with Ubuntu Server Edition 10.04.

More information about Jobsworth found here: https://github.com/ari/jobsworth

and here: http://www.clockingit.com/

and here: http://groups.google.com/group/jobsworth

Ok, let’s get started!

My Setup:

  • Ubuntu Server Edition 10.04.3 – 32 bit
    • During Server Setup chose (as seen in screenshot):
      • LAMP Server
      • OpenSSH Server
      • SAMBA Server
      • JobsWorth Install - Server Settings

Prerequisites:

  1. Webmin

    • This is for easy setup of apache – to install, follow the instructions here: http://www.webmin.com/deb.html.  Go to section “Using the Webmin APT repository”.
  2. Ruby Version Manager (RVM)

Steps for the Install:

For the following steps, I adapted the instructions found here: https://github.com/ari/jobsworth.

  1. Install the follow packages, that will be needed to run JobsWorth

    • apt-get install mysql-server apache2 git-core imagemagick gcc libc6-dev g++ zip build-essential bison openssl libreadline6 libreadline6-dev curl zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev autoconf libcurl4-openssl-dev apache2-prefork-dev libcurl4-openssl-dev libaprutil1-dev libapr1-dev libxslt-dev libxml2-dev openjdk-6-jre
  2. Install Ruby version 1.9.2 ***Note: You need to have followed the instructions here, and have Ruby Version Manager setup and working

    • rvm install 1.9.2
    • rvm --default use 1.9.2
  3. Install Bundler Gem – for more info on Bundler go here: http://gembundler.com/

    • rvm 1.9.2 do gem install bundler
  4. Install Phusion Passenger

    • rvm 1.9.2 do gem install passenger
    • rvm 1.9.2 do passenger-install-apache2-module
      • This will setup Apache for you
    • Once passenger sets up Apache for you, at the end of a successful process you’ll see a message like:
      • The Apache 2 module was successfully installed.
        Please edit your Apache configuration file, and add these lines:
        LoadModule passenger_module /home/tron/.rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.11/ext/apache2/mod_passenger.so
        PassengerRoot /home/tron/.rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.11
        PassengerRuby /home/tron/.rvm/wrappers/ruby-1.9.2-p290/ruby
        After you restart Apache, you are ready to deploy any number of Ruby on Rails
        applications on Apache, without any further Ruby on Rails-specific
        configuration!
        Press ENTER to continue.
        • Note:  Use your Username in the paths above. (just in case you didn’t notice :))
    • Don’t worry about the lines for the Apache configuration file – we’ll deal with those in a later step.
  5. Modify your “hosts” file

    • If your like me, and you are installing your server on an Intranet, you’ll need to modify your “hosts” file so Apache knows where to go.  Additionally, the JobsWorth setup needs a domain.
    • gksudo gedit /etc/hosts
    • Add this line to your “hosts” file – remember the domain you use, you’ll need it later
      • 127.0.0.1    wiki.yourmadeupdomain.com
  6. Get the source

    • sudo git clone git://github.com/ari/jobsworth.git /var/www/jobsworth
  7. Change the permissions for the jobsworth directory

    • sudo chown -Rv $USER /var/www/jobsworth
  8. Setup a Virtual Host on Apache using Webmin

    1. Log into your local instance of Webmin – default = https://localhost:10000 (sceenshot)
      • JobsWorth Install - Log into Webmin
    2. Create a Virtual Host for the jobsworth application (screenshot)
      • Servers –> Apache Webserver –> Create Virtual Host
        • see screenshot for the proper settings
      • Click Create
      • JobsWorth Install - Webmin - Apache Virtual Host
    3. Select the Virtual Host you just created (screenshot)
      • JobsWorth Install - Webmin - Select Virtual Host
    4. Click on Edit Directives (screenshot)
      • JobsWorth Install - Webmin - Edit Directives
    5. Change your Directive file, ***ignore the text in the sceenshot, copy the text BELOW the screenshot***
      • JobsWorth Install - Webmin - Virtual Host Directive
      • DocumentRoot "/var/www/jobsworth/public"
        ServerName wiki.yourmadeupdomain.com
        RailsEnv production
        PassengerHighPerformance on
        LoadModule passenger_module "/home/tron/.rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.11/ext/apache2/mod_passenger.so"
        PassengerRoot "/home/tron/.rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.11"
        PassengerRuby "/home/tron/.rvm/wrappers/ruby-1.9.2-p290/ruby"
        <Directory "/var/www/jobsworth/public">
        AllowOverride All
        Options -MultiViews +Indexes
        Order allow,deny
        Allow from all
        </Directory>
        • Note:  Use your Username in the paths above. (just in case you didn’t notice :))
      • Click Save
    6. Now restart your Apache Server
      • sudo /etc/init.d/apache2 restart
  9. Install the Gems that JobsWorth needs to run

    • cd /var/www/jobsworth
    • rvm 1.9.2 do bundle install
  10. Setup the database

    1. As of the time of this writing there were some database setup issues.  The following steps are a work-around.  If you have the more “up-to-date” steps, please comment and I will update this tutorial 🙂
    2. You have to set up your database.yml file manually.
      • Make sure you are in the right directory:
        • cd /var/www/jobsworth
      • cp config/database.example.yml config/database.yml
      • Mine looks like this:
        • development:
            adapter: mysql2
            database: jobsworth
            username: jobsworthDBA
            password: keepitsecretkeepitsafe
            host: localhost
            encoding: utf8
          
          test: &TEST
            adapter: mysql2
            database: jobsworth_test
            username: jobsworthDBA
            password: keepitsecretkeepitsafe
            host: localhost
            encoding: utf8
          
          production:
            adapter: mysql2
            database: jobsworth
            username: jobsworthDBA
            password: keepitsecretkeepitsafe
            host: localhost
            encoding: utf8
          
          cucumber:
            <<: *TEST
          selenium:
            <<: *TEST
          
          staging:
            adapter: mysql2
            database: jobsworth_staging
            username: jobsworthDBA
            password: keepitsecretkeepitsafe
            host: localhost
            encoding: utf8
    3. Now create the database:
      1. echo "CREATE DATABASE jobsworth DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; GRANT ALL ON jobsworth.* TO 'jobsworthDBA'@'localhost' IDENTIFIED BY 'keepitsecretkeepitsafe'; FLUSH PRIVILEGES;" | mysql -u root -p
  11. Modify Ruby Setup File

    • As of the time of this writing (12/20/2011) the Dev made a change that broke the setup (at least for Ubuntu), so you’ll need to change it back.  Look for the following code, and make sure it looks like what I have below:
      1. Open the setup.rb file, located in /var/www/jobsworth/setup.rb
      2. Go to line 123, and make sure the code looks like this:
        • puts "Loading Rails to create account..."
          begin
            require File.expand_path('../config/environment.rb', __FILE__)
          rescue
            puts "*** Unable to load Rails, please ensure you have a working Rails environment. ***"
            exit
          end
        • Save changes
  12. Run the Ruby Setup File

    • cd /var/www/jobsworth
    • ruby setup.rb
    • Answer the first question “Enter hostname for the Jobsworth service (for example projects.mycompany.com):”
      • wiki.yourmadeupdomain.com
    • When you get to the question “Initialize database schema [n]:”, answer “y”.
  13. Email Setup

    • I have not yet gone through the email setup since my need is only for a local server.  The directions are located at “Step 8: Sending email” following this link: https://github.com/ari/jobsworth
  14. Finishing up

    • sh update.sh
    • ***Note: Could someone please comment and let me know if I am able to setup the Email after I run the “sh update.sh”????  I’m not going to need email for a while, so I have not set it up this tutorial, but I will and I don’t want to have to start all over to just setup Email.  PLEASE PLEASE let me know if you know
  15. Start using JobsWorth 🙂

That will do it.  Hope this helps some folks out! 🙂

And again, a big thanks to the JobsWorth Dev Team – thanks for this great tool! 🙂

End of Line.

15 Comments