の形で呼ぶ。
//
// anchor_idはフレームを使う場合最低限各フレームごとに設定。お互い他のフレームを書換えたときにへんな干渉をさけるため。
// その他ページの種別毎などで変えてもよいが、あまり小分けにするとcookieが増える。
// 同じanchor_idで保存されるcookieは1セットのみ。でも単独ページ表示のサイトなら概ねこれで充分。
anchor_id = "anc_main";
noanchor = false; // bodyにanchorをしかけたときなど場合によって一時無効にするためのフラグ。
// アンカーの記憶。
function anchor_save(object_id, page_id) {
if(noanchor) { anchor_erase(); return; }
get_scroll();
setcookie(anchor_id+"_pid", page_id, 0);
setcookie(anchor_id+"_st", scroll_top, 0);
setcookie(anchor_id+"_sl", scroll_left, 0);
if(object_id) {
object_top = scroll_top + get_object_top(object_id);
object_left = scroll_left + get_object_left(object_id);
setcookie(anchor_id+"_oid", object_id, 0);
setcookie(anchor_id+"_ot", object_top, 0);
setcookie(anchor_id+"_ol", object_left, 0);
} else {
setcookie(anchor_id+"_oid", "", -1);
setcookie(anchor_id+"_ot", "", -1);
setcookie(anchor_id+"_ol", "", -1);
}
}
// アンカーの適用。
function anchor_apply(page_id) {
if((saved_page_id = getcookie(anchor_id+"_pid")) && page_id != saved_page_id) { return; }
get_scroll();
if((anchor_st = getcookie(anchor_id+"_st")) != "" && (anchor_sl = getcookie(anchor_id+"_sl")) != "") {
anchor_st = parseInt(anchor_st);
anchor_sl = parseInt(anchor_sl);
} else {
anchor_st = scroll_top;
anchor_sl = scroll_left;
}
if((object_id = getcookie(anchor_id+"_oid"))
&& (anchor_ot = getcookie(anchor_id+"_ot")) != ""
&& (anchor_ol = getcookie(anchor_id+"_ol")) != "") {
offset_top = (scroll_top + get_object_top(object_id)) - parseInt(anchor_ot);
offset_left = (scroll_left + get_object_left(object_id)) - parseInt(anchor_ol);
} else {
offset_top = offset_left = 0;
}
window.scrollTo(anchor_sl + offset_left, anchor_st + offset_top);
}
// アンカー消去。あえてとっておく必要がなければanchor_apply()後すぐ消去が望ましい。
function anchor_erase() {
setcookie(anchor_id+"_pid", "", -1);
setcookie(anchor_id+"_st", "", -1);
setcookie(anchor_id+"_sl", "", -1);
setcookie(anchor_id+"_oid", "", -1);
setcookie(anchor_id+"_ot", "", -1);
setcookie(anchor_id+"_ol", "", -1);
}
//-->
倉金家ホームページ
趣味の部屋/サーバー構築メモ その2/メールサーバー その2
WEBメールソフトsquirrelmailを使えるようにします。 これによりインターネットにつながったパソコンから簡単に自分のメールにアクセスできます。外出した際にたいへん重宝します。 |
|
|
CentOSにはなぜか標準でsquirrelmail.rpmがありこれを使おうかとも思いましたがちょっと古いのと文字化けするバグがあるらしいので、本家の最新版を使うことにしました。
|
インストール
http://www.squirrelmail.org/download.php から squirrelmail-1.4.21.tar.gz さらに translation packed per language から ja_JP-1.4.18-20090526.tar.gz をダウンロード squirrelmailとでも名前をつけたフォルダを作って両方を入れて展開。 # cd squirrelmail/ # tar zxvf squirrelmail-1.4.21.tar.gz # tar zxvf ja_JP-1.4.18.tar.gz ja_JP をインストールします。 # ./install Please enter path to your squirrelmail installation:./squirrelmail-1.4.21 …展開してできたsquirrelmailのパスを入力。
squirrelmail-1.4.21をhttp表示ディレクトリに移動し、名前をmailとでも変えておきます。
|
設定
squirrelmailの入ったフォルダのdoc/INSTALLを読んで設定をしていきます。
# cd /home/http/mail/ …squirrelmailの入ったディレクトリ # chown -R apache:apache data/
ユーザのデータ用ディレクトリ/var/local/squirrelmail/{data,attach} 作成 # mkdir /var/local/squirrelmail/ # cd /var/local/squirrelmail/ # mkdir data/ # chown apache:apache data/ # mkdir attach/ # chgrp apache attach/ # chmod 0730 attach/
|
インストールしたディレクトリに入り設定スクリプト起動。 # cd /home/http/mail/ # ./configure SquirrelMail Configuration : Read: config_default.php (1.4.0) --------------------------------------------------------- Main Menu -- 1. Organization Preferences 2. Server Settings 3. Folder Defaults 4. General Options 5. Themes 6. Address Books 7. Message of the Day (MOTD) 8. Plugins 9. Database 10. Languages
D. Set pre-defined settings for specific IMAP servers
C Turn color on S Save data Q Quit
Command >
以下変更 2. Server Setting 1. Domain : example.com -> iroribata.net …使うドメイン名。空白でもいいみたい。10. Languages 1. Default Language : en_US -> ja_JP 2. Default Charset : iso-8859-1 -> iso-2022-JP あとは好みで。
|
設定が済んだら、ブラウザでhttp://(インストールしたドメイン)/mail/ にアクセス。ログイン画面が表示されます。 ログインし、メールが読めること、新規メールの作成、送信などを確認して、OK。
でもhttp_error_logを見ますとけっこうエラーが出てます。 何か設定にちがいがあるのかしら。
|
|
|