plone環境構築記 その2

zopeのinitスクリプトはこんな感じ

#!/bin/sh
# zope Init script for starting up the Zope server
#
# chkconfig: - 87 12
# description: zope application server
# pidfile: /var/zope/var/Z2.pid

ZOPE="/var/zope"
ZOPE_USER="zope"
RETVAL=0

# give backoff limit in case of zope init failed.
# BACKOFF_LIMIT=120

# See how we were called.
case "$1" in
start)
echo -n "Starting zope: "
su -l $ZOPE_USER -c "$ZOPE/bin/zopectl start"
RETVAL=$?
echo
;;
stop)
echo -n "Stopping zope: "
su -l $ZOPE_USER -c "$ZOPE/bin/zopectl stop"
RETVAL=$?
echo
;;
restart)
$0 stop
$0 start
;;
status)
su -l $ZOPE_USER -c $ZOPE/bin/zopectl status
;;
*)
echo $"Usage: $0 {start|stop|restart|status}"
exit 1
;;
esac

exit $RETVAL

でinitスクリプトを登録

# sudo chmod 755 /etc/init.d/zope
# sudo chkconfig --add zope
# sudo ntsysv でzopeにチェック
で念のため/etc/init.d/start ,stop, restart の動作チェック

ようやくAPサーバの設定がおわったのでploneをインストール

ploneのインストール
# tar -xvzf Plone-2.1.1.tar.gz
# cd Plone-2.1.1/
# sudo mv ./* /var/zope/Products/
# sudo chown -R zope:zope /var/zope/Products
# sudo /etc/init.d/zope restart
ZMIのProductsフォルダにplone関連がインストールされていることを確認
ルートフォルダにてaddリストから「Plone Site」を選ぶ。
「Add Plone Site」画面でIdを英数字で入力し(「hoge」とする)、「Add Plone Site」
http://localhost:8080/hoge でポータルサイト完成

うわ。なにこれ。表組みがフォームの中でつくれるし。表の中に画像UPとか
すごすぎ。
でも。重い。fastcgiで動かさないとだめだな。これは・・・

plone環境構築記 その1

plonezope上で動くpythonでかかれたCMSです。
pythonのバージョンがmomonga謹製だと古いのでplone用にpythonを別ディレクトリにいれる。

pythonのインストール
# lftpget 'http://www.python.org/ftp/python/2.4.2/Python-2.4.2.tgz'
# tar -xvzf Python-2.4.2.tgz
# cd Python-2.4.2/
# ./configure --prefix=/usr/local/stow/python-2.4.2
# make
# sudo make install
# cd /usr/local/stow
# sudo ./bin/stow python-2.4.2
# python -V
Python 2.4.2

pythonの各種モジュールインストール
# lftpget 'http://ftp.python.jp/pub/JapaneseCodecs/JapaneseCodecs-1.4.11.tar.gz'
# tar -xvzf JapaneseCodecs-1.4.11.tar.gz
# cd JapaneseCodecs-1.4.11/
# sudo python setup.py install

# lftpget 'http://www.gembook.jp/html/download/pykf-0.3.4.tgz'
# tar -xvzf pykf-0.3.4.tgz
# cd pykf-0.3.4/
# sudo python setup.py install

Zope2.9.0のインストール
# lftpget 'http://www.zope.org/Products/Zope/2.9.0/Zope-2.9.0.tgz'
# tar -xvzf Zope-2.9.0.tgz
# cd Zope-2.9.0
# ./configure --prefix=/usr/local/stow/Zope-2.9.0 --with-python=/usr/local/bin/python
# make
# sudo make install
# cd /usr/local/stow
# sudo ./bin/stow Zope-2.9.0

Zopeの設定
# sudo adduser zope
# sudo chown -R zope:zope /var/zope
# sudo mkzopeinstance.py
Directory: /var/zope
Username: admin
Password: adminpass
Verify password: adminpass
# sudo su zope
# /var/zope/bin/zopectl start
管理画面
http://localhost:8080/manage
にadmin:adminpassでログイン
propertiesタブで"management_page_charset"をstringで"UTF-8"を追加設定

Ruby on rails 環境構築その5

やっとこさrailsをいれてみる

ダウンロードとインストール
# lftpget 'http://rubyforge.org/frs/download.php/5207/rubygems-0.8.11.tgz'
# tar -xvzf rubygems-0.8.11.tgz
# cd rubygems-0.8.11/
# sudo su
# ruby setup.rb
# gem install rails --remote --include-dependencies
Mysql5用ドライバのインストール
参考URL( http://tmtm.org/mysql/ruby/ )
# sudo mph-get install ruby-devel ruby-devel-logger ruby-eruby-devel
# lftpget 'http://tmtm.org/downloads/mysql/ruby/mysql-ruby-2.7.tar.gz'
# tar -xvzf mysql-ruby-2.7.tar.gz
# cd mysql-ruby-2.7/
# ruby extconf.rb
# make
# sudo make install
postgresql用ドライバのインストール
# gem install postgres --remote --include-dependencies

Ruby on Railes 環境構築その4

  • libpcreがはいっているか確認

# rpm -q pcre
pcre-4.5-5m

pcre-develがはいってないのでいれとく
# sudo mph-get install pcre-devel pcregrep

# lftpget 'http://www.lighttpd.net/download/lighttpd-1.4.8.tar.gz'
# tar -xvzf lighttpd-1.4.8.tar.gz
# cd lighttpd-1.4.8
# ./configure --prefix=/usr/local/stow/lighttpd-1.4.8
# sudo make install
# cd /usr/local/stow/
# sudo ./bin/stow lighttpd-1.4.8
# sudo ln -s /usr/local/sbin/lighttpd /usr/sbin/lighttpd
# cd /home/hoge/tmp/lighttpd-1.4.8
# cp doc/rc.lighttpd.redhat /etc/init.d/lighttpd
# cp doc/lighttpd.conf /usr/local/etc/
/etc/init.d/lighttpdの25行目のパスを修正
#sudo /etc/init.d/lighttpd start

Ruby on Railes 環境構築その3

  • stowのインストール

# mkdir tmp
# cd tmp
# lftpget 'ftp://ftp.gnu.org/pub/gnu/stow/stow-1.3.3.tar.gz'
# tar -xvzf stow-1.3.3.tar.gz
# cd stow-1.3.3
#./configure
# make
# sudo make install prefix=/usr/local/stow

# lftpget 'ftp://ftp.sra.co.jp/pub/cmd/postgres/8.1/postgresql-8.1.0.tar.gz'
# tar -xvzf postgresql-8.1.0.tar.gz
# cd postgresql-8.1.0/
#./configure \
--with-CXX \
--enable-depend \
--enable-thread-safety \
--prefix=/usr/local/stow/postgresql-8.1.0 \
--with-perl \
--with-tcl --with-tclconfig=/usr/lib \
--with-tkconfig=/usr/lib \
--with-python \
--enable-syslog \
--with-openssl \
--with-pam \
--mandir=/usr/share/man \
--datadir=/var/lib/pgsql \
--enable-nls
# make
# sudo make install
# cd /usr/local/stow/
# sudo ./bin/stow postgresql-8.1.0
momongaのtrunkから8.1のinitスクリプトをパチくってきて/etc/init.d/postgresqlにする
initスクリプトの中身を/usr/bin -> /usr/local/bin に修正

  • mysqlのインストール

# lftpget 'http://download.softagency.net/MySQL/Downloads/MySQL-5.0/mysql-5.0.16.tar.gz'
# tar -xvzf mysql-5.0.16.tar.gz
# cd mysql-5.0.16
# ./configure --prefix=/usr/local/stow/mysql-5.0.16 \
--enable-assembler \
--enable-local-infile \
--enable-thread-safe-client \
--without-debug \
--with-mysqld-user=mysql \
--with-charset=binary \
--with-extra-charsets=all \
--localstatedir=/var/lib/mysql
# make
# sudo make install
# cd /usr/local/stow/
# sudo ./bin/stow mysql-5.0.16
# cd /home/hoge/tmp/mysql-5.0.16
# sudo useradd -s /bin/false mysql
# sudo ./scripts/mysql_install_db
# sudo cp support-files/my-large.cnf /var/lib/mysql/my.cnf
# sudo chown -R mysql:mysql /var/lib/mysql

momongaにパケジがあったのでそれからいれる。

# sudo mph-get install fcgi libfcgi libfcgi-devel ruby-fcgi
〜中略〜
N fcgi : 2.4.0-3m
N libfcgi : 2.4.0-3m
N libfcgi-devel : 2.4.0-3m
N ruby-fcgi : 0.8.5-3m
Total 0.3Mbyte will be downloaded.
# sudo perl -MCPAN -e 'install FCGI'
# sudo perl -MCPAN -e 'install CGI::Fast'

  • phpのインストール

すでに古いのがはいってたので消してソースからいれることにする。

  • アンインストール

# rpm -qa | grep php
php-5.0.4-6m
# sudo mph-get remove php

  • インストール

# lftpget 'http://jp2.php.net/get/php-5.0.5.tar.gz/from/jp.php.net/mirror'
# mv mirror php-5.0.5.tar.gz
# tar -xvzf php-5.0.5.tar.gz
# cd php-5.0.5/
# ./configure --prefix=/usr/local/stow/php-5.0.5 \
--enable-fastcgi \
--enable-discard-path \
--enable-force-cgi-redirect \
--enable-mbstring \
--enable-mbregex \
--enable-mbstr-enc-trans \
--enable-iconv \
--enable-trans-sid \
--with-pgsql=/usr/local \
--with-mysql=/usr/local \
--with-zlib=/usr --with-zlib-dir=/usr
# make
# make test
# sudo make install
# cd /usr/local/stow
# sudo ./bin/stow php-5.0.5

Ruby On Railes 環境構築 その2

phpをしらべてみると --enable-fastcgiをつけないといけないっぽいのでRPMは使えない。
fast-cgi,lighttpdRPMもみあたらない・・・ということでソースからのインスト決定。
ruby,perlRPM版にfastcgiのライブラリを追加インストでいいのかな。
mod-fastcgiっていうパケジがあるけどこれはどうやらApachefastcgiを使うときに必要なやつらしいので関係なしと。

てことで、lighttpd,PHP,fastcgiをソースから。に決定。
インストール先は/usr/local下でいいかな。
coMomongaではRPMでいれたものは/usr配下に入るみたいなのでバッティングしないと判断。

Ruby On Railes 環境構築

いまはやりのRuby On Railesの環境をつくろうかと。
ということでRubyということでMomongaでしょうということで、
coMomongaで環境整備開始。

coMomongaをインストールした段階でRubyは入っている模様。
lighttpd + fastcgi + ruby
ついでにphp,perlfastcgiで動かすっていうのがとりあえずの目標。

さてさて。RPMでmod-fastcgiとかあるけど、
RPMをいかすべきかソースからのインストでいくべきか思案中。

まぁなにわともあれsudoでパスワードきかれるのがうざいのでNOPASSWD: ALLの設定を入れる。