Mephisto - installing

In this article we will install the Ruby on Rails based Mephisto blogging system.

We'll install the svn version so we have facilities for plugins and further expansion of our new install.

We'll start by installing any dependencies that Mephisto may need and then, using our Virtual Host Layout as a guide (see this article), we'll download the svn version of Mephisto into the public_html folder.

If you have not created a public_html folder then, following the Layout described in the article above, create one with the command:

mkdir ~/public_html

Now the base directory for our Virtual Host Layout has been created we can install Mephsito:

cd ~
sudo gem install tzinfo --remote

Now we need some dependencies for the rmagick modules or uploading images and creating thumbnails will not work:

sudo apt-get install libmagick9-dev -y
sudo gem install rmagick --include-dependencies

That's the basics completed so move into the public_html folder and download Mephisto. Don't forget to replace railsdomain.com with whatever domain you will be using. For example, if this site was based on Mephisto (which is is!) I would probably use usefuljaja.com at the end of the command:

cd public_html
svn co http://svn.techno-weenie.net/projects/mephisto/trunk railsdomain.com

Now that we have Mephisto on our server, we'll adjust some configuration files and bootstrap the application to a production environment:

cd railsdomain.com

Create the database that this install will use. In this example I've used the name railsdomain. You can call it mephisto or whatever you like but I find it easier to keep the database name the same as the website name. It saves a lot of confusion when you have multiple Mephisto installs on one server and they are called mephisto1, mephisto2, etc:

mysql -u root -p
# enter your mysql root password
create database railsdomain;
quit

The 'quit' command places you back at your normal terminal output. Now we need to configure the database file:

nano config/database.yml

As this install is going to be in a production environment straight away, all we need in the database file is:

production:
  adapter: mysql
  database: railsdomain
  username: root
  password: mysqlrootpassword
  host: localhost

Now we need to customise the environment.rb:

nano config/environment.rb

Remove the # symbol (uncomment) from the fourth line so it reads:

ENV['RAILS_ENV'] ||= 'production'

Further down is the line 'UserMailer.mail_from = 'webmaster@localhost'. Change the email address to one your website will use:

UserMailer.mail_from = 'webmaster@railsdomain.com'

Now we can bootstrap the application:

rake db:bootstrap RAILS_ENV=production

This will output the creation of the tables in our railsdomain database and finish with a nice 'Thank you for trying out Mephisto 0.7.3: Noh-Varr Edition!' and some links for official help.

That's the Mephisto install completed.

Now it's installed, this article will concentrate on serving Mephisto (or any Ruby on Rails based application) with Litespeed.

PickledOnion.

Digg it | del.icio.us | reddit | StumbleUpon

Article Comments:

Frederico 21 Aug, 2007

Hey, thanks for writing this nice tutorial. I'm having this problem that I can't solve and thought you might have some tips. I install Mephisto fine and I get as far as the homepage, with everything working ok. But, when I go to the admin page and login, I get redirected to an error page. I've checked the production.log and can't seem to understand what's wrong. Has this problem come to you before? Could it be something related to Litespeed? Thanks!

Frederico 21 Aug, 2007

As it turns out, I forgot to install the tzinfo gem. My bad :o)

PickledOnion 21 Aug, 2007

Frederico,

Glad things worked out OK.

PickledOnion.

Nick 14 Sep, 2007

For some reason i can't bootstrap the application using:

rake db:bootstrap RAILS_ENV=production

i either get command not found if i run it from bash or unexpected tCONSTANT, expecting $ (pointing to the "=" sign) if i run it from irb

PickledOnion 14 Sep, 2007

Nick,

There have been quite a few changes in the Mephisto code during the past couple of weeks.

You will need to install edge rails to ensure it works correctly.

So once you have downloaded Mephisto and moved into the directory, i.e. after: cd railsdomain.com

you will need to issue this command: rake rails:freeze:edge

It should work ok then. Be aware that some of the plugins may also need some adjustment (such as email notification).

I hope to get a new set out at some point but it won't be very soon I'm afraid.

PickledOnion.

Donovan Dillon 27 Sep, 2007

I have followed PickledOnion's instructions from DNS setup to this point with zero issues. However, I think I hosed things up after trying to fix the following two problems:

  1. after executing 'rake db:bootstrap RAILS_ENV=production', 'script/server' starts webrick on my slice - ???

  2. going to mydomain.com/admin and logging in with 'admin/test' results in login problem that Fredrico described

I tried to fix them using 'rake rails:freeze:edge'. This is apparently a big faux pas since 'rake db:bootstrap RAILS_ENV=production' ...

...now gives me the following error:

(in /home/user/public_html/mydomain.com) mkdir -p /home/user/public_html/mydomain.com/log rake aborted! uninitialized constant ActionWebService::Base::Reloadable

(See full trace by running task with --trace)

Sorry for the idiocy. Please Help!

PickledOnion 28 Sep, 2007

Donovan,

No idiocy involved at all :)

There does seem to be an issue with Mephisto at the moment - they are committing some big changes that do break previous changes, etc, etc.

At the moment I have no solution as it breaks for me as well and I haven't had time to debug yet.

However, if you are not too concerned about plugins, you could use the stable version (the stable version does not support plugins without hacking about in the code).

The svn version I use in the article was very stable for some time so I had no concerns about using it - however, this seems to have changed recently.

Try this link: http://mephistoblog.com/download and see if v.0.7.3 is better for your needs.

Hopefully, the Mephisto team will produce a newer release with plugins support, etc soon.

PickledOnion.

Donovan Dillon 28 Sep, 2007

Thx PickledOnion,

I got it to work on edge/edge! The following steps (slightly modified) were found on the Mephisto Blog Google Group:

$ cd appDirectory $ rake rails:freeze:edge REVISION=7472 $ ./script/plugin install http://dev.rubyonrails.org/svn/rails/plugins/acts_as_list/ $ rake db:bootstrap RAILS_ENV=production $ .script/server

I only executed the first 3 commands —as the 4th starts Webrick on my slice. I now have Mephisto Edge working with Rails edge Rev 7472.

There are several plug-ins outlined in your excellent Mephisto guides that I want to install. Do you think it is safe to stay on the edge now that it is working, or is it advisable to step back to stable/stable given the funky plug-in support in 0.7.3?

Comments are closed for this article.