カテゴリー
FreeBSD Software

FreeBSD (apcupsd)

/usr/ports/sysutils/apcupsd

言わずと知れたUPSのコントロールソフト。

# cd /usr/ports/sysutils/apcupsd
# portinstall

Options選択はCGIとSNMPにX印を入れて続行。

終わったら/usr/local/etc/apcupsdでapcupsd.confの作成

今回はapcupsd.conf.net-master.sampleをapcupsd.confにコピーして編集する。一台だけの独立したサーバーなのでスタンドアローンの設定にするだけにする。バッテリーの保持時間とかの細かな設定は後回し。SMART-UPS 700にDELLのSC430のシリアル接続。

# diff apcupsd.conf apcupsd.conf.net-master.sample
5,7c5,7
< UPSCABLE smart
< UPSTYPE apcsmart
< DEVICE /dev/ttyd0
---
> UPSCABLE 940-1524C
> UPSTYPE smartups
> DEVICE /dev/usv
21,22c21,22
< UPSCLASS standalone
< UPSMODE disable
---
> UPSCLASS netmaster
> UPSMODE net

/etc/rc.confに下記追記

# apcupsd
apcupsd_enable="YES"
apcupsd_program="/usr/local/sbin/apcupsd"

rehashして/usr/local/etc/rc.d/apcupsd startで起動。

/usr/local/etc/apcupsd/cgi下を/usr/local/www/apache22/cgi-binにapcupsdディレクトリを作ってコピー。

http://www.ほげほげ/cgi-bin/apcupsd/multimon.cgi でUPSの状態を見れるようにする。

今度のサーバーのUPSはSMART-UPS 700を使っているが、温度が40℃を超えている。長寿命バッテリーを奮発したとは言え夏場の高温での劣化が今から心配。手元のサーバーのUPSはSMART-UPS 2200で約30℃。筐体の余裕の違いだろうなぁ。。。

参考URL 1

カテゴリー
FreeBSD Software Squirrelmail

FreeBSD (Squirrelmail)

/usr/ports/mail/squirrelmail

以前は/user/ports/japanese/に日本語版が置いてあったが今はここのみに置いてあるみたい。

日本語版本家では1.4.5で止まっているけど、portsのは1.4.8。とりあえずportsで入れてみる。

# cd /usr/ports/mail/squirrelmail
# portinstall

その後、/usr/local/www/squirrelmailに降りて、

# cd /usr/local/www/squirrelmail
# ./configure

で各種設定を行う。

日本語を使うなら、 メニュー10番目のLanguageの所を

Language preferences
1.  Default Language       : ja_JP
2.  Default Charset        : iso-2022-jp
3.  Enable lossy encoding  : false

でOK。あと、メニュー2番目のServer SettingsでIMAPサーバーを選択すれば使えるようになります。ウチはuw IMAPなのでこんな感じ。

IMAP Settings
--------------
4.  IMAP Server            : localhost
5.  IMAP Port              : 143
6.  Authentication type    : cram-md5
7.  Secure IMAP (TLS)      : false
8.  Server software        : uw
9.  Delimiter              : detect

あとは、適当に好みで。

apacheの設定は、SSLで使いたかったのでIncludesに置いたhttpd-ssl.confに下記を追記。

<code>Alias /webmail "/usr/local/www/squirrelmail"</code>
AllowOverride All
Options FollowSymLinks ExecCGI Includes
Allow from All

これで https://wwwほげほげ/webmail で使えるようになる。
ところが、 返信とかすると下記のようなウォーニングが。

Warning: preg_split() expects parameter 4 to be long, string given in /usr/local/www/squirrelmail/functions/imap_messages.php on line 808Warning: Invalid argument supplied for foreach() in/usr/local/www/squirrelmail/functions/mime.php on line 52

ぐぐってみたらパッチ発見。

http://www.hmailserver.com/forum/viewtopic….

http://sourceforge.net/tracker/index.php?func=detail&aid=1543573…..

# diff imap_messages.php.org imap_
messages.php
808c808
&lt; $flags = preg_split('/ /', $regs[1],-1,'PREG_SPLIT_NI_EMPTY');
---
&gt;                 $flags = preg_split('/ /', $regs[1],-1,PREG_SPLIT_NO_EMPTY);

これで解決。

カテゴリー
Apache FreeBSD PHP Software

FreeBSD (PHP5)

/usr/ports/lang/php5

# portinstall lang/php5
# cat /var/db/ports/php5-extensions/options

# This file is auto-generated by ‘make config’.
# No user-servicable parts inside!
# Options for php5-5.2.0
_OPTIONS_READ=php5-5.2.0
WITH_CLI=true
WITH_CGI=true
WITH_APACHE=true
WITHOUT_DEBUG=true
WITH_SUHOSIN=true
WITH_MULTIBYTE=true
WITHOUT_IPV6=true
WITHOUT_REDIRECT=true
WITHOUT_DISCARD=true
WITH_FASTCGI=true
WITH_PATHINFO=true

/usr/ports/lang/php5-extensions

# portinstall lang/php5
# cat /var/db/ports/php5-extensions/options

# This file is auto-generated by ‘make config’.
# No user-servicable parts inside!
# Options for php5-extensions-1.0
_OPTIONS_READ=php5-extensions-1.0
WITHOUT_BCMATH=true
WITH_BZ2=true
WITH_CALENDAR=true
WITH_CTYPE=true
WITHOUT_CURL=true
WITHOUT_DBA=true
WITHOUT_DBASE=true
WITH_DOM=true
WITHOUT_EXIF=true
WITHOUT_FILEINFO=true
WITHOUT_FRIBIDI=true
WITH_FTP=true
WITH_GD=true
WITH_GETTEXT=true
WITHOUT_GMP=true
WITH_HASH=true
WITH_ICONV=true
WITHOUT_IMAP=true
WITHOUT_INTERBASE=true
WITHOUT_LDAP=true
WITH_MBSTRING=true
WITHOUT_MCRYPT=true
WITHOUT_MHASH=true
WITHOUT_MING=true
WITHOUT_MSSQL=true
WITH_MYSQL=true
WITHOUT_MYSQLI=true
WITHOUT_NCURSES=true
WITHOUT_ODBC=true
WITHOUT_OPENSSL=true
WITHOUT_PCNTL=true
WITH_PCRE=true
WITH_PDF=true
WITH_PDO=true
WITHOUT_PGSQL=true
WITH_POSIX=true
WITHOUT_PSPELL=true
WITHOUT_READLINE=true
WITHOUT_RECODE=true
WITH_SESSION=true
WITHOUT_SHMOP=true
WITH_SIMPLEXML=true
WITHOUT_SNMP=true
WITHOUT_SOAP=true
WITHOUT_SOCKETS=true
WITH_SQLITE=true
WITHOUT_SYBASE_CT=true
WITHOUT_SYSVMSG=true
WITHOUT_SYSVSEM=true
WITHOUT_SYSVSHM=true
WITHOUT_TIDY=true
WITH_TOKENIZER=true
WITHOUT_WDDX=true
WITH_XML=true
WITH_XMLREADER=true
WITHOUT_XMLRPC=true
WITH_XMLWRITER=true
WITHOUT_XSL=true
WITHOUT_YAZ=true
WITH_ZIP=true
WITH_ZLIB=true

/usr/local/etc/apache22/httpd.confに下記追記

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

同じく、index.phpをDeirectoryIndexに追記

DirectoryIndex index.php index.html index.htm
カテゴリー
Apache FreeBSD Software

FreeBSD (Apache2.2 : httpready)

「[warn] (2)No such file or directory: Failed to enable the ‘httpready’ Accept Filter」と言ってApacheに怒られた。

ちょっとググってみたらビンゴなページがあった。感謝。

# kldload accf_http.ko

or
「/boot/loader.conf」に

accf_http_load=”YES”

を追加。

カテゴリー
FreeBSD Software

FreeBSD (wget4web)

# portinstall www/wget4web

で一発。

あらかじめApacheが入っていないとApacheのインストールから始めようとするので要注意。 あとでApache2.2を入れるつもりだったのがApache1.3xを入れようとするのでちょっと焦った。