Hieraki Install (Dedicated cPanel Server)

Posted by Miraenda Sun, 11 Jun 2006 09:43:00 GMT

This version of Hieraki requires Ruby 1.8.2 or later, Rails 1.0 or later with FastCGI, and MySQL 4.1 series. If your dedicated server does not already have Ruby and Rails installed on it, you can contact dedicated@lunarpages.com to request an installation. Please provide the last 4 digits of your card on file for ownership confirmation along with your dedicated server domain name or account username. Managed addon customers have 1 free script installation available to them. Non-managed addon customers would pay $75 per hour for the script. Ruby and Rails with FastCGI support takes approximately 1 hour to install.

A. Hieraki requires syntax and redcloth. These can be installed using Ruby gems via shell if you do not already have them:
gem install syntax
gem install redcloth

B. Creating your database for Hieraki:

  1. Log into cPanel and click on MySQL Databases icon:
  2. MySQL Databases
  3. As per the example below, enter hieraki in the "New Database" field under Current Databases area, then click "Create Database" button. Your full database name will then show as cPaneluser_hieraki.
  4. Curent Databases
  5. Under Current Users area as seen in the example below, enter hieraki for the "Username" field and enter a password that you write in your notes for the "Password" field, then click "Create User" button. Your full database user's name will then show as cPaneluser_hieraki.
  6. Curent Users
  7. Under Add Users to Your Database area as shown below, select in the "User" dropdown cPaneluser_hieraki and select in the "Database" dropdown cPaneluser_hieraki, then click "Add User to Database" button.
  8. Add Users to Your Databases

C. Installing Hieraki:
cd /home/user
wget http://rubyforge.org/frs/download.php/7920/hieraki-2.0.1.tgz
tar -xzf hieraki*
mv hieraki-2.0.1 hieraki
chown -R user.user hieraki

Please replace user with your cPanel username whenever user is noted.

D. Edit dispatch.fcgi to fix path to Ruby and add extra requires:
cd /home/user/hieraki/public
vi dispatch.fcgi

Change the top variable:
#!/usr/bin/ruby1.8
to
#!/usr/local/bin/ruby

Under require 'fcgi_handler', add the following:
require 'rubygems'
require_gem 'fcgi'

E. Ensure dispatch.fcgi has the right file permissions:
chmod 755 dispatch.fcgi

F. Ensure .htaccess has right dispatch.fcgi entry:
vi .htaccess

RewriteRule ^(.*)$ dispatch.cgi?$1 [QSA,L]

to
RewriteRule ^(.*)$ dispatch.fcgi?$1 [QSA,L]

G. Edit dispatch.rb file to fix path to Ruby:
cd /home/user/hieraki/public
vi dispatch.rb

Change the top variable:
#!/usr/bin/ruby1.8
to
#!/usr/local/bin/ruby

H. Importing the schema file:
cd /home/user/hieraki/db
mysql -u cPaneluser_hieraki -p cPaneluser_hieraki<schema.mysql.sql

Change cPaneluser to your cPanel username.

At the password prompt, enter the password you used when creating the database user above (Section B, Step 3).

I. Editing the database.yml file:
cd /home/user/hieraki/config
vi database.yml

J. Replace whatever it has with the following (the 2 spaces to the left of some of the lines are spaces not tabs, so do not change them to tabs):

production:
  adapter: mysql
  database: cPaneluser_hieraki
  username: cPaneluser_hieraki
  password: databaseuser password here
#  socket: /var/run/mysqld/mysqld.sock

Change cPaneluser to your cPanel username for lines 5 & 6, then change databaseuser password here to have your database user's password (the one you entered in Section H).

Please note that the last line must be commented out for socket: /var/run/mysqld/mysqld.sock as it is in the example above.

K. Move the mail.yml.example file:
cd /home/user/hieraki/config
mv mail.yml.example mail.yml

L. Replace what mail.yml has with the following:

method: :smtp
settings:
  :address: domain.com
  :port:    25
  :domain:  domain.com
 :authentication:  :login
 :user_name: cPaneluser
 :password: cPanel password

Change domain.com to your domain for lines 3 & 5, then change cPaneluser with your cPanel username, and finally change cPanel password to your cPanel password.

M. Symlink the directories (if you will be using Hieraki at http://domain.com):
cd /home/user
mv public_html public_html.bak
ln -s /home/user/hieraki/public public_html
mkdir public_html/cgi-bin
chown -R user:user public_html
chown user:nobody public_html

If you will be using Hieraki at http://domain.com/folder/, do the following instead:
cd /home/user/public_html
ln -s ../hieraki/public foldername

N. Fix enable_upload_progess error:

  1. If you go to your domain now at http://domain.com/ or http://domain.com/folder/ (depending on where you symlinked Hieraki), you would now see the following error:

    Application error

    Rails application failed to start properly"

  2. This is due to a change in the plugin enable_upload_progess. To see this is the case, you would run ./dispatch.fcgi to get the error:
    cd /home/user/hieraki/public
    ./dispatch.fcgi
  3. You should see the following return:
    ./../config/environment.rb:86: undefined method `enable_upload_progress'
    for ActionController::Base:Class (NoMethodError)
    from ./dispatch.fcgi:21
  4. To fix this, you will need to edit the environment.rb file
    cd /home/user/hieraki/config
    vi environment.rb
  5. Comment out the following line:
    ActionController::Base.enable_upload_progress
    to
    #ActionController::Base.enable_upload_progress
  6. Restart Apache:
    /etc/init.d/httpd stop
    killall -9 httpd
    /etc/init.d/httpd startssl

This fix courtesy of this blog.

O. Fix Node error:

  1. Now, if you refresh your domain install (http://domain.com/ or http://domain.com/folder), you should see a new set of errors such as the following:
    NameError in Wiki/pageController#index
    
    uninitialized constant Node
    
    RAILS_ROOT: /home/user/public_html/../config/..
    Application Trace | Framework Trace | Full Trace
    
    /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1
    /lib/active_support/dependencies.rb:123:in `const_missing'
    #{RAILS_ROOT}/app/controllers/wiki/processor
    /instruction_set.rb:8:in `lookup_root'
    
    This error occured while loading the following files:
       wiki/processor/instruction_set/node
    
    Request
    
    Parameters: {"index.html/"=>nil}
    
    Show session dump
    
    --- 
    flash: !map:ActionController::Flash::FlashHash {}
    
    
    Response
    Headers: {"cookie"=>[], "Cache-Control"=>"no-cache"}
  2. To fix this, you will need to edit the instruction_set.rb file:
    cd /home/user/hieraki/app/controllers/wiki/processor
    vi instruction_set.rb
  3. At the top of the file, add the following:
    require 'wiki/node'

This fix courtesy of http://www.hieraki.org/trac/ticket/216 for 5/23/06 post by alex_wolfe

P. Hieraki should now be working

  1. Go to your domain again, and Hieraki should be working.
  2. If Hieraki is not working, your app might be cached, so restart apache:
    /etc/init.d/httpd stop
    killall -9 httpd
    /etc/init.d/httpd startssl
  3. You can now sign up to the wiki and start creating pages. Enjoy! :)

You can see an example of Hieraki at wiki.rubyasylum.com.

Posted in  | no comments | no trackbacks

Older posts: 1 2 3 4 5 6