Install Passenger (aka mod_rails) on a Plesk 10 System

On Plesk System it is sometimes a little bit tricky to install extensions which are not supported by Plesk itself.

Here is a way how to install phusion passenger ( aka mod_rails) on a host that is managed using Plesk 10 or greater.

First Step
Install passenger as descriped on Passenger Installation :

  1. gem install passenger
  2. passenger-install-apache2-module

For the second point the gcc c++, curl dev libs, apache dev libs must be installed. Use apt-get (debian based systems) or yast (Suse) etc for installation.

Second Step
You have to add a vhosts file to the configuration of the domain / subdomain:

  • Place it at for the main domain:

    conf/vhost.conf

    or at for subdomains:

    subdomains//conf/vhost.conf

  • Add the following lines given by passenger-install-apache2-module

    LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-3.0.7/ext/apache2/mod_passenger.so
    PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-3.0.7
    PassengerRuby /usr/bin/ruby

  • Add appropriate user and group for the execution of the webapplication like :

    PassengerDefaultGroup psaserv
    PassengerDefaultUser

    The default setting is nobody/nobody which does not work in general.

  • Change the Rails Environment:
    The default is production. If yout test or development add the following line:

    RailsEnv development (resp. test)

Third Step
Change the document root to the public directory of the rails application.
In Plesk 10 you can do this here:
Go to Control Panel der Domain/Subdomain => Websites&Domain

Attention
passenger-install-apache2-module and the original docs give you another setting for the vhost:


AllowOverride all # <-- relax Apache security settings
Options -MultiViews # <-- MultiViews must be turned off

This does not work with plesk! It results in the following error messages:
Syntax error on line xx of /srv/www/vhosts/xxx/subdomains/yyy/conf/vhost.conf: Illegal override option #
Syntax error on line xx of /srv/www/vhosts/xxx/subdomains/yyy/conf/vhost.conf: Illegal option #

This setting was succesfully installed on a Strato based Linux system.

Skiing


"You can't buy
the spirit
of skiing!"

mo

Bei uns in Bayern: Wilderer

Imma wieda guad (by Bully & Tramitz)

Tempel – Heimat der Göttlichkeit?

“Wir errichten Tempel, um dort Götterbilder zu weihen und sie zu verehren.
Woher kommt das Götterbild?
Es ist eure eigene Schöpfung.
Ihr verehrt die von Menschenhand geschaffenen Götterbilder, seid aber nicht bereit, Gott im Menschen zu verehren.
Es bringt nichts, nur Götterbilder zu verehren, wenn ihr eure innewohnende Göttlichkeit nicht erkennt.”

Sai Baba

Scrum Profile

Hier könnt ihr mein Profil der Scrum Alliance finden

Michael Oberhuber – Profil Scrum Alliance

wo ich als CSM eingetragen bin.

Alles eilt von hinnen

Einsam steh`n des öden Tempels Säulen,
Efeu rankt am unverschlossenen Tor,
Sang und Klang verstummmt, des Uhus Heulen
Schallet nun im eingestürzten Chor.
Weg sind Prunk und alle Herrlichkeiten,
Schon enteilt im langen Strom der Zeiten
Bischofshut und Siegel, Ring und Stab
In der Vorwelt offenes Grab.

Nichts ist bleibens, alles eilt von hinnen,
Jammer und erhörter Liebe Glück.
Unser Streben, unser Hoffen, Sinnen
Wichtig nur für einen Augenblick.
Was im Lenz wir liebevoll umfassen,
Sehen wir im Herbste schon verblassen,
Und der Schöpfung größtes Meisterstück
Sinkt veraltet in den Staub zurück.

A.Hermann (1810)

Rewrite Rules mit Ports

Eine Frage, die immer wieder auftaucht ist, wie kann man einen Rewrite Rule formulieren, die als Bedingung den benutzten Port beinhaltet.
mod_rewrite bringt die Lösung praktisch schon mit:

RewriteEngine on
RewriteCond %{SERVER_PORT} !^3000$
RewriteRule ^/?(.*) http://www5.xxx.urg:3000 [L,R,NE]

Strato und php settings

Wer gezwungen ist ein CMS auf einem Strato Hostingpaket / Webpaket einzurichten wird einige leidvolle Erfahrungen machen. Zwar werden mittlerweile .htaccess Dateien gelesen und interpretiert, versucht man jedoch hier php_value settings einzutragen (bzw. wenn Installationsrouteinen diese machen, siehe Drupal etc) endet das ganze mit einem Internal Server Error.

Zum Glück kann man diese in eine eigene lokale php.ini schreiben, die im Root Verzeichnis abgelegt wird.
Hat man eine Applikation, die verschiedene PHP Files in Unterverzeichnissen aufruft, dann muss die php.ini dorthin kopiert werden.
Nutzt man nun ein CMS, sollte es reichen ein php.ini im Root Verzeichnis anzulegen, da i.d.R. nur die index.php aufgerufen wird und alle anderen Dateien inkludiert.

Um zum Beispiel alsozu unterbinden, dass die PHPSSID in der URL auftaucht, also nur Cookies verwendet werden, legt man auf dem Webserver eine php.ini an und trägt folgendes ein:

session.use_only_cookies 1

session.use_trans_sid 0

Resize Virtual Box disk

Like many other users of virtual box the I had the problem that the original size of my virtual hard drive was too small. Unfortunately the the documentation of virtual box does not really help in this case. Fortuantely there are a lot of users who have proposed ways how to do it.
My favourite ist definitely tu use gparted for cloning and resizing since it’s straightforward. A very good description can be found
here
Though the screendumps are no more up-to-date, the description is still valid.
Remarks

  • First I tried to use an existing virtual drive as the new primary master. This did not work!
    The virtual drive must be created newly.
  • Before you can use the new hard drive gparted must generated a partition table for it. It will ask for it if it does not exist.
Snow Leopard and Komodo

For debugging ruby stuff with komodo the ruby.debug library is necessary.
Unfortunately the version which is provided by komodo itself is only a 32-Bit version.
But MacOS 10.6 is now mainly a 64-bit operating system.

Solution:
* rename or delete the following directory:
/Applications/Komodo IDE.app/Contents/SharedSupport/dbgp/rubylib/1.8/

* make sure you have installed the XCode Extension for Snow Leopard and downloaded the latets update for it

* install the current version of ruby-debug-base via gem:
sudo gem install ruby-debug-base

This one builds a native extension for 10.6, thats why XCode is necessary. Otherwise gem will complain on missing headers etc: e.g.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
mkmf.rb can’t find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h