Binary Static

How to install Redmine from SVN with Apache Passenger and Postgresql

Posted in Applications, Linux, SysAdmin, Web by Chris on September 1, 2012

System: debian 6.0.5

Redmine’s standard debian packages are pretty outdated, so here’s how I installed its latest stable version. I used postgresql as database.

Get the latest stable version from the projects subversion. Do a checkout and keep the .svn directory for later updates on this branch:

# svn co http://redmine.rubyforge.org/svn/branches/2.0-stable /usr/share/redmine

Make sure ruby and rubygems and necessary libraries are installed:

# apt-get install ruby rubygems libpq-dev libmagickcore-dev libmagickwand-dev

Install bundler, which is ruby’s dependency manager, and rake, which is its build tool and conveniently to their executables:

# gem install bundler
# ln -s /var/lib/gems/1.8/bin/bundle /usr/local/bin/bundle
# gem install rake
# ln -s /var/lib/gems/1.8/bin/rake /usr/local/bin/rake

Change to the Redmine root directory and install all needed libraries with bundler:

# bundle install --without development test mysql sqlite

Configure /usr/share/redmine/config/database.yml:

production:
  adapter: postgresql
  database: redmine
  host: localhost
  username: redmine
  password: password
  encoding: utf8

Create the role and user in the postgresql database:

# su postgres
$ psql
postgres=# CREATE ROLE redmine LOGIN ENCRYPTED PASSWORD \
'password' NOINHERIT VALID UNTIL 'infinity';
postgres=# CREATE DATABASE redmine WITH ENCODING='UTF8' \
OWNER=redmine;

Logout from the database and its user and generate the session token (again as root in /usr/share/redmine):

# rake generate_secret_token

Generate the database schema and load the fixtures:

# RAILS_ENV=production rake db:migrate
# RAILS_ENV=production rake redmine:load_default_data

Allow the Apache user (assuming www-data) access to relevant directories:

# mkdir tmp public/plugin_assets
# sudo chown -R redmine:redmine files log tmp public/plugin_assets
# sudo chmod -R 755 files log tmp public/plugin_assets

Test your installation by starting the built-in-server webrick, stop it with Ctrl-C:

# ruby script/rails server webrick -e production

Configure the named virtual host in
/etc/apache2/sites-available/tracking.codeways.org:

<VirtualHost *:80>
     ServerName tracking.codeways.org
     ServerAdmin admin@codeways.org

     DocumentRoot /usr/share/redmine/public

     RailsEnv production
     RailsBaseURI /
     <Location "/">
         Options ExecCGI FollowSymLinks
         Order allow,deny
         Allow from all
     </Location>
</VirtualHost>

At first, I linked to the Redmine root directory. This became unnecessary as I made it the document root of the vhost:

# ln -s /usr/share/redmine/public /srv/tracking.codeways.org

I configured e-mail (using exim4 and tls) in /usr/share/redmine/config/configuration.yml:

default:
  email_delivery:
    delivery_method: :smtp
    smtp_settings:
      enable_starttls_auto: true
      address: mail.codeways.org
      port: 25
      domain: mail.codeways.org
      authentication: :plain
      user_name: "redmine"
      password: password

Start Redmine by restarting Apache:

# a2ensite tracking.codeways.org
# /etc/init.d/apache2 restart

Log into Redmine under http://tracking.codeways.org. Default username admin and password admin.

Tagged with:

Install Redmine on Debian Squeeze with Apache Passenger

Posted in Applications, Linux, SysAdmin, Web by Chris on August 30, 2012

This is how I installed redmine on my server, which runs debian 6.0.5. Get the packages:

# apt-get install redmine redmine-sqlite rails rake ruby \
librmagick-ruby libapache2-mod-passenger ruby-passenger

Debian should activate the passenger module during install.  Also during install you should set the defaults for the database module. This should be simple if you use sqlite3.  Strangely enough, the package does not touch a log file for the production environment.  I did this manually:

# mkdir /usr/share/redmine/log/log
# touch /usr/share/redmine/log/production.log

Try running webrick; kill with Ctrl+C:

# cd /usr/share/redmine
# ruby script/server -e production

At first I symlinked to the public directory of redmine.  Yet, this seems to have become unneccessary later:

# ln -s /usr/share/redmine/public /srv/tracking.codeways.org

Create a named virtual host /etc/apache2/sites-available/tracking.codeways.org:

<VirtualHost *:80>
     ServerName tracking.codeways.org
     ServerAdmin admin@codeways.org

     DocumentRoot /usr/share/redmine/public

     RailsEnv production
     RailsBaseURI /
     <Location "/">
         Options ExecCGI FollowSymLinks
         Order allow,deny
         Allow from all
     </Location>
</VirtualHost>

Configure e-mail service (exim4, tls) in /etc/redmine/default/email.yml:

production:
  delivery_method: :smtp
  smtp_settings:
    ssl: true
    enable_starttls_auto: true
    address: mail.codeways.org
    port: 25
    domain: mail.codeways.org
    authentication: :plain
    user_name: "redmine"
    password: password

Activate the whole she-bang:

# a2ensite tracking.codeways.org
# /etc/init.d/apache2 restart

Start redmine with http://tracking.codeways.org. Default username admin and password admin.

Tagged with:

Make the TrackPoint play nice with Fedora 13

Posted in Linux, SysAdmin by Chris on May 28, 2010

Moving faster
Speed and sensitivity defaults leave my Thinkpad’s trackpoint excruciatingly slow. So first thing is to create /etc/udev/rules.d/10-trackpoint.rules containing one line:

SUBSYSTEM=="serio", DRIVERS=="psmouse", ATTR{speed}="220", ATTR{sensitivity}="190"

Scrolling
I also like to scroll with the help of the middle button. For this Fedora 13 now uses user config files for X like /etc/X11/xorg.conf.d/20-thinkpad.conf reading e.g.:

Section "InputClass"
    Identifier      "Trackpoint Wheel Emulation"
    MatchProduct    "TPPS/2 IBM TrackPoint|DualPoint Stick|Synaptics Inc. Composite TouchPad / TrackPoint"
    MatchDevicePath "/dev/input/event*"
    Option	    "EmulateWheel"       "true"
    Option	    "EmulateWheelButton" "2"
    Option	    "Emulate3Buttons"    "false"
    Option	    "XAxisMapping"       "6 7"
    Option	    "YAxisMapping"       "4 5"
EndSection

Tagged with: , , , ,

Smooth Transition to Goddard

Posted in Linux, SysAdmin by Chris on May 27, 2010

Fedora LogoYesterday, I upgraded my main system to Fedora 13.  Coming from the excellent Fedora 12, this was a smooth transisition indeed.  Everything’s working fine, the whole operation took less than two hours (4 min to install the new system from a pen drive, ca. 90 min to reinstall my package collection, including 2 GB downloads).  I was expecially impressed with the new auto-installing language packages, which gave me a localized desktop from the first login.   As exepected, on my Thinkpad X200 everything worked right out of the box.  No horrible Macification surprises either.  Thank you very much, Fedora team!  Keep up the great work!

Some minor issues with the Karmic Koala

Posted in Linux, SysAdmin by Chris on October 31, 2009

After upgrading from Jaunty to Koala by clean install I experienced some minor annoyances – some of which I’m still working around.

The onion router package tor is MIA from the official repositories. To make things worse, there is no karmic build in the tor project’s repository either. Luckily, the debian sid build works. So adding

deb http://deb.torproject.org/torproject.org sid main

to /etc/apt/sources.list did the trick. Tor is up and running again.

DNS lookup was slow all over the system. And I mean really slow. It took Chromium up to 30 seconds to connect to a server. OpenArena was even completely timed-out in multiplayer mode. I have no clue what the problem is here. Strangely enough, providing alternative nameserver addresses did the trick. I used OpenDNS by adding

prepend domain-name-servers 208.67.222.222,208.67.220.220;

to /etc/dhcp3/dhclient.conf. Now IP resolving works well. But I don’t like this.

Some strange messages show up during boot, which seem to be harmless:

One or more of the mounts listed in /etc/fstab cannot yet be mounted:
(ESC for recovery shell)

Everything is then mounted ok. It still costs a couple of seconds in boot time. There is some discussion about this being a bug in mountall. What for it’s worth, I’m running version 1.0 of mountall.

Installing apache2 with apt-get now provides the package apache2-mpm-prefork, which doesn’t work with libapache2-mod-php5. This apache needs libapache2-mod-php5filter to parse PHP. Too bad I had simply copied all package selections from my previous install. This kept me busy for a while.

Tagged with: ,