<?xml version="1.0" encoding="UTF-8"?>

<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:admin="http://webns.net/mvcb/"
xmlns:cc="http://web.resource.org/cc/"
xmlns="http://purl.org/rss/1.0/">

<channel rdf:about="http://snowdrops.info/server/">
<title>自宅サーバをめぐる冒険</title>
<link>http://snowdrops.info/server/</link>
<description>Let`s　enjoy home server !!</description>
<dc:language>ja</dc:language>
<dc:creator></dc:creator>
<dc:date>2006-02-15T17:13:31+09:00</dc:date>
<admin:generatorAgent rdf:resource="http://www.movabletype.org/?v=4.13" />


<items>
<rdf:Seq>
<rdf:li rdf:resource="http://snowdrops.info/server/archives/cat_tar.php#000104" />

<rdf:li rdf:resource="http://snowdrops.info/server/archives/cat_tar.php#000105" />

<rdf:li rdf:resource="http://snowdrops.info/server/archives/cat_ports.php#000111" />

<rdf:li rdf:resource="http://snowdrops.info/server/archives/cat_ups.php#000115" />

<rdf:li rdf:resource="http://snowdrops.info/server/archives/cat_librettol1_xf86config.php#000121" />

<rdf:li rdf:resource="http://snowdrops.info/server/archives/cat_rsync_ssh_.php#000126" />

<rdf:li rdf:resource="http://snowdrops.info/server/archives/cat_squid.php#000130" />

<rdf:li rdf:resource="http://snowdrops.info/server/archives/cat_squid.php#000131" />

<rdf:li rdf:resource="http://snowdrops.info/server/archives/cat_squid.php#000132" />

<rdf:li rdf:resource="http://snowdrops.info/server/archives/cat_squid.php#000133" />

<rdf:li rdf:resource="http://snowdrops.info/server/archives/cat_postfix.php#000134" />

<rdf:li rdf:resource="http://snowdrops.info/server/archives/cat_postfix.php#000135" />

<rdf:li rdf:resource="http://snowdrops.info/server/archives/cat_postfix.php#000136" />

<rdf:li rdf:resource="http://snowdrops.info/server/archives/cat_postfix.php#000138" />

<rdf:li rdf:resource="http://snowdrops.info/server/archives/cat_postfix.php#000139" />
</rdf:Seq>
</items>

</channel>


<item rdf:about="http://snowdrops.info/server/archives/cat_tar.php#000104">
<title>複数ファイルのアーカイブ</title>
<link>http://snowdrops.info/server/archives/cat_tar.php#000104</link>
<description><![CDATA[・複数のファイルを一つにまとめる方法<br />
test1 test2 test3 という３つのファイルをtest.tarファイルにまとめます。<br />
（アーカイブするともいいます。）
<br />
<p class="ope">
> ls<br />
test1   test2   test3<br />
> tar cfv test.tar test1 test2 test3<br />
test1<br />
test2<br />
test3<br />
> ls<br />
test.tar        test1           test2           test3<br />
</p>]]></description>
<dc:subject>tar</dc:subject>
<dc:creator>tamohiko</dc:creator>
<dc:date>2005-05-08T11:26:38+09:00</dc:date>
</item>

<item rdf:about="http://snowdrops.info/server/archives/cat_tar.php#000105">
<title>アーカイブされたファイルの中身を調べる</title>
<link>http://snowdrops.info/server/archives/cat_tar.php#000105</link>
<description><![CDATA[アーカイブされたファイルの中身を知りたい場合は <strong>ｔ オプション</strong>を使用すると、アーカイブされているファイルの中身を見ることができます。<br />
※ファイルを指定するために f オプションも指定する必要があります。<br />
<p class="ope">
> tar tf test.tar<br />
test1<br />
test2<br />
test3<br />
</p>
・ ｖ オプションを指定すると、アーカイブされているファイルのより詳細な情報を確認することができます。　
<p class="ope">
> tar tvf test.tar<br />
-rw-r--r-- tamo/tamo         0  5  8 14:45 2005 test1<br />
-rw-r--r-- tamo/tamo         0  5  8 14:45 2005 test2<br />
-rw-r--r-- tamo/tamo         0  5  8 14:45 2005 test3<br />
</p>]]></description>
<dc:subject>tar</dc:subject>
<dc:creator>tamohiko</dc:creator>
<dc:date>2005-05-08T14:56:31+09:00</dc:date>
</item>

<item rdf:about="http://snowdrops.info/server/archives/cat_ports.php#000111">
<title>cvsupを使ってのports更新</title>
<link>http://snowdrops.info/server/archives/cat_ports.php#000111</link>
<description><![CDATA[FreeBSDのportsは色々なソフトを簡単にインストールすることができる、非常に便利なシステムです。<br />
ですが、このportsは日々情報が更新されていたりしているので、情報のアップデートを行わないと最新のportsは使用できないのです。<br />
<br />
そこで、このportsをcvsupにて最新の状態にする方法をここでは記載します。<br />
<br />
<h4>1.cvsupのインストール</h4><br />
<br />
なにわともあれ、cvsupがインストールされていないと話が始まりませんのでcvsupをインストールします。<br />
今回は、portsをつかってお手軽にインストールしてしまうことにします。<br />
(ちなみにインストールには結構時間がかかります・・・）<br />
<br />
<p class="ope">
# cd /usr/ports/net/cvsup<br />
# make clean<br />
# make install<br />
# rehash
</p>
<br />
※XFree86やXorg がインストールされていないPCで CVSup を使おうとしているのであれば、CVSup　GUI が含まれていない cvsup-without-gui をインストールした方がよいようです。<br />
<br />
<h4>2.supfileの作成</h4><br />
<br />
supfileとはcvsupを使用する際につかうコンフィグレーションファイルのことで、このファイルを使用してcvsupの動作を制御します。<br />
<br />
portsを更新する際に必要なサンプルファイルが/usr/share/examples/cvsup/ports-supfileにあるので、それをコピーして使用します。コピーする場所はどこでも良いのですが、今回は/etc の下に置くことにします。<br />
<br />
<p class="ope">
# cp /usr/share/examples/cvsup/ports-supfile /etc/supfile<br />
</p>
<br />
コピーできたら、supfileを編集します。<br />
<br />
<p class="ope">
# vi /etc/supfile
</p>
<br />
編集個所<br />
*default host=CHANGE_THIS.FreeBSD.org
で、cvsupして情報を取ってくるサーバ名をしてしているので、使用したいサーバに変更します。<br />
今回は<b>cvsup5.jp.FreeBSD.org</b>サーバを指定してみました。<br />
<br />
編集前<br />
太字の個所を編集します。<br />
<p class="ini">
# IMPORTANT: Change the next line to use one of the CVSup mirror sites<br />
# listed at http://www.freebsd.org/doc/handbook/mirrors.html.<br />
<strong>*default host=CHANGE_THIS.FreeBSD.org<br /></strong>
*default base=/usr<br />
*default prefix=/usr<br />
</p>

編集後<br />
太字の個所を編集しました。<br />
<p class="ini">
# IMPORTANT: Change the next line to use one of the CVSup mirror sites<br />
# listed at http://www.freebsd.org/doc/handbook/mirrors.html.<br />
<strong>*default host=cvsup5.jp.FreeBSD.org<br /></strong>
*default base=/usr<br />
*default prefix=/usr<br />
</p>
<br />
<br />
日本の場合以下のどれかのサーバを指定すると良いでしょう。<br />
<p class="ini">
cvsup.jp.FreeBSD.org<br />
cvsup2.jp.FreeBSD.org<br />
cvsup3.jp.FreeBSD.org<br />
cvsup4.jp.FreeBSD.org<br />
cvsup5.jp.FreeBSD.org<br />
cvsup6.jp.FreeBSD.org<br />
</p><br />
<br />
<h4>cvsupの実行</h4><br />
<br />
supfileの編集が終ったら、いよいよcvsupを実行してportsを最新化します。<br />
（初回実行する際は、全ての情報を更新する為かなりの時間がかかる場合がありますので、ご注意を。）<br />
<br />
cvsupの実行<br />
<p class="ope">
# /usr/local/bin/cvsup -g -L 2 -z -P - /etc/supfile<br />
<br />
Parsing supfile "/etc/supfile"<br />
Connecting to cvsup5.jp.FreeBSD.org<br />
Connected to cvsup5.jp.FreeBSD.org<br />
Server software version: SNAP_16_1h<br />
Negotiating file attribute support<br />
Exchanging collection information<br />
Establishing passive-mode data connection<br />
Running<br />
Updating collection ports-all/cvs<br />
 Edit ports/audio/mixxx/Makefile<br />
  Add delta 1.6 2005.07.30.23.48.19 jylefort<br />
 Edit ports/devel/nspr/Makefile<br />
  Add delta 1.19 2005.07.31.00.10.29 marcus<br />
 Checkout ports/devel/nspr/files/patch-libtests<br />
 Edit ports/devel/nspr/files/patch-pthread_t<br />
  Add delta 1.2 2005.07.31.00.10.29 marcus<br />
 Edit ports/devel/nspr/files/patch-tests<br />
  Add delta 1.2 2005.07.31.00.10.29 marcus<br />
 Checkout ports/devel/nspr/files/patch-warnings<br />
<br />
　　　　　　　　　　　　　　　　中略<br />
<br />
Shutting down connection to server<br />
Finished successfully<br />
</p>
以上で、portsの更新は完了です。

<h4>自動でportsを更新させる</h4>
ADSLなどで常時接続されていて、PCも常時起動されている場合はcrontabに設定をすれば毎日新鮮なportsを仕入れることができるのでお試しください。

<p class="ope">
# crontab -e 
</p>
<strong>crontabに追加する内容</strong>
<p class="ini">
0 6 * * * root  /usr/local/bin/cvsup -g -L 2 -z -P - /etc/supfile
</p>]]></description>
<dc:subject>ports</dc:subject>
<dc:creator>tamohiko</dc:creator>
<dc:date>2005-07-31T10:27:18+09:00</dc:date>
</item>

<item rdf:about="http://snowdrops.info/server/archives/cat_ups.php#000115">
<title>無停電電源装置とは？</title>
<link>http://snowdrops.info/server/archives/cat_ups.php#000115</link>
<description><![CDATA[<p>&nbsp;&nbsp;急な停電・・・起動中のPCやサーバの突然の電源断は非常に危険で、再起動時もの凄く緊張しちゃいますよね。<br /><br />
無事に起動してくれると問題ないのですが、もしハードディスクがクラッシュして起動してこなかった時のことを考えてみてください。<br /><br />
<br /><br />
せっかく作り上げたサーバやデータが一瞬にして消え去るのです。悔やんでも悔やみきれませんよね。<br /><br />
（専門の業者に依頼すると、データをサルベージしてもらえる場合もありますが、値段が結構かかりますからねぇ）<br />
<br /> <br />
&nbsp;&nbsp;そんな問題を解決するナイスなアイテムが無停電電源装置（UPSともいわれています)なのです！！<br />
<a href="http://pt.afl.rakuten.co.jp/c/0158bb21.7a073c00/?url=http://item.rakuten.co.jp/pc-success/p0404026-05f6l/" target="_blank"><img src="http://thumbnail.image.rakuten.co.jp/@0_gold/pc-success/images/bn100xs.jpg?_ex=128x128" border=0 alt="パソコン関連周辺機器\UPSOMRON(オムロン) UPS 型番:BN100XS"></a><br />
↑これがUPSです<br />
<br /><br />
&nbsp;&nbsp;PCと電源との間に設置して停電や瞬電（瞬間的な電圧低下などによる停電）などの電源の異常が起きた場合に、電源をPCに短時間ですがバッテリーより供給して突然PCの電源が落ちることを避け、システムの破壊を防ぐ為の機器なのです。<br />
<br /><br />
<div align="center">  <br />
<img src="../images/ups.png" width="300" height="100"> <br />
</div><br />
&nbsp;&nbsp;また、電源に異常があった場合PCにそれを通知して、自動的にPCをシャットダウンさせる機能を持っている製品もあります。<br />
<br /><br />
&nbsp;&nbsp;サーバ等のように24時間365日安定して稼動させる必要がある環境では必須ともいえる機器なのです。その他にも雷などで急に高電圧がPCに流れ込まないように電圧の変化を吸収してノイズを除去するといった電源の安定化の効果もあるのです。</p>

<p>製品の金額はまさにピンキリなので、自分の用途にあった物をこの機会に購入してみてはいかがでしょうか？</p>

<p>ちなみに下が、楽天とamazonでの検索結果となっています。<br />
<a href="http://www.amazon.co.jp/exec/obidos/redirect?link_code=ur2&amp;camp=247&amp;tag=snowdrops05-22&amp;creative=1211&amp;path=external-search%3Fsearch-type=ss%26keyword=UPS%26index=electronics-jp">amazonでのUPS一覧はこちら</a><img src="http://www.assoc-amazon.jp/e/ir?t=snowdrops05-22&amp;l=ur2&amp;o=9" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /><br />
<a href="http://pt.afl.rakuten.co.jp/c/0040599d.2a7748b2/?url=http%3a%2f%2fesearch.rakuten.co.jp%2frms%2fsd%2fesearch%2fvc%3fsv%3d11%26v%3d2%26oid%3d000%26sitem%3dUPS%26f%3dA%26nitem%3d%26g%3d100027%26min%3d%26max%3d%26p%3d0" target="_blank"><br />
楽天でのUPS一覧はこちら<br />
</A><br />
<IMG src="http://ba.afl.rakuten.co.jp/b/0040599d.2a7748b2/" width="1" height="1" border="0"></p>]]></description>
<dc:subject>UPS（無停電電源装置）</dc:subject>
<dc:creator>tamohiko</dc:creator>
<dc:date>2005-08-06T13:19:10+09:00</dc:date>
</item>

<item rdf:about="http://snowdrops.info/server/archives/cat_librettol1_xf86config.php#000121">
<title>libretto L1 用 XF86Config</title>
<link>http://snowdrops.info/server/archives/cat_librettol1_xf86config.php#000121</link>
<description><![CDATA[<h4>libretto L1 でXwindowsを使う</h4><br />
自分で所有しているLibrettoL1にてXwindowsを使用するためのメモです。<br />
<br />
LibrettoL11280*600といった変則的なディスプレイですので、通常のXF86ConfigなどではConfigを作成することができません。<br />
<br />
そこで、現在正常に動作しているConfigを次回構築する機会ができた時のために、ここに載せておきます。<br />
<br />
動作環境<br />
<br />
OS:         FreeBSD 4.11-RELEASE<br />
XFree86:  Version 4.4.0<br />
<br />
<h4>XF86Config</h4><br />
<strong>XF86Config の場所</strong><br />
<p class="ini">
/etc/X11/XF86Config
</p>
<br />
<strong>LibrettoL1用　XF86Config</strong>
<div class="ini">
<pre>
Section "ServerLayout"
        Identifier     "Simple Layout"
        Screen         "Screen 1" 0 0
        InputDevice    "Keyboard 1" "CoreKeyboard"
EndSection

Section "Files"

#    FontPath   "/usr/X11R6/lib/X11/fonts/mozilla/"
#    FontPath   "/usr/X11R6/lib/X11/fonts/encodings/"
#    FontPath   "/usr/X11R6/lib/X11/fonts/CID/"
#    FontPath   "/usr/X11R6/lib/X11/fonts/latin2/"
#    FontPath   "/usr/X11R6/lib/X11/fonts/Xg/"
#    FontPath   "/usr/X11R6/lib/X11/fonts/100dpi/:unscaled"
#    FontPath   "/usr/X11R6/lib/X11/fonts/100dpi/"
        RgbPath      "/usr/X11R6/lib/X11/rgb"
        ModulePath   "/usr/X11R6/lib/modules"
        FontPath     "/usr/X11R6/lib/X11/fonts/misc/"
        FontPath     "/usr/X11R6/lib/X11/fonts/local/"
        FontPath     "/usr/X11R6/lib/X11/fonts/TrueType/"
        FontPath     "/usr/X11R6/lib/X11/fonts/non-cjk/"
        FontPath     "/usr/X11R6/lib/X11/fonts/URW/"
        FontPath     "/usr/X11R6/lib/X11/fonts/cyrillic/"
        FontPath     "/usr/X11R6/lib/X11/fonts/75dpi/:unscaled"
        FontPath     "/usr/X11R6/lib/X11/fonts/Type1/"
        FontPath     "/usr/X11R6/lib/X11/fonts/Speedo/"
        FontPath     "/usr/X11R6/lib/X11/fonts/75dpi/"
EndSection

Section "Module"
        Load  "GLcore"
        Load  "dbe"
        Load  "dri"
        Load  "extmod"
        Load  "glx"
        Load  "pex5"
        Load  "record"
        Load  "xie"
        Load  "drm"
        Load  "bitmap"
#    Load        "freetype"
        Load  "speedo"
        Load  "type1"
        Load  "xtt"
        Load  "vbe"
        Load  "ddc"
EndSection

Section "InputDevice"

        Identifier  "Keyboard 1"
        Driver      "Keyboard"
        Option      "AutoRepeat" "500 30"
        Option      "XkbRules" "xfree86"
        Option      "XkbModel" "jp106"
        Option      "XkbLayout" "jp"
EndSection

Section "InputDevice"
        Identifier  "Keyboard0"
        Driver      "keyboard"
        Option      "XkbModel" "jp106"
        Option      "XkbLayout" "jp"
EndSection

Section "InputDevice"
        Identifier  "Mouse0"
        Driver      "mouse"
        Option      "Protocol" "Auto"
        Option      "Emulate3Buttons"
        Option      "Device" "/dev/sysmouse"
EndSection

Section "Monitor"
        Identifier   "LIBRETTO L1 1280x600"
        HorizSync    31.5 - 67.0
        VertRefresh  50.0 - 75.0
        ModeLine     "1280x600" 63.6 1280 1280 1384 1688 600 600 604 628 -hsync -vsync
EndSection

Section "Device"
        Identifier  "Standard VGA"
        Driver      "savage"
        VendorName  "Unknown"
        BoardName   "Unknown"
EndSection

Section "Device"

        Identifier  "S3 Savage/IX"
        Driver      "savage"
        VideoRam    8192
        Option      "ForceInit"
EndSection

Section "Screen"

        Identifier "Screen 1"
        Device     "S3 Savage/IX"
        Monitor    "LIBRETTO L1 1280x600"
        DefaultDepth     16
        SubSection "Display"
                Viewport   0 0
                Depth     8
                Modes    "1280x600"
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     16
                Modes    "1280x600"
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     24
                Modes    "1280x600"
        EndSubSection
EndSection
</pre>
</div>]]></description>
<dc:subject>librettoL1 XF86Config</dc:subject>
<dc:creator>tamohiko</dc:creator>
<dc:date>2005-08-22T23:59:36+09:00</dc:date>
</item>

<item rdf:about="http://snowdrops.info/server/archives/cat_rsync_ssh_.php#000126">
<title>rsync + ssh + cron でバックアップを自動化</title>
<link>http://snowdrops.info/server/archives/cat_rsync_ssh_.php#000126</link>
<description><![CDATA[<h4>はじめに</h4>
みなさんは、バックアップをどうしていますか？

<p>自分だけは大丈夫だと思っていても、その日は突然やってきます「HD障害」という厄災は・・・<br />
そのときになって焦っても後の祭りで、消え去ったデータは帰ってきません。</p>

<p>そんな時に大事なデータのバックアップをこまめに行っていれば、被害も最小限すむというものですよね。</p>

<p>しかし、重要だけど面倒くさくてついついサボりがちになってしまうのが、「バックアップ」というものだったりします。</p>

<p>そんな面倒なバックアップ作業も、一度面倒でも自動化の設定さえしてしまえばあとは、あなたが寝ている間に毎日パソコン君が汗水たらしながらバックアップをしてくれるのです。:-)</p>

<p><br />
ということで、今回はrsync + ssh + cron による自動バックアップの方法を紹介します。</p>

<h4>なんでrsyncなの？</h4>
なぜ、rsyncを使うのかというと・・・

<p><strong>rsyncの利点</strong><br />
<div class=ini>・差分バックアップができる（バックアップ時間の短縮）<br />
・データのパーミッションやuid,gidなどの情報を保持できる<br />
（リカバリーを考えると、これ重要です！！）<br />
</div><br />
などといったメリットがあるため、バックアップ手段としてrsyncを選択しました。</p>]]></description>
<dc:subject>rsync + ssh によるバックアップ</dc:subject>
<dc:creator>tamohiko</dc:creator>
<dc:date>2006-02-02T21:40:18+09:00</dc:date>
</item>

<item rdf:about="http://snowdrops.info/server/archives/cat_squid.php#000130">
<title>squidについて</title>
<link>http://snowdrops.info/server/archives/cat_squid.php#000130</link>
<description><![CDATA[<p>squidについての説明を後日記述する予定・・・；ｐ</p>]]></description>
<dc:subject>squid</dc:subject>
<dc:creator>tamohiko</dc:creator>
<dc:date>2006-02-09T17:01:55+09:00</dc:date>
</item>

<item rdf:about="http://snowdrops.info/server/archives/cat_squid.php#000131">
<title>squidのインストール</title>
<link>http://snowdrops.info/server/archives/cat_squid.php#000131</link>
<description><![CDATA[<h4>ソースの取得</h4>

<p>FreeBSDならportsでインストールすると楽チンなのですが、私はソースからインストールするのが好みなのでソースをダウンロードしてきて、インストールを行います。</p>

<p>http://www.squid-cache.orgよりsquidのソースをダウンロードしてきます。<br />
ダウンロードの方法は何でも良いですが、今回はwgetでソースを持ってくることにします。</p>

<div class="ope">
> wget http://www.squid-cache.org/Versions/v2/2.5/squid-2.5.STABLE12.tar.gz
--10:43:07--  http://www.squid-cache.org/Versions/v2/2.5/squid-2.5.STABLE12.tar.gz
           => `squid-2.5.STABLE12.tar.gz'
Resolving www.squid-cache.org... done.
Connecting to www.squid-cache.org[206.168.0.9]:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1,394,653 [application/x-tar]

<p>100%[========================================================>] 1,394,653     98.15K/s    ETA 00:00</p>

<p>10:43:22 (98.15 KB/s) - `squid-2.5.STABLE12.tar.gz' saved [1394653/1394653]<br />
</div></p>

<h4>インストール</h4>

<p><strong>事前準備</strong><br />
squidを起動させるための専用ユーザを作成します。<br />
下記はFreeBSDでのユーザ追加例です。ユーザの追加方法どんな方法でも良いですが、ログインを許可しない設定を行うようにしてください。</p>

<div class="ope">
# pw groupadd squid -g 8080<br />
# pw useradd squid -g squid -u 8080 -s /sbin/nologin -d /nonexistent<br />
</div>

<p><strong>インストール</strong></p>

<div class="ope">
> tar xzfv squid-2.5.STABLE12.tar.gz -C /home/src/<br />
> cd /home/src/squid-2.5.STABLE12/<br />
> ./configure<br />
> make<br />
> su<br />
# make install<br />
</div>

<p><br />
</p>]]></description>
<dc:subject>squid</dc:subject>
<dc:creator>tamohiko</dc:creator>
<dc:date>2006-02-09T17:05:25+09:00</dc:date>
</item>

<item rdf:about="http://snowdrops.info/server/archives/cat_squid.php#000132">
<title>squidの設定</title>
<link>http://snowdrops.info/server/archives/cat_squid.php#000132</link>
<description><![CDATA[<h4>設定ファイルの編集</h4>

<div class="ope">
# cd /usr/local/squid/etc<br />
# vi squid.conf
</div>

<strong>設定個所</strong>
<div class="ini">
<strong>使用ポート</strong><br />
#Default:<br />
# http_port 3128<br />
http_port 8080<br />

<strong>使用メモリの量</strong><br />
#Default:<br />
# cache_mem 8 MB<br />
cache_mem 8 MB<br />

<strong>キャッシュデータの保存場所</strong><br />
キャッシュしたファイルの保存場所　最大サイズ / サブディレクトリ数 / サブディレクトリの更にサブディレクトリ数<br />
#Default:<br />
# cache_dir ufs /usr/local/squid/var/cache 100 16 256<br />
cache_dir ufs /usr/local/squid/var/cache 100 16 256<br />
<br />
<strong>各種ログ置き場</strong><br />
<br />
#Default:<br />
# cache_access_log /usr/local/squid/var/logs/access.log<br />
cache_access_log /usr/local/squid/var/logs/access.log<br />
<br />
#Default:<br />
# cache_log /usr/local/squid/var/logs/cache.log<br />
cache_log /usr/local/squid/var/logs/cache.log<br />
<br />
#Default:<br />
# cache_store_log /usr/local/squid/var/logs/store.log<br />
cache_store_log /usr/local/squid/var/logs/store.log<br />
<br />
<strong>ログ出力形式</strong><br />
apacheと同様のログ形式に変更<br />
#Default:<br />
# emulate_httpd_log off<br />
<br />
<strong>squidの実行ユーザ</strong><br />
<br />
#Default:<br />
# cache_effective_user nobody<br />
cache_effective_user squid<br />
<br />
<strong>squidの実行グループ</strong><br />
<br />
#Default:<br />
# none<br />
cache_effective_group squid<br />
<br />
<strong>ログファイルのローテーション日数</strong><br />
#Default:<br />
# logfile_rotate 10<br />
logfile_rotate 7<br />
<br />
<strong>アクセス許可設定</strong><br />
初期設定のままでは、squidにアクセスしてもアクセス制限の関係で使用できません。
以下の設定をしてアクセスできるようにします。<br />
<br />
acl mynetworks src 192.168.1.0/24<br />
http_access allow mynetworks<br />
</div>
]]></description>
<dc:subject>squid</dc:subject>
<dc:creator>tamohiko</dc:creator>
<dc:date>2006-02-09T17:17:34+09:00</dc:date>
</item>

<item rdf:about="http://snowdrops.info/server/archives/cat_squid.php#000133">
<title>squidの起動</title>
<link>http://snowdrops.info/server/archives/cat_squid.php#000133</link>
<description><![CDATA[<h4>キャッシュ保存ディレクトリの作成</h4>

<div class="ope">
# mkdir /usr/local/squid/var/cache
</div>

<h4>ディレクトリの所有者変更</h4>


<div class="ope">
# chown squid:squid /usr/local/squid/var/cache<br />
# chown squid:squid /usr/local/squid/var/logs<br />
</div>


<h4>キャッシュディレクトリの作成</h4>
初回に作成します。
<div class="ope">
# /usr/local/squid/sbin/squid -z
2006/02/09 11:45:40| Creating Swap Directories
</div>

<h4>squidの起動</h4>

<div class="ope">
# /usr/local/squid/sbin/squid -D
</div>

<h4>自動起動設定</h4>

/usr/local/etc/rc.d に以下の起動スクリプトを作成します。


<div class="ope">
# vi  /usr/local/etc/rc.d/squid.sh
</div>
<strong>スクリプト内容</strong>
<div class="ini">
<pre>
#!/bin/sh

command=/usr/local/squid/sbin/squid

squid_flags="-D"
squid_user=squid
      
case $1 in
start)
      echo -n ' squid start'
      exec su -fm ${squid_user} -c "${command} ${squid_flags}"
      ;;
stop)
      echo -n ' squid stop'
      ${command} -k shutdown
      while ps -xcU ${squid_user} | grep -q ${squid_user}; do
              sleep 2
      done
      ;;
*)
      echo "usage: ${0##*/} {start|stop}" >&2
      exit 64
      ;;
esac
exit 0
</pre>
</div>


<h4>実行権限の付与</h4>

<div class="ope">
#chmod +x /usr/local/etc/rc.d/squid.sh
</div>

/usr/local/etc/rc.d/squid.sh start で起動<br />
/usr/local/etc/rc.d/squid.sh stop で停止。<br />

]]></description>
<dc:subject>squid</dc:subject>
<dc:creator>tamohiko</dc:creator>
<dc:date>2006-02-09T17:30:04+09:00</dc:date>
</item>

<item rdf:about="http://snowdrops.info/server/archives/cat_postfix.php#000134">
<title>postfixとは</title>
<link>http://snowdrops.info/server/archives/cat_postfix.php#000134</link>
<description><![CDATA[<p>postfixについて記述予定　:-）</p>

<p>忘れないうちに記述しますが、あまりにも醜いので後ほど編集しなおします。</p>]]></description>
<dc:subject>postfix</dc:subject>
<dc:creator>tamohiko</dc:creator>
<dc:date>2006-02-15T15:41:08+09:00</dc:date>
</item>

<item rdf:about="http://snowdrops.info/server/archives/cat_postfix.php#000135">
<title>postfix インストール</title>
<link>http://snowdrops.info/server/archives/cat_postfix.php#000135</link>
<description><![CDATA[<h4>ソースの取得</h4>
まずはpostfixのソースを取得します。<br />
今回は、ringプロジェクトからpostfix-2.2.8のソースをfetchを使ってダウンロードすることにします。<br />
URL   http://www.ring.gr.jp/pub/net/mail/postfix/official/<br />
もちろん、ダウンロードの方法は何でもよいのでお好みの方法使ってください。　<br />
<br />
<div class="ope">
>  fetch http://www.ring.gr.jp/pub/net/mail/postfix/official/postfix-2.2.8.tar.gz<br />
Receiving postfix-2.2.8.tar.gz (2434615 bytes): 100%<br />
2434615 bytes transferred in 4.0 seconds (593.66 kBps)<br />
</div>
<h4>ユーザ・グループの追加</h4>
posftixのインストールを行う前に、postfix実行ユーザであるpostfixユーザ / グループ およびpostdropグループの作成をする必要があります。<br />
※posfixユーザは「パスワードなし」「ホームディレクトリなし」「ログインシェルなし」として作成します。<br />
※ユーザおよびグループの追加方法はお好みの方法でよいです。<br />
<br />
<strong>グループの作成</strong>
FreeBSDの場合
<div class="ope">
> su<br />
# pw groupadd postfix<br />
# pw groupadd postdrop<br />
</div>
<br />
<strong>ユーザの作成</strong>
FreeBSDの場合
<div class="ope">
# pw useradd postfix -d /nonexistent -g postfix -s /sbin/nologin
</div>
<h4>sendmailのバックアップ</h4>
postfixをインストールする前に、すでにインストールされているsendmailのバックアップを行います。<br />
※sendmailがインストールされていなければ、行う必要はありません。<br />
<div class="ope">
# mv /usr/sbin/sendmail /usr/sbin/sendmail.OFF<br />
# mv /usr/bin/newaliases /usr/bin/newaliases.OFF<br />
# mv /usr/bin/mailq /usr/bin/mailq.OFF<br />
# chmod 755 /usr/sbin/sendmail.OFF /usr/bin/newaliases.OFF /usr/bin/mailq.OFF<br />
</div>
<h4>postfixのインストール</h4>
一般ユーザで作業
<div class="ope">
> tar xzfv postfix-2.2.8.tar.gz<br />
> cd postfix-2.2.8<br />
> make<br />
> su<br />
# make install<br />
<br />
/bin/sh postfix-install<br />
<br />
sendmail        /usr/libexec/postfix/sendmail<br />
send-mail       /usr/libexec/postfix/sendmail<br />
mailq           /usr/libexec/postfix/mailq<br />
newaliases      /usr/libexec/postfix/newaliases<br />
Warning: if you use this script to install Postfix locally,<br />
    this script will replace existing sendmail or Postfix programs.<br />
    Make backups if you want to be able to recover.<br />
<br />
    Before installing files, this script prompts you for some<br />
    definitions.  Most definitions will be remembered, so you have<br />
    to specify them only once. All definitions should have a<br />
    reasonable default value.<br />

Please specify the prefix for installed file names. Specify this<br />
ONLY if you are building ready-to-install packages for distribution<br />
to other machines.<br />
install_root: [/]<br />
<br />
Please specify a directory for scratch files while installing<br />
Postfix. You must have write permission in this directory.<br />
tempdir: [/usr/home/tamo/postfix-2.2.8]<br />
<br />
Please specify the final destination directory for installed Postfix<br />
configuration files.<br />
config_directory: [/etc/postfix]<br />
<br />
Please specify the final destination directory for installed Postfix<br />
daemon programs. This directory should not be in the command search<br />
path of any users.<br />
daemon_directory: [/usr/libexec/postfix]<br />
<br />
Please specify the final destination directory for installed Postfix<br />
administrative commands. This directory should be in the command<br />
search path of adminstrative users.<br />
command_directory: [/usr/sbin]<br />
<br />
Please specify the final destination directory for Postfix queues.<br />
queue_directory: [/var/spool/postfix]<br />
<br />
Please specify the final destination pathname for the installed<br />
Postfix sendmail command. This is the Sendmail-compatible mail<br />
posting interface.<br />
sendmail_path: [/usr/sbin/sendmail] /usr/libexec/postfix/sendmail<br />
<br />
Please specify the final destination pathname for the installed<br />
Postfix newaliases command. This is the Sendmail-compatible command<br />
to build alias databases for the Postfix local delivery agent.<br />
newaliases_path: [/usr/bin/newaliases] /usr/libexec/postfix/newaliases<br />
<br />
Please specify the final destination pathname for the installed<br />
Postfix mailq command. This is the Sendmail-compatible mail queue<br />
listing command.<br />
mailq_path: [/usr/bin/mailq] /usr/libexec/postfix/mailq<br />
<br />
Please specify the owner of the Postfix queue. Specify an account<br />
with numerical user ID and group ID values that are not used by any<br />
other accounts on the system.<br />
mail_owner: [postfix]<br />
<br />
Please specify the group for mail submission and for queue management<br />
commands. Specify a group name with a numerical group ID that is<br />
not shared with other accounts, not even with the Postfix mail_owner<br />
account. You can no longer specify "no" here.<br />
setgid_group: [postdrop]<br />
<br />
Please specify the destination directory for the Postfix HTML files.<br />
Specify "no" if you do not want to install these files.<br />
html_directory: [no]<br />
<br />
Please specify the destination directory for the Postfix on-line<br />
manual pages. You can no longer specify "no" here.<br />
manpage_directory: [/usr/local/man]<br />
<br />
Please specify the destination directory for the Postfix README<br />
files. Specify "no" if you do not want to install these files.<br />
readme_directory: [no]<br />
<br />
</div>]]></description>
<dc:subject>postfix</dc:subject>
<dc:creator>tamohiko</dc:creator>
<dc:date>2006-02-15T15:42:26+09:00</dc:date>
</item>

<item rdf:about="http://snowdrops.info/server/archives/cat_postfix.php#000136">
<title>postfix設定</title>
<link>http://snowdrops.info/server/archives/cat_postfix.php#000136</link>
<description><![CDATA[<h4>/etc/mailer.conf の編集（FreeBSDのみ）</h4>

FreeBSDではsendmail などのコマンドはmailwrapperのリンクになっていて実際には /etc/mail/mailer.conf に記述したコマンドが実行されます。<br />
sendmailからpsotfixに移行するにあたって、/etc/mail/mailer.confの編集が必要となります。
<div class="ope">
# cp -p /etc/mail/mailer.conf /etc/mail/mailer.conf.org<br />
# vi /etc/mail/mailer.conf<br />
</div>
<br />
設定内容
<div class="ini">
<pre>
sendmail        /usr/libexec/postfix/sendmail
send-mail       /usr/libexec/postfix/sendmail
mailq           /usr/libexec/postfix/mailq
newaliases      /usr/libexec/postfix/newaliases
</pre>
</div>
<h4>パスの追加</h4>
インストールの際に/usr/libexec/postfixをインストール先と指定しているので、パスの追加をおこないます。<br />
FreeBSDだとデフォルトのログインシェルがtcshなので、~/.cshrc を編集してパスの追加を行います。<br />
<div class="ope">
# vi ~/.cshrc<br />
</div>
<br />
編集内容<br />
set path に　/usr/libexec/postfix を追加します。
<div class="ini">
set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin /usr/X11R6/bin $HOME/bin <strong>/usr/libexec/postfix</strong>)
</div>
<br />
編集したファイルを読み込ませて、設定の反映を行います。
<div class="ope">
# source ~/.cshrc
</div>
<h4>設定ファイルの編集</h4>
posftixの設定ファイルである/etc/posfticx/main.cf 設定を行います。<br />
ここでは、最低限必要個所のみの設定を行います。
<div class="ope">
# cd /etc/postfix<br />
# cp -p main.cf main.cf.org<br />
# vi main.cf<br />
</div>
<strong>設定個所</strong><br />
<div class="ini">
<strong>ホスト名の設定</strong><br />
myhostname = ホスト名<br />
<br />
<strong>ドメイン名の指定</strong><br />
mydomain = ドメイン名<br />
<br />
<strong>送信元ドメインの指定</strong><br />
myorigin = $myhostname<br />
<br />
<strong>メール受信インターフェイスの指定</strong><br />
inet_interfaces = all<br />
<br />
<strong>受信するドメインの指定</strong><br />
mydestination = $myhostname, localhost.$mydomain, localhost<br />
<br />
<strong>リレーを許可するネットワーク</strong><br />
mynetworks = リレーを許可したいネットワーク, 127.0.0.0/8<br />
<br />
<strong>aliasのファイルとデータベースの指定</strong><br />
alias_maps = hash:/etc/aliases<br />
alias_database = hash:/etc/aliases<br />
<br />
<strong>メールボックスの指定</strong>
※Maildir形式にするのなら<br />
home_mailbox = Maildir/<br />
</div>]]></description>
<dc:subject>postfix</dc:subject>
<dc:creator>tamohiko</dc:creator>
<dc:date>2006-02-15T16:16:35+09:00</dc:date>
</item>

<item rdf:about="http://snowdrops.info/server/archives/cat_postfix.php#000138">
<title>postfixの起動</title>
<link>http://snowdrops.info/server/archives/cat_postfix.php#000138</link>
<description><![CDATA[<h4>sendmailの停止</h4>
<div class="ope">
#  killall sendmail
</div>
<h4>postfixの起動</h4>
<div class="ope">
# /usr/sbin/postfix start <br />
postfix/postfix-script: starting the Postfix mail system <br />
</div>
]]></description>
<dc:subject>postfix</dc:subject>
<dc:creator>tamohiko</dc:creator>
<dc:date>2006-02-15T17:10:29+09:00</dc:date>
</item>

<item rdf:about="http://snowdrops.info/server/archives/cat_postfix.php#000139">
<title>postfix自動起動設定</title>
<link>http://snowdrops.info/server/archives/cat_postfix.php#000139</link>
<description><![CDATA[<h4>sendmail自動起動の停止</h4>
FreeBSDの場合
<div class="ope">
#vi /etc/rc.conf 
</div>
<br />
<div class="ini">
変更前
sendmail_enable="YES"<br />
<br />
変更後<br />
sendmail_enable="NONE"
</div>
<br />
<h4>postfix自動起動設定</h4>
<br />
FreeBSDの場合
<br />
/usr/local/etc/rc.d に起動用のスクリプトを作成します。
<div class=ope">
# vi /usr/local/etc/rc.d/postfix.sh
</div>
スクリプト例
<div class="ini">
<pre>
#!/bin/sh

    POSTFIX="/usr/sbin/postfix"
    CONFDIR="/etc/postfix/"
    CONF="/etc/postfix/main.cf"

    case "$1" in
    start)
        if [ -r ${CONF} -a -x ${POSTFIX} ]; then
            echo  ' Postfix starting '
            ${POSTFIX} -c ${CONFDIR} start > /dev/null 2>&1
        fi
        ;;
    stop)
        if [ -x ${POSTFIX} ]; then
            echo  ' Postfix stopping'
            ${POSTFIX} -c ${CONFDIR} stop > /dev/null 2>&1
        fi
        ;;
    *)
        ;;
    esac
</pre>
</div>
<br />
<h4>実行権限の付与</h4>
作成したスクリプトに実行権限をつけます。これをしないと自動起動されてきません。<br />
<div class="ope">
# chmod +x /usr/local/etc/rc.d/postfix.sh
</div>
<br />
スクリプトを書くのが面倒だったら
<div class="ope">
# cd /usr/local/etc/rc.d<br />
# ln -s /usr/sbin/postfix postfix.sh<br />
</div>
とすると、簡単に自動起動の設定が完了します;-p]]></description>
<dc:subject>postfix</dc:subject>
<dc:creator>tamohiko</dc:creator>
<dc:date>2006-02-15T17:13:31+09:00</dc:date>
</item>


</rdf:RDF>
