IMP-JP Solaris 8 へのインストール

フリーソフトウェアのコンパイル

インストール手順概要

インストール環境

PHP に必要なもろもろ

UW-IMAP 2002e の c-client のヘッダとライブラリ(アップデート時は必要なし)

% cd imap-2002e
% vi Makefile
diff -c Makefile Makefile.org 
*** Makefile    Wed Nov 26 19:26:34 2003
--- Makefile.org        Tue Jul 15 10:17:18 2003
***************
*** 149,156 ****
  # std system standard (typically passwd file), determined by port
  # two try alternative (defined by CHECKPWALT), then std

! #PASSWDTYPE=std
! PASSWDTYPE=pam


  # SSL type.  Defines whether or not SSL support is on this system
--- 149,155 ----
  # std system standard (typically passwd file), determined by port
  # two try alternative (defined by CHECKPWALT), then std

! PASSWDTYPE=std


  # SSL type.  Defines whether or not SSL support is on this system
% make gso
# cp c-client/c-client.a /usr/local/lib/libc-client.a
# cp c-client/rfc822.h /usr/local/include/
# cp c-client/mail.h /usr/local/include/
# cp c-client/linkage.h /usr/local/include/

gnu gettext 0.14.5

% cd gettext-0.14.5
% ./configure
% make
# make install

libmcrypt-2.5.7

% cd libmcrypt-2.5.7
% ./configure
% make

エラー?

% make clean;make  (なんで 2回目は通る?)
# make install

php 4.4.2

http://jp.php.net/get/php-4.4.2.tar.gz/from/this/mirror

  % ./configure --with-apxs2=/usr/local/apache2/bin/apxs \
    --enable-mbstring --enable-mbregex \
    --with-openssl=/usr/local/ssl \
    --with-imap=/usr/local --with-imap-ssl=/usr/local \
    --with-zlib=/usr/local \
    --with-gettext=/usr/local \
    --with-xml \
    --with-mcrypt=/usr/local \
    --with-mysql=/usr/local/mysql
  % make
  # make install

ここで,PEAR 関係のエラーが出る.

http://bugs.php.net/bug.php?id=36002 の情報を参考に,

cd php-src/pear/packages
wget http://pear.php.net/get/Archive_Tar-1.3.1.tar
wget http://pear.php.net/get/Console_Getopt-1.2.tar
wget http://pear.php.net/get/HTML_Template_IT-1.1.tar

をして,make をやり直す.

  # cp php.ini-recommended /usr/local/lib/php.ini

編集

  [PHP]
  output_buffering = Off

  [mbstring]
  mbstring.language = Japanese
  mbstring.internal_encoding = EUC-JP
  mbstring.http_input = auto
  mbstring.http_output = EUC-JP
  mbstring.encoding_translation = On
  mbstring.detect_order = auto
  mbstring.substitute_character = none;

/opt/apache/conf/httpd に

  AddType application/x-httpd-php .php .phtml

という行を付け加える.

また DirectoryIndex 行に index.php を加える.

ex.)

  DirectoryIndex index.html index.html.var index.php

PEAR モジュール

PEAR での proxy 設定

 # pear config-show

 HTTP Proxy Server Addrss http_proxy <not_set>

を確認する.

# pear config-set http_pxory XXX.XXX.XXX.XXX:YYYY

として,設定.

Log-1.8.2

  # pear install --alldeps Log

Mail_Mime-1.2.1

  # pear install Mail_Mime

Net_Socket-1.1

  # pear install Net_Socket
  Package 'Net_Socket' already installed, skipping

その他

/* snip   Horde のモジュール? kronolith のときにいる
 *Date_Calc
 *HTML_Common
 *HTML_Select
*/

IMP

Horde

# cd /usr/local/apache2/htdocs
# gzcat horde-2.2.1-jp-0.2.tgz | tar xvf -
# mv horde-2.2.1-jp-0.2 horde             
# chown -R root:sys horde

horde用のデータベースを作成

# vi +23 horde/scripts/db/mysql_create.sql

で 23行目のパスワードを変更(********)

# mysql --user=root -p < horde/scripts/db/mysql_create.sql

horde の設定ファイル

# cd horde/config/
# for foo in *.dist; do cp $foo `basename $foo .dist`; done
# vi horde.php
$conf['log']['type'] = 'syslog';  // 116行目

$conf['log']['name'] = LOG_LOCAL1;  // 123行目

$conf['prefs']['driver'] = 'sql';   //148行目

$conf['prefs']['params']['phptype'] = 'mysql';       //157-162行目
$conf['prefs']['params']['hostspec'] = 'localhost';
$conf['prefs']['params']['username'] = 'horde';
$conf['prefs']['params']['password'] = 'r*******n';  //<--パスワード
$conf['prefs']['params']['database'] = 'horde';
$conf['prefs']['params']['table'] = 'horde_prefs';

$conf['mailer']['type'] = 'sendmail';  //204 行目


//$conf['mailer']['params'] = array();
//$conf['mailer']['params'] = array('sendmail_path' => '/usr/lib/sendmail');
$conf['mailer']['params'] = array('host' => 'mailhost.******.jp');

                                                       // 211-213 行目
# chown apache:apache horde.php
# chmod 400 horde.php

http://localhost/horde/test.php にアクセスしてテスト.

テスト後は

# chmod 400 をしておく

IMP

# cd /opt/apache/htdocs/horde
# gzcat imp-3.2.1-jp-0.1.tgz | tar xvf -
# mv imp-3.2.1-jp-0.1 imp
# chown -R root:sys imp

horde のログインを IMP に統一

# vi +23 horde/config/registry.php
$this->registry['auth']['login'] = 'imp';    //コメントを外す
$this->registry['auth']['logout'] = 'imp';

IMP のステータスを active に

# vi +109 horde/config/registry.php
  'status' => 'active'

IMP の設定ファイル

 # cd horde/imp/config/
 # for foo in *.dist; do cp $foo `basename $foo .dist`; done

conf.php はマージする必要があり.prefs.php は微妙.

IMP 全般の設定

# vi conf.php
$conf['menu']['apps'] = array('turba');

$conf['msg']['append_trailer'] = false;

接続先 IMAP サーバの設定.

# vi server.php
$servers['imap'] = array(
    'name' => 'IMAP Server',
    'server' => 'mailhost.*******.jp',
    'protocol' => 'imap/notls',
    'port' => 143,
    'folders' => 'mail/',
    'namespace' => '',
    'maildomain' => 'up.*****.jp',
    'smtphost' => 'mailhost.******.jp',
    'realm' => 'up.*****.jp',
    'preferred' => ''
);

ゴミ箱を使う設定

# vi prefs.php
// should we move messages to a trash folder instead of just marking
// them as deleted?
// a value of 0 = no, 1 = yes
$_prefs['use_trash'] = array(
    'value' => 1,               //<--- 0 を 1に変える
    'locked' => false,
    'shared' => false,
    'type' => 'checkbox',
    'desc' => _("When deleting messages, move them to your Trash folder insteadof marking them as deleted?")
);

メールアドレスをアドレス帳に加える設定

$_prefs['add_source'] = array(
//    'value' => '',
 'value' => 'localsql',
   'locked' => false,
   'shared' => false,
   'type' => 'implicit'
);

IMP テスト

http://localhost/horde/imp/test.php にアクセスしてテスト.

テスト後は

chmod 400

をしておく

turba

# cd horde
# gzcat turba-1.2-jp-0.2.tgz | tar xvf -
# mv turba-1.2-jp-0.2/ turba
# chown -R root:sys turba

Hordeの導入で作成したデータベースに,Turba用テーブルを追加.

# /usr/local/mysql/bin/mysql --user=root -p horde \
  < turba/scripts/drivers/turba.sql

Turba の設定

# cd turba/config/
# for foo in *.dist; do cp $foo `basename $foo .dist`; done

sources.php はマージする必要があり.prefs.php は微妙.

# vi conf.php
 $conf['menu']['apps'] = array('imp');  // 31行目
# vi +140 sources.php
$cfgSources['localsql'] = array(
    'title' => 'My Addressbook',
    'type' => 'sql',
    'params' => array(
        'phptype' => 'mysql',
        'hostspec' => 'localhost',
        'username' => 'horde',
        'password' => 'r******n',
        'database' => 'horde',
        'table' => 'turba_objects'
    ),

また,$cfgSources['localsql'] と $cfgSources['prefs'] 以外の ブロックはコメントアウトしておく.

# chown apache sources.php
# chmod 400 sources.php

Horde に Turba を登録

# vi +118 horde/config/registry.php
 'name' => _("Address Book"),
 'allow_guests' => false,
 'status' => 'active'           //<-- この行

その他

syslog

/usr/local/apache2/bin/logrotation.sh

#!/bin/sh
HTTP_PID=/usr/local/apache2/logs/httpd.pid
GZIP="/usr/bin/gzip -9"
DAY=`date +%d`
MON=`date +%m`
MON=`expr $MON - 1`
YEAR=`date +%Y`
#YEAR=`date +%y`  # %y -- 98,99,00,(;_;).  %Y -- 1997,1998,1999,2000,(^.^) 

#if [ "$DAY" != "01" ]; then
#    exit 0;
#fi

if [ "$MON" = "0" ]; then
    MON=12
    YEAR=`expr $YEAR - 1`
fi

MONFLAG=`expr ${MON} \< 10`
if [ "$MONFLAG" = "1" ]; then
        MON=0${MON}
fi

cd /usr/local/apache2/logs
mv access_log    access_log.$YEAR$MON
mv error_log     error_log.$YEAR$MON
#mv agent_log     agent_log.$YEAR$MON
mv ssl_request_log      ssl_request_log.$YEAR$MON
mv horde.log    horde.log.$YEAR$MON
touch horde.log
kill -HUP `cat $HTTP_PID`
kill -HUP `cat /etc/syslog.pid`


${GZIP}  access_log.${YEAR}${MON}
${GZIP}  error_log.${YEAR}${MON}
#${GZIP}  agent_log.${YEAR}${MON}
${GZIP} ssl_request_log.${YEAR}${MON}
${GZIP}  horde.log.${YEAR}${MON}

#

/etc/syslog.confの最後に

  local1.info                               /usr/local/apache2/logs/horde.log

preference2.pl 用 DB 作成

 % /usr/local/mysql/bin/mysql -u horde -p******* -e "CREATE TABLE horde_fromaddr \
	(user char(255) NOT NULL, fromaddr char(255) NOT NULL, \
	fullname char(255) DEFAULT '')" horde

preference2.pl の修正

bash-2.03$ diff preference2-tnk.pl preference2.pl 
1c1
< #!/usr/bin/perl -w
---
> #!/usr/local/bin/perl -w
21c21
< my $mysql = "/usr/local/mysql/bin/mysql";
---
> my $mysql = "/usr/local/bin/mysql";
23c23
< my $password = "********";
---
> my $password = "XXXXXXXX";
28d27
< my $domain = "******.jp";
59c58
<         system("$mysql -u $user -p$password -e \"delete from $pref_table where pref_uid='$username\@$domain'\" $db");
---
>         system("$mysql -u $user -p$password -e \"delete from $pref_table where pref_uid='$username\@localhost'\" $db");
61c60
<         system("$mysql -u $user -p$password -e \"delete from $addr_table where owner_id='$username\@$domain'\" $db");
---
>         system("$mysql -u $user -p$password -e \"delete from $addr_table where owner_id='$username\@localhost'\" $db");

Zend Optimizer

ZendOptimizer-2.6.2-sunos5.8-sparc.tar.gz を展開して,

./install

トップ   編集 凍結 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2010-09-23 (木) 09:59:11