YMLib Systems Librarian

一些設定的記錄

我的相片
名稱:
位置: WuGu, Taipei, Taiwan

我是個大光頭,因我的頭型適合這一型。I have a perfect head style.

星期六, 9月 01, 2007

Fedora 7 + Ruby on Rails + Lighttpd + FastCGI + MySQL

1.
after mini-install Fedora 7,
remove the following rpm packages:
yum remove
bluez-gnome
bluez-utils
bluez-libs
isdn4k-utils
dhcpv6_client
kernel
hal
NetworkManager
autofs
firstboot-tui
smartmontools
ConsoleKit
hal-info
kudzu
system-config-network-tui
nfs-utils
rpcbind
ypbind
yp-tools
irda-utils
nss_ldap
nscd
ifd-egate
coolkey
ccid
pcsc-lite
gpm
iptables-ipv6
system-config-securitylevel-tui
redhat-lsb
cups
mdadm
dhcdbd

2.
then install the following packages:
yum install
ruby-libs.i386 1.8.6.36-3.fc7
ruby-sqlite3.i386 1.1.0-6.fc6
ruby.i386 1.8.6.36-3.fc7
ruby-irb.i386 1.8.6.36-3.fc7
ruby-rdoc.i386 1.8.6.36-3.fc7
rubygems.noarch 0.9.2-1.fc7
mysql-libs.i386 5.0.37-2.fc7
ruby-mysql.i386 2.7.1-2.fc6
ncftp.i386 2
lynx.i386 2.8.6-3.fc7
ntp.i386 4.2.4p2-3.fc7
lua.i386 5.1.2-1.fc7
lighttpd.i386 1.4.16-1.fc7
lighttpd-fastcgi.i386 1.4.16-1.fc7
perl-DBI.i386 1.53-2.fc7
mysql.i386 5.0.37-2.fc7
perl-DBD-MySQL.i386 3.0008-1.fc7
mysql-server.i386 5.0.37-2.fc7
apr.i386 1.2.8-6
gmp.i386 4.1.4-12.3
php-common.i386 5.2.2-3
php-cli.i386 5.2.2-3
apr-util.i386 1.2.8-7
httpd.i386 2.2.4-4.1.fc7
php.i386 5.2.2-3
php-pdo.i386 5.2.2-3
php-mysql.i386 5.2.2-3
php-mbstring.i386 5.2.2-3
ruby-devel.i386 1.8.6.36-3.fc7
cpp.i386 4.1.2-12
kernel-headers.i386 2.6.22.4-65.fc7
glibc-headers.i386 2.6-4
glibc-devel.i386 2.6-4
gcc.i386 4.1.2-12
libmcrypt.i386 2.5.7-5.fc6
php-mcrypt.i386 5.2.1-1.fc7

3.
gem install rails
chkconfig mysqld on
chkconfig lighttpd on
service mysqld start
mysqladmin -u root password 'secret'
vi /etc/lighttpd/lighttpd.conf
great configuring lighttpd sample:
http://blog.roodo.com/syshen/archives/2141166.html

4.
gem install fcgi always fails
according to:
http://www.robmagnanti.com/2006/06/16/ruby-on-rails-apache-2-and-fastcgi/

wget http://www.fastcgi.com/dist/fcgi.tar.gz
cd fcgi-2.4.0
./configure
make
make install
gem install fcgi -- --with-fcgi-include=/usr/local/include \
--with-fcgi-lib=/usr/local/lib
gem install fcgi -- --with-fcgi-include=/usr/local/include --with-fcgi-lib=/usr/local/lib

fastcgi is installed in ruby.

5.
dump mysql data from old site by phpmyadmin,
then import to new site mysql by phpmyadmin.
there are some problem about view chinese characters.
http://benlee.tw/blog/?p=263

edit application.rb
class ApplicationController < ActionController::Base
before_filter :configure_charsets
def configure_charsets
suppress(ActiveRecord::StatementInvalid) do
ActiveRecord::Base.connection.execute 'SET NAMES utf8'
end
end
end

solves the problem about chinese characters.

標籤: , , , , , ,