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.

Advertisements
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:

How evil is Google really?

Posted in Google, Politics, Web by Chris on December 9, 2009

Google Logoerman journalist Christian Ströker comments on an interview with Eric Schmidt and comes to the conclusion that Google wants it all. The big program, all of it, “world domination”. He sees an evil strategy behind Google’s innovations and acquisitions to abolish our “civil concept of privacy”. This is not quite the same as the “world domination” mentioned in the headline, but whatever. Ströker’s proof: Schmidt advises us to refrain from activities we fear to become public. Google chronicles all our web journeys plus social data and links them to semi-anonymized IPs. Worse, Google tries to link these web characters to geographical locations (Google Latitude etc). Wow, that’s bad shit, Mr. Ströker.

However Google is your least problem when surfing the web. Your ISP and your mail provider know everything about you by default. Any sys admin at any ISP can read every bit, and I mean bit, of your web traffic 24/7. In Germany, the ISPs are even required by law to record your connections and log them with your full IP address for months. And of course, they are to be given out to the authorities on request – that’s why they are to be collected in the first place. Mail providers could easily read all your mails, including the ones with the user logins and passwords. No matter what mail provider you use.

And what about Schmidt’s privacy statement?  Although people don’t seem to get it: everything you do online you do in a public place. And you always did, even before 1996.  So, as far as public places go: if you don’t want other people to see something, where you don’t have much chances to hide it, than you best don’t do it, at least not in a public place.  Which brings us to Ströker’s very misconception: the internet is not and never was a private place.  The moment you log on, you’re leaving your home and go out on (a very crowded) street. There are of course tools which allow you to hide at least some things (everyone should use PGP in their private correspondence for that matter) – however, as long as some bits crawl some line it’s not that much different from walking on a public street.

Our real problem is not some alleged corporate conspiracy against privacy but political attempts to censor and govern the raw traffic at the heart of the consumer internet: the ISPs’ servers. If people want to give up their privacy to Google, that’s fine, or at least it’s their right to do so. But this agreement has only two parties: them and Google. There’s no place for governments in this. Of course, Google might decide to cooperate with law enforcement agencies against their customers. But again, this is nothing new, but something ISPs all over the world (have to) do on a daily basis. The real problem is not Google, but third party access to your web traffic on behalf of the public good. Consider the following analogy: if I decide to open all my private letters to some private corporation who promises me, say, lightning fast mailing service, then you need not like my decision, but it’s legitimate nevertheless. In fact, this is what happened when people started to use private telegraphy services in the 19th century.  It happened again when people bought internet access from private ISPs. It is a complete different matter, though, when a third party requires a copy of every letter sent over the wire. Yet, this is not a problem of the contract in itself. It’s a problem of wrong government priorities.

Tagged with: , , ,

Killing the Internet

Posted in Politics, Web by Chris on November 23, 2009

It’s getting worse everyday now. Cory Doctorow reported and commented on new restrictions on internet use which are about to become law in the UK. The proposal has the usual ingrediences: extended control over ISPs serving private interests, draconic sanctions against copyright infringement, and forcing users off the net. First France, now Britain, who will be next? Western nations are obviously under enormous pressure from the content industry to end the so-called “misuse” of the internet.

This whole crusade against file-sharing is way more dangerous than it might seem. It is not only successful lobbying on behalf of the content industry. And it is not only about cutting off some cheap kids from their music supply. Old media, content industry and politics might find a common interest to change the nature of the internet forever. The old powers have reason to turn the internet into something like TV: a malleable means to distribute products and channel approved information.

The content industry used mass media to sell their products, politicians used them to control the masses – and the old media gained power and wealth from both ends. However, the internet changed the rules of the game because it allowed individual communication on a massive and global scale. Precisely its peer-to-peer nature established a public infrastructure which could not as easily be twisted and influenced as the old media in the TV age. In terms of peer-to-peer communication every client is equal – and every voice and opinion may be heard unfiltered. No need for mediation nor content salesmen, no easy access for politicians to the public opinion. In our new age people can exchange digital goods and analog ideas without direction and control of the establishment. This is why content industry, TV-age media and old-school politicians all have a very good reason to hate the internet in its present form. And this is what worries me most in the power struggle that lies ahead. Sure, private broadband connections will survive, we will still have packet-based protocols – but what if all people may use it for is buying TV streams from established outlets as everything else is effectively outlawed? Would you still call that “internet”?

Tagged with: ,

Recent Chromium build for Ubuntu introduces extensions and bookmarks sync

Posted in Google, Linux, Web by Chris on November 17, 2009

… but kills essential development features (which didn’t work anyway). Chromium 4.0.250.0 (Ubuntu build 32056) was distributed via Launchpad the other day. There is no official repository for extensions yet. However, you may find other resources to mess with your browser. The syncing feature seems still somewhat immature, since your stuff will actually sync with a Google Docs document – and not with Google Bookmarks or another well established service like Delicio.us which would seem more plausible. Anyway, syncing via Google Docs works o.k., if all you want is to work with instances of Chromium across different machines. Since I still need Firefox from time to time, I prefer the Delicious bookmarklet to Chrome’s new built-in sync. And why would I still need Firefox? There’s still no serious web development on (Ubuntu) Linux with Chrome – which is too bad, really. The scripting console didn’t work before, and now Google seems to have killed the relevant entry in the developer tools menu. This is no solution, of course. OK, so in a new build I got the menu entries back – but there is still no chrome://devtools/devtools.html. Please Chromium Team, Firebug in all its glory is the one extension that ties me to Firefox (yeah, I know about Firebug Lite). I could easily dispense with the rest and work with javascript bookmarks for other vital functionality.

Tagged with: , , , ,