Howto install Webistrano on Ubuntu 14.04.1 LTS

First of all, i know Webistrano is an old project. The last commit on this project has been made 3 years ago. But it works fine for my needs.

This is a step by step howto on how to install Webistrano on a fresh clean install of ubuntu 14.04.01 LTS. Therefore i assume you have nothing but a clean install.

You need to be logged in with a user which can do sudo, but not as root !

install needed software

sudo apt-get update
sudo apt-get install -y screen git build-essential curl mysql-server mc libmysqlclient-dev ruby-dev ruby1.9.1-full
sudo gem install capistrano

create mysql database for webistrano

here we create a database and a user webbistrano with a password. I suggest changing the password because „password“ is not realy safe 😉

mysql -uroot -ppassword
mysql> CREATE DATABASE `webistrano_production`;
mysql> CREATE USER 'webistrano'@'localhost' IDENTIFIED BY 'password';
mysql> GRANT ALL PRIVILEGES ON `webistrano_production`.* TO 'webistrano'@'localhost' WITH GRANT OPTION;
mysql> quit

create a folder where to install webistrano

mkdir /var/www
mkdir /var/www/webistrano
cd /var/www/webistrano

clone the latest version of webistrano

the official repository at git:// contains some errors which will prevent webistrano from running correctly, i therefore forked the original repository and fixed those issues.

git clone .

prepare configuration files

cp /var/www/webistrano/config/webistrano_config.rb.sample /var/www/webistrano/config/webistrano_config.rb
cp /var/www/webistrano/config/database.yml.sample /var/www/webistrano/config/database.yml

make public folder writeable

chmod -R 755 /var/www/webistrano/public

change database config

use your favorite editor to change settings as in the example below.

vi /var/www/webistrano/config/database.yml

  adapter: mysql
  database: webistrano_production
  username: root ==> webistrano
  password:      ==> your_super_secret_password
  socket: /tmp/mysql.sock ==> /var/run/mysqld/mysqld.sock

install bundler

to make webitrano work we need an old version of bundler. If you have already a new version installed, uninstall it. (again, i suggest you have a clean install with no other software installed)

sudo gem uninstall bundler
sudo gem install bundler --version=1.0.10
bundle install

install rake

same thing for rake, we need an old version of it

sudo gem uninstall rake -v 10.4.2
sudo gem install rake -v 0.8.7

edit Gemfile

now we need to specifiy the installed version of rake in the Gemfile. to do so open Gemfile with your favorite editor and change the line gem „rake“ as below

vi Gemfile
gem "rake" ==> gem "rake", "0.8.7"
bundle update rake
bundle install

Migrate database

this will create the needed database structure for environment production.

bundle exec rake db:migrate --trace RAILS_ENV=production

That’s it, run websitrano

In this example i run webistrano with the build in server. this is certainly not the best solution but for me it is ok. You could use Mongrel or whatever fits your need

ruby script/server -p 3000 -e production #to debug

ruby script/server -d -p 3000 -e production #as a daemon

You can now access webistrano like, as login and password you can use admin:admin

You have not the latest version of webistrano running, that’s cool but. For me it did not realy work still, i had to make some modifications in the code to make deployment work. I will post my changes in another post soon.

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind markiert *