Autofaucets.ru - автоматический сборщик криптовалюты с кранов!

HowTo Install typo on Red Hat EL3

Posted by Cooper Tue, 04 Jul 2006 10:52:00 GMT

Here is a typo installation guide based on the folowing: http://www.typosphere.org/trac/wiki/TypoOnFreebsd

1. Install Ruby 1.8.4

Download and install ruby from the stable release 1.8.4 http://www.ruby-lang.org/en/20020102.html

2. Install gems

$cd
$wget http://rubyforge.org/frs/download.php/5207/rubygems-0.8.11.tgz
$tar xvzf rubygems-0.8.11.tgz
$cd rubygems-0.8.11
$ruby setup.rb

3. Install Rails

$gem update
$gem install rails --include-dependencies 

4. Download and install FastCGI Development Kit

$ wget fastcgi.com/dist/fcgi-2.4.0.tar.gz | tar xfz -
$ copy fcgi-2.4.0 /usr/local/src/fcgi-2.4.0
$ cd /usr/local/src/fcgi-2.4.0
$ ./configure
$ make
$ sudo make install

5. Install FCGI bindings for Ruby

$ sudo gem install fcgi

6. Download and Install typo

# /usr/sbin/adduser typo_user
# passwd typo_user 
$ svn checkout svn://leetsoft.com/typo/trunk typo
$ cp -R typo /home/typo_user/websites/www.mysite.com

7. Configuring Typo

Replace

/usr/bin/env ruby 

with

/usr/local/bin/ruby 

in

public/dispatch.fcgi
and
public/dispatch.rb
.

8. Database

8.1 Install Ruby/MySQL

(http://www.tmtm.org/en/mysql/ruby/)

8.2 Create database in MySQL

mysql -p
create database typo_user_typo CHARACTER SET utf8;
grant all on typo_user_typo.* to 'typo_user'@'localhost' \
identified by 'typo_password';
flush privileges;
use typo_user_typo;
source /home/typo_user/websites/www.mysite.com/db/schema.mysql.sql;

Edit config/database.yml:

login: &login
  adapter: mysql
  host: localhost
  username: typo_user
  password: typo_password
  socket: /var/lib/mysql/mysql.sock
  encoding: utf8

development:
  database: typo_user_typo
  <<: *login

test:
  database: typo_user_typo
  <<: *login

production:
  database: typo_user_typo
  <<: *login

8.3 Update the database-schema

$rake migrate

9. Lighttpd

Download from http://www.lighttpd.net/download/lighttpd-1.4.11.tar.gz Extract to /usr/local/src/lighttpd-1.4.11

$ cd /usr/local/src/lighttpd-1.4.11
$ ./configure
$ make
$ su -
# make install
# exit

Copy config-file from /home/typo_user/websites/www.mysite.com/config to /etc/lighttpd/lighttpd.conf and then edit:

server.pid-file             = "/var/run/typo-typo_user.pid"
server.port                 = 3000
server.bind                 = "127.0.0.1"
#server.event-handler        = "freebsd-kqueue"
server.name                 = "www.mysite.com"

server.modules              = ( "mod_rewrite", "mod_fastcgi", "mod_accesslog" )
server.indexfiles           = ( "dispatch.fcgi" )
server.document-root        = "/home/typo_user/websites/www.mysite.com/public"
server.error-handler-404    = "/dispatch.fcgi"
server.errorlog             = "/home/typo_user/websites/www.mysite.com/log/error.log"
accesslog.filename          = "/home/typo_user/websites/www.mysite.com/log/access.log"

url.rewrite = ( "^/$" => "index.html", "^([^.]+)$" => "$1.html" )

#### fastcgi module
fastcgi.server =  (
   ".fcgi" => (
        "typo" => (
               "min-procs" => 4,
               "max-procs" => 4,
               "socket" => "/home/typo_user/websites/www.mysite.com/tmp/typo-typo_user.socket",
               "bin-path" => "/home/typo_user/websites/www.mysite.com/public/dispatch.fcgi",
               "bin-environment" => ("RAILS_ENV" => "production" ),
               "idle-timeout" => 120
                )
           )

Copy /usr/local/src/lighttpd-1.4.11/doc/rc.lighttpd.redhat to /etc/rc.d/init.d/lighttpd. Replace the line

lighttpd=”/usr/sbin/lighttpd”

with

lighttpd=”/usr/local/sbin/lighttpd”

Start lighttpd server /etc/rc.d/init.d/lighttpd start

Posted in , ,  | Tags , , ,