<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
		xmlns:xhtml="http://www.w3.org/1999/xhtml"
>

<channel>
	<title>エーエイチレフ linuxサーバー技術情報</title>
	<atom:link href="http://www.ahref.org/tech/feed" rel="self" type="application/rss+xml" />
	<link>http://www.ahref.org/tech</link>
	<description>linuxサーバー技術情報やコピペで使えるHTML・JavaScriptひな形など。</description>
	<lastBuildDate>Wed, 30 Nov 2011 08:27:08 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://www.ahref.org/tech/feed" />
		<item>
		<title>トラフィック量をリアルタイムに監視する「iftop」</title>
		<link>http://www.ahref.org/tech/server/server-tips/801.html</link>
		<comments>http://www.ahref.org/tech/server/server-tips/801.html#comments</comments>
		<pubDate>Wed, 21 Sep 2011 04:10:01 +0000</pubDate>
		<dc:creator>エーエイチレフ サーバー管理担当</dc:creator>
				<category><![CDATA[Linuxソフト]]></category>
		<category><![CDATA[サーバー(Debian)]]></category>
		<category><![CDATA[サーバー技術情報]]></category>

		<guid isPermaLink="false">http://www.ahref.org/tech/?p=801</guid>
		<description><![CDATA[				
				トラフィック量の監視はMRTG等を使って定期的な監視＆グラフ化はよく聞きますが、
				現在のトラフィック量を監視するようなツールはなかなかありません。
				で、ちょっと調べて使ってみたところ、i [...]]]></description>
			<content:encoded><![CDATA[				<p>
				トラフィック量の監視はMRTG等を使って定期的な監視＆グラフ化はよく聞きますが、<br />
				現在のトラフィック量を監視するようなツールはなかなかありません。<br />
				で、ちょっと調べて使ってみたところ、iftopというツールがとても使いやすかったのでご紹介。<br />
				<br />
				<span id="more-801"></span><br />
				<br />
				<h3>インストール</h3>
				iftopは多分デフォルトでは入っていないのでインストールします。<br />
				<br />
				
				<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> iftop</pre></div></div>

<br />
<br />
多分RedHat系も同じようにyum install iftopで入るんじゃないかな、と思います。<br />
<br />
<h3>起動</h3>
<br />

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">iftop - i eth0</pre></div></div>
				
				<br />
				<br />
				一番簡単な起動方法は上記のような形です。<br />
				-iの後に監視するイーサネットの名前を記述します。<br />
				起動するとこんな感じです。<br />
				<br />
				<a href="http://www.ahref.org/tech/wp-content/uploads/2011/09/iftop.png"><img src="http://www.ahref.org/tech/wp-content/uploads/2011/09/iftop-300x221.png" alt="" title="iftop" width="300" height="221" class="alignleft size-medium wp-image-802" /></a><br />
				<br />
				一番上の段はメジャーのようになっており、現在、最高で62.5Kbとなってます。<br />
				一番上の行の192.169.100.117が白く塗りつぶされていますが、これが帯域の使用料です。<br />
				上段は送信量を表しており、下段は受信料を表しています。<br />
				上記のメジャーのようなものでどれくらいの帯域が発生しているかを視覚的に確認できます。<br />
				<br />
				<strong>TX</strong>:トラフィックの送信量<br />
				<strong>RX</strong>:トラフィックの受信料<br />
				<strong>cumm</strong>:iftopを起動してからのトラフィック総量(上り、下り別)<br />
				<strong>TOTAL</strong>:iftopを起動してからのトラフィック総量<br />
				<strong>peak</strong>:瞬間に発生したトラフィックの最大量<br />
				<strong>rates</strong>:平均値。左から最近の2秒、最近の10秒、最近の40秒のトラフィック量の平均値が出ています。<br />
				<br />
				<h3>その他便利な使用方法</h3>
				<br />
				起動時のオプションで様々な設定が可能です。<br />
				<br />
				<strong>-i <interface></strong> 監視対象のインターフェイスを指定<br />
				<strong>-n</strong>　ホスト名の名前解決をしない<br />
				<strong>-N</strong>　ポート番号のサービス名への変換を行わない<br />
				<strong>-p</strong>　promiscuous modeで起動し、同セグメントの他ホストを監視<br />
				<strong>-b</strong>　グラフを表示しない<br />
				<strong>-B</strong>　bytes表示にする<br />
				<strong>-f </strong><filter> <code>　フィルター。<br />
				<strong>-P</strong>　ポート番号も表示する<br />
				<strong>-m</strong> <limit>　上部メジャーの上限値を表示する<br />
				<br />
				例えば特定サービス(ポート)のトラフィック量のみを確認したい時はフィルタを用いる。<br />
				以下の例はポート22のみを表示する例は<br />
				iftop -i eth0 -f "dst port 22"<br />
				となる。<br />
				フィルタに設定できる例は以下の通り<br />
				<br />
				
				<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">dst host host
src host host
dst net net
src net net
dst port port
src port port
dst portrange start-end
src portrange start-end
gateway gateway
ip proto protocol</pre></div></div>
				
				<br />
				<br />
				<br />
				<参考><br />
				iftopのman page<br />
				<a href="http://techthrob.com/2010/07/26/how-to-monitor-network-traffic-in-linux/">How to Monitor Network Traffic in Linux</a><br />
				<a href="hhttp://journal.mycom.co.jp/articles/2010/07/30/linux-freebsd-net-traffic-tools/index.html">Linuxでネットワークトラフィックを監視する方法(マイコミジャーナル)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ahref.org/tech/server/server-tips/801.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://www.ahref.org/tech/server/server-tips/801.html" />
	</item>
		<item>
		<title>Debianのvimでカラースキーマを使う</title>
		<link>http://www.ahref.org/tech/server/server-tips/798.html</link>
		<comments>http://www.ahref.org/tech/server/server-tips/798.html#comments</comments>
		<pubDate>Wed, 21 Sep 2011 03:28:14 +0000</pubDate>
		<dc:creator>エーエイチレフ サーバー管理担当</dc:creator>
				<category><![CDATA[サーバー(Debian)]]></category>
		<category><![CDATA[サーバー技術情報]]></category>

		<guid isPermaLink="false">http://www.ahref.org/tech/?p=798</guid>
		<description><![CDATA[				
				Debianに入ってるvimは超最小構成で作られているので
				カラースキーマが使えないようです。
				開発でばりばりカラフルにしたかったので設定メモです。
				
				
				vimの [...]]]></description>
			<content:encoded><![CDATA[				<p>
				Debianに入ってるvimは超最小構成で作られているので<br />
				カラースキーマが使えないようです。<br />
				開発でばりばりカラフルにしたかったので設定メモです。<br />
				<br />
				<span id="more-798"></span><br />
				<h3>vimの再インストール</h3>
				実はもう一回apt-getしてやれば普通のvimが入るので実行します。<br />
				<br />
				
				<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #c20cb9; font-weight: bold;">vim</span>
<span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> vim-nox</pre></div></div>
				
				<br />
				<br />
				<br />
				<h3>ユーザー用のvimrcを作る</h3>
				デフォルトのvimrcは/etc/vim/vimrcはあるんだけど、<br />
				追加で設定をする場合はユーザーのホームディレクトリに設定ファイルを置くのが通例。<br />
				<br />
				
				<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> ~
<span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>vim<span style="color: #000000; font-weight: bold;">/</span>vimrc .vimrc</pre></div></div>
				
				<br />
				<br />
				<br />
				作った.vimrcを編集してカラースキーマ機能をONにします。<br />
				<br />
				vi .vimrc<br />
				<br />
				
				<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #ff0000;">&quot;syntax on
↓
syntax on</span></pre></div></div>
				
				<br />
				<br />
				<br />
				<h3>巷で有名なwombatというカラースキーマを入れる</h3>
				<br />
				
				<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> ~
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> .vim
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> .vim<span style="color: #000000; font-weight: bold;">/</span>colors
<span style="color: #7a0874; font-weight: bold;">cd</span> .vim<span style="color: #000000; font-weight: bold;">/</span>colors
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>files.werx.dk<span style="color: #000000; font-weight: bold;">/</span>wombat.vim</pre></div></div>
				
				<br />
				<br />
				これでviを起動中に<br />
				<br />
				
				<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">:colorscheme wombat</pre></div></div>

<br />
<br />
でカラースキーマが適応される。<br />
<br />
起動のたびに自動で適応させるには<br />
.vimrcに以下を追記する。<br />
<br />

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">colorscheme wombat</pre></div></div>
				
				<br />
				</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ahref.org/tech/server/server-tips/798.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://www.ahref.org/tech/server/server-tips/798.html" />
	</item>
		<item>
		<title>.bashrcにaliasを作ってオレオレ開発環境を便利にする</title>
		<link>http://www.ahref.org/tech/server/server-tips/793.html</link>
		<comments>http://www.ahref.org/tech/server/server-tips/793.html#comments</comments>
		<pubDate>Wed, 21 Sep 2011 03:19:20 +0000</pubDate>
		<dc:creator>エーエイチレフ サーバー管理担当</dc:creator>
				<category><![CDATA[サーバー技術情報]]></category>

		<guid isPermaLink="false">http://www.ahref.org/tech/?p=793</guid>
		<description><![CDATA[				
				本番環境で使う事は滅多にないですが、
				検証用サーバーや開発用サーバーではよく使っている.bashrcの小ネタです。
				
				すごく深い場所にある設定ファイル等はaliasを作る事で効率 [...]]]></description>
			<content:encoded><![CDATA[				<p>
				本番環境で使う事は滅多にないですが、<br />
				検証用サーバーや開発用サーバーではよく使っている.bashrcの小ネタです。<br />
				<br />
				すごく深い場所にある設定ファイル等はaliasを作る事で効率よく作業できますよ、と。<br />
				<br />
				<span id="more-793"></span><br />
				<br />
				すでにご存じの方のが多いと思いますが、<br />
				ユーザーディレクトリにある.bashrcにaliasの記述を行う事で、<br />
				そのユーザー独自のalias設定を作る事ができます。<br />
				<br />
				例えば、うちのサーバーだと、Apacheはソースからインストールしているので<br />
				Apacheの設定ファイルは</p>
				<blockquote><p>/usr/local/apache2/conf/httpd.conf</p></blockquote>
				<p>
				ですし、再起動とかも</p>
				<blockquote><p>/usr/local/apache2/bin/apachectl restart</p></blockquote>
				<p>
				といった感じです。<br />
				<br />
				さすがに頻繁に使用するので手が覚えて早くはなりましたが、<br />
				やっぱり文字数が多いので面倒です。<br />
				というわけで、.bashrcにaliasを記述しちゃうと楽ですよ、という。<br />
				<br />
				<h3>設定</h3>
				vi ~/.bashrc<br />
				<br />
				
				<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">apconf</span>=<span style="color: #ff0000;">'vi /usr/local/apache2/conf/httpd.conf'</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">aprestart</span>=<span style="color: #ff0000;">'/usr/local/apache2/bin/apachectl restart'</span></pre></div></div>
				
				<br />
				<br />
				<br />
				こんな感じで設定すると、apacheのconfファイルを触りたいときは<br />
				apconf エンター　でファイルをviで開いてくれますし、<br />
				aprestart エンター　でApacheをリスタートしてくれます。<br />
				.bashrcは「ログイン時に」読み込まれるファイルですので、<br />
				設定を変更したらログインしなおして下さい。<br />
				<br />
				<br />
				<br />
				<br />
				<br />
				<br />
				<br />
				</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ahref.org/tech/server/server-tips/793.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://www.ahref.org/tech/server/server-tips/793.html" />
	</item>
		<item>
		<title>Amazon Simple Email Service (Amazon SES)を使ってみました</title>
		<link>http://www.ahref.org/tech/server/server-tips/781.html</link>
		<comments>http://www.ahref.org/tech/server/server-tips/781.html#comments</comments>
		<pubDate>Wed, 26 Jan 2011 08:34:13 +0000</pubDate>
		<dc:creator>エーエイチレフ サーバー管理担当</dc:creator>
				<category><![CDATA[サーバー技術情報]]></category>

		<guid isPermaLink="false">http://www.ahref.org/tech/?p=781</guid>
		<description><![CDATA[				
				amazon AWSに新しいサービスであるAmazon Simple Email Serviceが発表されましたので
				早速、試験環境を使用してみましたのでメモです
				
				
				
 [...]]]></description>
			<content:encoded><![CDATA[				<p>
				amazon AWSに新しいサービスであるAmazon Simple Email Serviceが発表されましたので<br />
				早速、試験環境を使用してみましたのでメモです<br />
				<br />
				<span id="more-781"></span><br />
				<br />
				<h3>概要</h3>
				amazonのEmail送信サービスです。<br />
				年間10億通のメールを送っているらしいAmazonのテクノロジーを利用して<br />
				マーケティングの為の大量のメール配信ソリューションの構築に最適、だそうです。<br />
				要はメルマガ等のメール配信サービスに使用を想定されてるようです。<br />
				<br />
				簡単に使用してみた所、大まかなイメージとしては<br />
				smtpサーバーがもらえる！といった形ではなく、<br />
				こちら側からメール内容を含む情報をxml形式でamazon側へ送信し、<br />
				その内容に則りamazon側がメール配信を行ってくれる、といったイメージでしょうか。<br />
				<br />
				「不達で戻るバウンスメール、送信試行の失敗と成功、スパム申し立てなどの通知の機能」<br />
				「送信メッセージを精査してインターネットサービスプロバイダー（ISP）の基準を満たしていることを確認し、受信者のスパム用フォルダに振り分けられないにする」<br />
				なども備えているようです。<br />
				<br />
				<h3>SESへのサインアップ</h3>
				今回は「<a href="http://docs.amazonwebservices.com/ses/latest/GettingStartedGuide/">Get Started with Amazon SES</a>」という事で<br />
				こちらを参考にAmazon Simple Email Service Scriptsを利用して使ってみました。<br />
				<br />
				<strong>①Amazon SESのサインアップ</strong><br />
				<a href="http://aws.amazon.com/ses">http://aws.amazon.com/ses</a>　へアクセスし、SESサービスにサインアップします。<br />
				<br />
				<strong>②Access Key ID と Secret Access Keyの取得</strong><br />
				<a href="http://aws.amazon.com">http://aws.amazon.com</a>　のAccountからSecurity Credentialsへ移動。<br />
				アクセス証明書のアクセスキータブをクリックし、アクセスキーを作成し、<br />
				アクセスキーIDとシークレットアクセスキーをメモします<br />
				<br />
				<h3>SESを利用する</h3>
				<br />
				以下の操作は適当なサーバーで行います。<br />
				<br />
				<strong>③アクセス証明書ファイルを作成</strong><br />
				サーバーの任意の場所に以下のような内容が書かれたテキストファイルを作成します。<br />
				名前は何でもいいのですが、今回はaws-credentialsというファイル名で作成しました。<br />
				<br />
				
				<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">AWSAccessKeyId</span>=アクセスキー
<span style="color: #007800;">AWSSecretKey</span>=シークレットキー</pre></div></div>
				
				<br />
				<br />
				<br />
				アクセスキーとシークレットキーは②でメモしたものを入力して下さい。<br />
				<br />
				<strong>④Developer Tools の Amazon Simple Email Service Scripts を取得</strong><br />
				http://aws.amazon.com/developertools/Amazon-SES からAmazon Simple Email Service Scriptsを取得します。<br />
				任意の場所で展開して下さい。<br />
				<br />
				
				<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">ses-get-stats.pl 情報を取得
ses-send-email.pl メールを送信
ses-verify-email-address.pl メールアドレスを認証
SES.pm 共通モジュール</pre></div></div>
				
				<br />
				<br />
				<br />
				また、これらのスクリプトはPerl 5.6以上でのみ動作し、<br />
				いくつかのモジュールが必要になってきます。<br />
				スクリプト実行の際にCant Locate @NIC …　といった形のエラーが出たら<br />
				適宜CPAN等からモジュールをインストールして下さい。<br />
				以下のコマンドを実行すると必要なモジュールが全て入るようです。<br />
				<br />
				
				<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#40;</span>READMEファイルから引用<span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #c20cb9; font-weight: bold;">perl</span> <span style="color: #660033;">-MCPAN</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'install Digest::SHA'</span>
<span style="color: #c20cb9; font-weight: bold;">perl</span> <span style="color: #660033;">-MCPAN</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'install URI::Escape'</span>
<span style="color: #c20cb9; font-weight: bold;">perl</span> <span style="color: #660033;">-MCPAN</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'install Bundle::LWP'</span>
<span style="color: #c20cb9; font-weight: bold;">perl</span> <span style="color: #660033;">-MCPAN</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'install MIME::Base64'</span>
<span style="color: #c20cb9; font-weight: bold;">perl</span> <span style="color: #660033;">-MCPAN</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'install Crypt::SSLeay'</span>
<span style="color: #c20cb9; font-weight: bold;">perl</span> <span style="color: #660033;">-MCPAN</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'install XML::LibXML'</span></pre></div></div>
				
				<br />
				<br />
				<br />
				<strong>⑤メールアドレスの登録</strong><br />
				現在は試験環境である為、受信/送信共に認証されたメールアドレスにしか送信できません。<br />
				まずはテストを行うメールアドレスの認証をAmazon Simple Email Service Scriptsを行います。<br />
				以下のようなコマンドで認証が可能です。<br />
				<br />
				
				<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">ses-verify-email-address.pl <span style="color: #660033;">-k</span> aws-credentials <span style="color: #660033;">-v</span> user<span style="color: #000000; font-weight: bold;">@</span>example.com</pre></div></div>

<br />
<br />
コマンドが正常に終了すればuser@example.com宛へ認証URLを含めたメールが送信されますので<br />
受信を行い、URLをクリックして認証をします。<br />
<br />
<br />
<h3>メールの送信</h3>
メールの送信は以下のコマンドを実行します。<br />
現在、認証を行ったメールアドレスは「user@example.com」だけである為、<br />
送受信共に同じメールアドレスを指定しています。<br />
<br />

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">ses-send-email.pl <span style="color: #660033;">-k</span> aws-credentials <span style="color: #660033;">-s</span> <span style="color: #ff0000;">&quot;Test of Amazon SES&quot;</span> <span style="color: #660033;">-f</span> user<span style="color: #000000; font-weight: bold;">@</span>example.com user<span style="color: #000000; font-weight: bold;">@</span>example.com <span style="color: #000000; font-weight: bold;">&lt;</span> msgbody.txt</pre></div></div>
				
				<br />
				<br />
				msgbody.txtには送信したいメッセージ内容を記述しています。<br />
				また送信元のドメインはSPFレコードへ<br />
				<br />
				
				<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">include:amazonses.com</pre></div></div>

<br />
<br />
を記述しておくとよいでしょう。<br />
<br />
<br />
<h3>本番環境リクエスト</h3>
現在は試験環境である為、送信先が認証されたアドレスのみであったり<br />
1日200メッセージまでであったり、、といった制限があります。<br />
<br />
十分にテストが出来たら本番環境申請を以下のフォームより行います。<br />
<a href="https://aws-portal.amazon.com/gp/aws/html-forms-controller/contactus/SESAccessRequest">SES Production Access Request Form</a><br />
<br />
本番環境へのアクセスが許可されると、送信先アドレスを認証する必要がなくなり、<br />
どのアドレスにもメールを送れるようになります。<br />
<br />
<h3>基本使用例</h3>
公式サイトでは<br />
「利用しているMTAからses-send-email.plを呼び出して使用するような形」　や、<br />
「Amazon SES APIを利用してアプリケーションから送信」<br />
といった形で利用できるとされていました。<br />
<br />
<h3>料金</h3>
<br />
【送信数】<br />
1000件につき$0.10 (EC2上からであれば2000件まで無料)<br />
<br />
【転送量】<br />
<strong>In</strong><br />
1GBにつき$0.10<br />
<br />
<strong>Out 	</strong><br />
First 1 GB per Month  	$0.00 per GB<br />
Up to 10 TB per Month 	$0.15 per GB<br />
Next 40 TB per Month 	$0.11 per GB<br />
Next 100 TB per Month 	$0.09 per GB<br />
Over 150 TB per Month 	$0.08 per GB<br />
<br />
<h3>問題点・疑問点</h3>
・<strong>日本語のタイトルや本文にすると文字化け</strong><br />
まだ開発環境としてしか利用していないが<br />
Amazon Simple Email Service Scriptsを利用した送信方法だと<br />
日本語のタイトルや本文にすると文字化けした。<br />
<br />
->解決策<br />
Rawモードを使い、メール本文をファイルとして渡す。<br />
エンコード済みのメール本文自体をファイルとして渡し、送信する。<br />
(参考)<a href="http://d.hatena.ne.jp/j3tm0t0/20110126/1296030520">Amazon SES(Simple Email Service)で日本語メールを出す &#8211; log4moto</a><br />
<br />
以下の例だと　タイトル「テストメール」　本文「これはテストメールです」として無事文字化けせず受信出来た。<br />
<br />

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cat</span> msgbody.txt
<span style="color: #660033;">-------------------------------</span>
Date: Wed, <span style="color: #000000;">26</span> Jan <span style="color: #000000;">2011</span> <span style="color: #000000;">19</span>:<span style="color: #000000;">49</span>:03 +0900
From: user<span style="color: #000000; font-weight: bold;">@</span>example.com
To: user<span style="color: #000000; font-weight: bold;">@</span>example.com
Subject: =?ISO-<span style="color: #000000;">2022</span>-JP?B?GyRCJUYlOSVIJWEhPCVrGyhC?=
Content-Type: text<span style="color: #000000; font-weight: bold;">/</span>plain; <span style="color: #007800;">charset</span>=ISO-<span style="color: #000000;">2022</span>-JP
Content-Transfer-Encoding: 7bit
&nbsp;
^<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #007800;">$B</span>$<span style="color: #000000;">3</span><span style="color: #007800;">$l</span><span style="color: #007800;">$O</span><span style="color: #000000; font-weight: bold;">%</span>F<span style="color: #000000; font-weight: bold;">%</span>9<span style="color: #000000; font-weight: bold;">%</span>H<span style="color: #000000; font-weight: bold;">%</span>a<span style="color: #000000; font-weight: bold;">!&lt;%</span>k<span style="color: #007800;">$G</span>$<span style="color: #000000;">9</span>^<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>B
<span style="color: #660033;">-------------------------------</span>
&nbsp;
ses-send-email.pl <span style="color: #660033;">-k</span> aws-credentials <span style="color: #660033;">-r</span> <span style="color: #000000; font-weight: bold;">&lt;</span> msgbody.txt</pre></div></div>
				
				<br />
				<br />
				<br />
				・<strong>携帯電話への対応</strong><br />
				日本ではメルマガと言えば携帯電話への配信がかなり大きいけど、<br />
				携帯電話への大量配信についてどのように対応していくのか。(携帯への配信に使えるのか)<br />
				<br />
				まだまだ検証していきたいですね。<br />
				ひとまず本番環境の申請を行いたいと思います。<br />
				<br />
				</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ahref.org/tech/server/server-tips/781.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://www.ahref.org/tech/server/server-tips/781.html" />
	</item>
		<item>
		<title>.htaccessでのコメントアウトの記述時の注意</title>
		<link>http://www.ahref.org/tech/server/server-tips/769.html</link>
		<comments>http://www.ahref.org/tech/server/server-tips/769.html#comments</comments>
		<pubDate>Tue, 16 Nov 2010 04:23:53 +0000</pubDate>
		<dc:creator>エーエイチレフ サーバー管理担当</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[サーバー(Debian)]]></category>
		<category><![CDATA[サーバー技術情報]]></category>

		<guid isPermaLink="false">http://www.ahref.org/tech/?p=769</guid>
		<description><![CDATA[				
				知らなかったのでメモです。
				
				管理中のサーバーでApacheのエラーログが
				とんでもない勢いで肥大化していく問題が発生しました。
				
				実際の出力を見てみると以下のよ [...]]]></description>
			<content:encoded><![CDATA[				<p>
				知らなかったのでメモです。<br />
				<br />
				管理中のサーバーでApacheのエラーログが<br />
				とんでもない勢いで肥大化していく問題が発生しました。<br />
				<br />
				実際の出力を見てみると以下のようなログが秒単位で出力されていました。<br />
				<br />
				
				<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>Tue Nov xx xx:xx:xx <span style="color: #000000;">2010</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>warn<span style="color: #7a0874; font-weight: bold;">&#93;</span> Apache does not support line-end comments.
Consider using quotes around argument: <span style="color: #ff0000;">&quot;# hogehoge&quot;</span></pre></div></div>
				
				<br />
				<br />
				<span id="more-769"></span><br />
				.htaccessやhttpd.confの記述について<br />
				行の途中よりコメントアウトする場合はダブルクオートで<br />
				囲む必要があるようです。<br />
				<br />
				以下のように修正するとエラーログがなくなりました。<br />
				<br />
				
				<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">allow from xxx.xxx.xxx.xxx <span style="color: #666666; font-style: italic;"># hogehoge</span>
　　↓
allow from xxx.xxx.xxx.xxx <span style="color: #ff0000;">&quot;# hogehoge&quot;</span></pre></div></div>
				
				<br />
				<br />
				<br />
				通常は以下のように行を分けて記述するとよさそうです。<br />
				<br />
				
				<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># hogehoge</span>
allow from xxx.xxx.xxx.xxx</pre></div></div>
				
				<br />
				<br />
				どうやら、調べていくとApache1.3系では上記エラーが発生するようですが<br />
				Apache2.2系では上記のエラーは発生しないようです。<br />
				<br />
				ですが、念の為、同一行のコメントアウトは使用しないようにすると確実です。<br />
				いろいろと奥が深いですねぇ・・・。<br />
				<br />
				</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ahref.org/tech/server/server-tips/769.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://www.ahref.org/tech/server/server-tips/769.html" />
	</item>
		<item>
		<title>スーパー牛さんパワー</title>
		<link>http://www.ahref.org/tech/other/766.html</link>
		<comments>http://www.ahref.org/tech/other/766.html#comments</comments>
		<pubDate>Fri, 01 Oct 2010 12:34:14 +0000</pubDate>
		<dc:creator>エーエイチレフ サーバー管理担当</dc:creator>
				<category><![CDATA[その他]]></category>
		<category><![CDATA[雑記]]></category>

		<guid isPermaLink="false">http://www.ahref.org/tech/?p=766</guid>
		<description><![CDATA[				
				aptitude -h
				
				でヘルプを見てた時に一番下に
				「この aptitude にはスーパー牛さんパワーなどはありません。」
				などとでてきて意味不明だったのでぐぐってみ [...]]]></description>
			<content:encoded><![CDATA[				<p>
				aptitude -h<br />
				<br />
				でヘルプを見てた時に一番下に<br />
				「この aptitude にはスーパー牛さんパワーなどはありません。」<br />
				などとでてきて意味不明だったのでぐぐってみると<br />
				隠し機能だそうです。<br />
				<br />
				<span id="more-766"></span><br />
				<br />
				
				<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">test</span><span style="color: #000000; font-weight: bold;">@</span>home:~$ <span style="color: #c20cb9; font-weight: bold;">aptitude</span> moo
このプログラムにはイースターエッグ <span style="color: #7a0874; font-weight: bold;">&#40;</span>隠し機能<span style="color: #7a0874; font-weight: bold;">&#41;</span> はありません。
<span style="color: #7a0874; font-weight: bold;">test</span><span style="color: #000000; font-weight: bold;">@</span>home:~$ <span style="color: #c20cb9; font-weight: bold;">aptitude</span> <span style="color: #660033;">-v</span> moo
このプログラムには本当にイースターエッグはありませんよ。
<span style="color: #7a0874; font-weight: bold;">test</span><span style="color: #000000; font-weight: bold;">@</span>home:~$ <span style="color: #c20cb9; font-weight: bold;">aptitude</span> <span style="color: #660033;">-vv</span> moo
このプログラムにイースターエッグはないって言わなかったかい?
<span style="color: #7a0874; font-weight: bold;">test</span><span style="color: #000000; font-weight: bold;">@</span>home:~$ <span style="color: #c20cb9; font-weight: bold;">aptitude</span> <span style="color: #660033;">-vvv</span> moo
やめてくれ<span style="color: #000000; font-weight: bold;">!</span>
<span style="color: #7a0874; font-weight: bold;">test</span><span style="color: #000000; font-weight: bold;">@</span>home:~$ <span style="color: #c20cb9; font-weight: bold;">aptitude</span> <span style="color: #660033;">-vvvv</span> moo
わかった、わかった。あんたにイースターエッグをあげればどっか行ってくれるかい?
<span style="color: #7a0874; font-weight: bold;">test</span><span style="color: #000000; font-weight: bold;">@</span>home:~$ <span style="color: #c20cb9; font-weight: bold;">aptitude</span> <span style="color: #660033;">-vvvvv</span> moo
わかったよ。あんたの勝ちだ。
&nbsp;
                               <span style="color: #000000; font-weight: bold;">/</span>----\
                       -------<span style="color: #000000; font-weight: bold;">/</span>      \
                      <span style="color: #000000; font-weight: bold;">/</span>               \
                     <span style="color: #000000; font-weight: bold;">/</span>                <span style="color: #000000; font-weight: bold;">|</span>
   -----------------<span style="color: #000000; font-weight: bold;">/</span>                  --------\
   <span style="color: #660033;">----------------------------------------------</span>
<span style="color: #7a0874; font-weight: bold;">test</span><span style="color: #000000; font-weight: bold;">@</span>home:~$ <span style="color: #c20cb9; font-weight: bold;">aptitude</span> <span style="color: #660033;">-vvvvvv</span> moo
これが何なのか? もちろんウワバミに食べられた象だよ</pre></div></div>
				
				<br />
				<br />
				<br />
				スーパー牛さんパワーはapt-getにありました。<br />
				<br />
				
				<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> moo
&nbsp;
         <span style="color: #7a0874; font-weight: bold;">&#40;</span>__<span style="color: #7a0874; font-weight: bold;">&#41;</span> 
         <span style="color: #7a0874; font-weight: bold;">&#40;</span>oo<span style="color: #7a0874; font-weight: bold;">&#41;</span> 
   <span style="color: #000000; font-weight: bold;">/</span>------\<span style="color: #000000; font-weight: bold;">/</span> 
  <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000; font-weight: bold;">|</span>    <span style="color: #000000; font-weight: bold;">||</span>   
 <span style="color: #000000; font-weight: bold;">*</span>  <span style="color: #000000; font-weight: bold;">/</span>\---<span style="color: #000000; font-weight: bold;">/</span>\ 
    ~~   ~~   
....<span style="color: #ff0000;">&quot;Have you mooed today?&quot;</span>...</pre></div></div>
				
				<br />
				<br />
				<br />
				こういうアホな機能は大好きです！</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ahref.org/tech/other/766.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://www.ahref.org/tech/other/766.html" />
	</item>
		<item>
		<title>AC-SERVER(ACサーバー)がはじまりました</title>
		<link>http://www.ahref.org/tech/other/notes/728.html</link>
		<comments>http://www.ahref.org/tech/other/notes/728.html#comments</comments>
		<pubDate>Thu, 11 Mar 2010 02:13:37 +0000</pubDate>
		<dc:creator>エーエイチレフ サーバー管理担当</dc:creator>
				<category><![CDATA[雑記]]></category>

		<guid isPermaLink="false">http://www.ahref.org/tech/?p=728</guid>
		<description><![CDATA[				
				弊社で創業当初より運営していたSEEDSホスティングサービスを
				ACサーバーと改名しリニューアルしました！
				
				名前だけじゃなく、サーバーの設定やスペックもリニューアルされています [...]]]></description>
			<content:encoded><![CDATA[				<p>
				弊社で創業当初より運営していたSEEDSホスティングサービスを<br />
				ACサーバーと改名しリニューアルしました！<br />
				<br />
				名前だけじゃなく、サーバーの設定やスペックもリニューアルされています！<br />
				<br />
				<a href="http://www.acserver.jp/index.html"><img src="http://www.ahref.org/tech/wp-content/uploads/2010/03/acserver_b.jpg" alt="acserver_b" title="acserver_b" width="468" height="60" class="alignleft size-full wp-image-729" /></a><br />
				<a href="http://www.acserver.jp/index.html">ワンストップサポートのレンタルサーバー│AC-SERVER（エーシーサーバー）</a><br />
				<span id="more-728"></span><br />
				仮にもlinuxサーバー管理者を担当しておりますので、がっつり構築させていただきました。<br />
				Apache、PHP、Perl、MySQL、PostgreSQL関連のチューニングや<br />
				セキュリティーに対して特に力を入れて構築させていただきました。<br />
				<br />
				今後もよいサービス提供ができるよう努力させていただきます。<br />
				何卒よろしくお願いいたします。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ahref.org/tech/other/notes/728.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://www.ahref.org/tech/other/notes/728.html" />
	</item>
		<item>
		<title>Apacheのモジュールmod_layoutでHTMLの自動挿入</title>
		<link>http://www.ahref.org/tech/server/apacche/717.html</link>
		<comments>http://www.ahref.org/tech/server/apacche/717.html#comments</comments>
		<pubDate>Wed, 17 Feb 2010 14:28:08 +0000</pubDate>
		<dc:creator>エーエイチレフ サーバー管理担当</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[サーバー(Debian)]]></category>

		<guid isPermaLink="false">http://www.ahref.org/tech/?p=717</guid>
		<description><![CDATA[				
				mod_layoutを使用してみましたので備忘録です。
				
				mod_layoutとは、ページの一番上や一番下に指定した文字列(ページ)を埋め込む事ができるモジュールです。
				よく「無 [...]]]></description>
			<content:encoded><![CDATA[				<p>
				mod_layoutを使用してみましたので備忘録です。<br />
				<br />
				mod_layoutとは、ページの一番上や一番下に指定した文字列(ページ)を埋め込む事ができるモジュールです。<br />
				よく「無料レンタルサーバー」とかを利用するとページのヘッダーやフッター部分に自動的に広告が挿入されますが、まさにそれを実現するモジュールです。<br />
				<br />
				<span id="more-717"></span><br />
				<br />
				それぞれのファイルには変更を加えず、出力する際に挿入されます。<br />
				具体的にはページの&lt;body&gt;の直後と&lt;/body&gt;の直前に挿入されるようです。<br />
				<h3>インストール</h3>
				<a href="http://tangent.org/362/mod_layout.html">Tangent Software: mod_layout</a>のページよりソースをダウンロードしてきて展開します。<br />
				今回Apacheが2.2だったのでApache2.2用のソースをダウンロードしてきました。<br />
				<br />
				
				<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>src
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>download.tangent.org<span style="color: #000000; font-weight: bold;">/</span>mod_layout-5.1.tar.gz
<span style="color: #c20cb9; font-weight: bold;">tar</span> zxvf mod_layout-5.1.tar.gz
<span style="color: #7a0874; font-weight: bold;">cd</span> mod_layout-<span style="color: #000000;">5.1</span></pre></div></div>
				
				<br />
				<br />
				Makefileを編集します。<br />
				APXS= と APACHECTL= の部分を以下のように編集<br />
				(/usr/local/apache2/にApacheがインストールされている場合)<br />
				<br />
				
				<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">vi</span> Makefile
&nbsp;
↓以下のように編集
&nbsp;
<span style="color: #007800;">APXS</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>apxs
<span style="color: #007800;">APACHECTL</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>apachectl</pre></div></div>
				
				<br />
				<br />
				あとはmakeしてインストール。<br />
				makeの際にエラーがないか確認して下さい<br />
				<br />
				
				<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">make</span>
<span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>
				
				<br />
				<br />
				その後、Apacheを再起動します。<br />
				<br />
				
				<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>apachectl restart</pre></div></div>

<br />
<br />
インストールを行うとhttpd.confへ<br />
<br />

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">LoadModule layout_module      modules<span style="color: #000000; font-weight: bold;">/</span>mod_layout.so</pre></div></div>
				
				<br />
				<br />
				という行が追加されていると思うので確認して下さい。<br />
				<h3>設定</h3>
				まず挿入したい文章を用意しましょう。<br />
				<br />
				ここでは例としてheader.htmlとfooter.htmlを<br />
				/usr/local/apache2/htdocs/layout<br />
				に作成してみました。<br />
				<br />
				このファイルへは&lt;body&gt;などの記述はしないでOKです。<br />
				<br />
				header.htmlの内容<br />
				<br />
				
				<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;</span>p<span style="color: #000000; font-weight: bold;">&gt;</span>Header Test<span style="color: #000000; font-weight: bold;">&lt;/</span>p<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div>

<br />
<br />
footer.htmlの内容<br />
<br />

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;</span>p<span style="color: #000000; font-weight: bold;">&gt;</span>Footer Test<span style="color: #000000; font-weight: bold;">&lt;</span>p<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div>
				
				<br />
				<br />
				次にhttpd.confへ以下を追加し、ヘッダーとフッターに挿入するものとして<br />
				header.htmlやfooter.htmlを指定します。<br />
				ちなみに.htaccessでも可能です。<br />
				<br />
				
				<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">vi</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>conf<span style="color: #000000; font-weight: bold;">/</span>httpd.conf
&nbsp;
（適当な場所に追加）
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;</span>Directory <span style="color: #ff0000;">&quot;/home/xxxxx/public_html&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span>
Options FollowSymLinks ExecCGI
AllowOverride All
Order deny,allow
Allow from all
AddOutputFilterByType LAYOUT text<span style="color: #000000; font-weight: bold;">/</span>html
LayoutHeader <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>htdocs<span style="color: #000000; font-weight: bold;">/</span>layout<span style="color: #000000; font-weight: bold;">/</span>header.html
LayoutFooter <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>htdocs<span style="color: #000000; font-weight: bold;">/</span>layout<span style="color: #000000; font-weight: bold;">/</span>footer.html
<span style="color: #000000; font-weight: bold;">&lt;/</span>Directory<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div>
				
				<br />
				<br />
				もちろん編集したらApacheを再起動しましょう。<br />
				<br />
				<strong>AddOutputFilterByType</strong><br />
				text/htmlとして返ってくるファイルにheader.htmlをheaderに挿入し、footer.htmlをfooterに挿入するようになります。<br />
				ここではByTypeと指定しましたが拡張子単位での指定も可能です。<br />
				<br />
				
				<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">AddOutputFilter LAYOUT html htm cgi php</pre></div></div>

<br />
<br />
<br />
とすると拡張子html htm cgi phpのものを挿入する対象とします。<br />
<br />
<strong>LayoutHeader</strong><br />
ヘッダーとして&lt;body&gt;の後に挿入するものを指定しています。<br />
<br />
<strong>LayoutHeader</strong><br />
ヘッダーとして&lt;/body&gt;の前に挿入するものを指定しています。<br />
<br />
こんな感じで表示できました。<br />
<a href="http://www.ahref.org/tech/wp-content/uploads/2010/02/modlayout.png"><img class="alignleft size-full wp-image-718" title="modlayout" src="http://www.ahref.org/tech/wp-content/uploads/2010/02/modlayout.png" alt="modlayout" width="407" height="315" /></a><br />
もちろんフッター部分にも表示されております。<br />
<h3>既知の問題</h3>
挿入される側がCGIやPHPのファイルだった場合に予期せぬ動作となってしまう事がありますので<br />
実際に安全に使用するなら<br />
<br />

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">AddOutputFilter LAYOUT html htm</pre></div></div>
				
				<br />
				<br />
				としてやるのがベストです。<br />
				しかし.htaccessを許可しているなら<br />
				<br />
				
				<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">LayoutIgnoreURI <span style="color: #000000; font-weight: bold;">*</span>.cgi</pre></div></div>

<br />
<br />
<br />
のように記述してやる事で特定のフォルダ以下のcgiには挿入しないといった動作が可能です。<br />
ちなみにLayoutMergeとかそういった内容はApache2.2(mod_layout 5系)では削除されたようで<br />
記述するとApache再起動時にエラーとなるので注意して下さい。<br />
<br />
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ahref.org/tech/server/apacche/717.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://www.ahref.org/tech/server/apacche/717.html" />
	</item>
		<item>
		<title>Debian etchの公式アーカイブ鍵が失効</title>
		<link>http://www.ahref.org/tech/server/server-tips/703.html</link>
		<comments>http://www.ahref.org/tech/server/server-tips/703.html#comments</comments>
		<pubDate>Wed, 10 Feb 2010 12:27:38 +0000</pubDate>
		<dc:creator>エーエイチレフ サーバー管理担当</dc:creator>
				<category><![CDATA[サーバー(Debian)]]></category>
		<category><![CDATA[サーバー技術情報]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.ahref.org/tech/?p=703</guid>
		<description><![CDATA[				
				apt-get系のコマンドを実行した際にこんなのが出るようになったりしました。
				
				
				W: GPG error: http://aist.ring.gr.jp etch Relea [...]]]></description>
			<content:encoded><![CDATA[				<p>
				apt-get系のコマンドを実行した際にこんなのが出るようになったりしました。<br />
				<br />
				
				<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">W: GPG error: http:<span style="color: #000000; font-weight: bold;">//</span>aist.ring.gr.jp etch Release: 公開鍵を利用できないため、以下の署名は検証できませんでした: NO_PUBKEY 9AA38DCD55BE302B
W: GPG error: http:<span style="color: #000000; font-weight: bold;">//</span>cdn.debian.or.jp etch Release: 公開鍵を利用できないため、以下の署名は検証できませんでした: NO_PUBKEY 9AA38DCD55BE302B
W: GPG error: http:<span style="color: #000000; font-weight: bold;">//</span>security.debian.org etch<span style="color: #000000; font-weight: bold;">/</span>updates Release: 公開鍵を利用できないため、以下の署名は検証できませんでした: NO_PUBKEY 9AA38DCD55BE302B
&nbsp;
W: これらの問題を解決するためには <span style="color: #c20cb9; font-weight: bold;">apt-get</span> update を実行する必要があるかもしれません</pre></div></div>
				
				<br />
				<br />
				<br />
				<span id="more-703"></span><br />
				<br />
				公開鍵 9AA38DCD55BE302B が見つからないよー。<br />
				aist.ring.gr.jpが検証できないよー。<br />
				みたいなエラーなようです。ちょっとびっくりしました。<br />
				「apt-get update を実行する必要がある」なんていっちゃってますが、<br />
				apt-get updateしても無情にも同じエラーは出続けます。<br />
				<br />
				調べてみると多数のブログ等で詳しく解説されていました。<br />
				原因は「9AA38DCD55BE302B」の公開鍵が登録されていないということで、<br />
				インストーラに入っていたキーリングの公開鍵が2009/07/01に失効しているらしいです。<br />
				<br />
				
				<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">apt-key</span> list</pre></div></div>

<br />
<br />
とすると確かに「55BE302B」という項目が存在しない<br />
<br />
<h3>対処法</h3>
<a href="http://ftp-master.debian.org/keys.html">http://ftp-master.debian.org/keys.html</a><br />
にてキーリングがすべて公開されています。<br />
今回エラーとなった「55BE302B」はarchive-key-5.0.ascという公開鍵のようなので<br />
適当な位置にダウンロードしてきてaptに組み込みました。<br />
<br />

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>ftp-master.debian.org<span style="color: #000000; font-weight: bold;">/</span>keys<span style="color: #000000; font-weight: bold;">/</span>archive-key-5.0.asc
<span style="color: #c20cb9; font-weight: bold;">apt-key</span> add .<span style="color: #000000; font-weight: bold;">/</span>archive-key-5.0.asc</pre></div></div>
				
				<br />
				<br />
				<br />
				apt-key listで確認してみて<br />
				pub   4096R/55BE302B 2009-01-27 [expires: 2012-12-31]<br />
				uid                  Debian Archive Automatic Signing Key (5.0/lenny)<br />
				のような行が追加されていればOKです<br />
				<br />
				あとはapt-get updateなどしてみて<br />
				「公開鍵を利用できないため、以下の署名は検証できませんでした」の文字が出てこなくなればOKです。<br />
				<br />
				<strong>apt-key add [ファイル名]</strong><br />
				で追加できますが<br />
				<strong>apt-key del [キーＩＤ] </strong><br />
				とすると組み込まれているキーを削除できました。<br />
				<br />
				<br />
				参考にさせて頂きました。<br />
				<a href="http://blog.jojo.jp/?eid=1309603">http://blog.jojo.jp/?eid=1309603</a><br />
				<br />
				<br />
				<br />
				</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ahref.org/tech/server/server-tips/703.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://www.ahref.org/tech/server/server-tips/703.html" />
	</item>
		<item>
		<title>ガンブラー(gumblar)によるWEBページ改竄ファイル簡易チェックCGI</title>
		<link>http://www.ahref.org/tech/html/685.html</link>
		<comments>http://www.ahref.org/tech/html/685.html#comments</comments>
		<pubDate>Mon, 08 Feb 2010 01:32:01 +0000</pubDate>
		<dc:creator>エーエイチレフ サーバー管理担当</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[サーバー(Debian)]]></category>
		<category><![CDATA[サーバー技術情報]]></category>
		<category><![CDATA[セキュリティ]]></category>
		<category><![CDATA[雑記]]></category>
		<category><![CDATA[gumblar]]></category>

		<guid isPermaLink="false">http://www.ahref.org/tech/?p=685</guid>
		<description><![CDATA[				
				所謂gumblarや8080ウィルスによる被害が表立ってきてしばらく経ちます。
				自分のPCがgumblarに感染しているかどうかについてはウィルスソフトも対策され始めましたが、
				自分のサ [...]]]></description>
			<content:encoded><![CDATA[				<p>
				所謂gumblarや8080ウィルスによる被害が表立ってきてしばらく経ちます。<br />
				自分のPCがgumblarに感染しているかどうかについてはウィルスソフトも対策され始めましたが、<br />
				自分のサイトが改竄されているかどうかについてのツールはほとんどありません。<br />
				<br />
				ですのでgumblarによるWEBサイトの改竄に対してWEBサイトのオーナー側用のツール（プログラム）を作成してみました。<br />
				このツールは自分のWEBページがgumblarによって改竄されていないか簡単にチェックする事ができます。<br />
				特に１度改竄されてしまった場合、その他、どのファイルが改竄された疑いがあるかのチェックには有用だと思います。<br />
				<br />
				<span id="more-685"></span><br />
				<br />
				<strong>※注意点※</strong><br />
				・「window．onload」が含まれるファイルを感染疑いとして検出するので誤検出は多いです。<br />
				・gumbchk.cgiのファイル以下の階層にあるファイルをチェックします。<br />
				　あまり大量にファイルがあるとサーバーに負荷がかかりますのでご注意下さい。<br />
				・Perlの勉強も兼ねて作ったものですので、不具合等が発生しても責任は持てません…。<br />
				　使用についての問題は全て自己責任で宜しくお願いします。<br />
				<br />
				<h3>サンプル</h3>
				<a href="http://www.ahref.org/tech/wp-includes/js/gumbchk.cgi">動作サンプル</a><br />
				<br />
				「window．onload」が含まれるファイルを感染疑いとして検出するので<br />
				Wordpressのjsファイルも感染疑いとして検出されています。(もちろん無害で感染していません。)<br />
				<br />
				<br />
				<h3>ダウンロード</h3>
				<br />
				<a href="http://www.ahref.org/tech/wp-content/uploads/2010/02/gumbchk.zip">gumbchk.zip</a> (3.42 KB)<br />
				<br />
				<h3>動作環境</h3>
				特別なモジュールも使用していない為、<br />
				Perlが動くサーバーであればほとんどのサーバーで動くと思います。<br />
				<br />
				<h3>導入方法</h3>
				gumbchk.zip を解凍して出来たgumbchk.cgiをテキストエディタで開き<br />
				<strong>#!/usr/bin/perl</strong><br />
				をサーバーのPerlのパスへ変更します。<br />
				ほとんどのサーバーでは変更の必要はないと思います。<br />
				<br />
				gumbchk.cgiをサーバーにアップロードし、<br />
				パーミッションを755等、サーバー側で実行できるパーミッション(属性)に変更します。<br />
				(FFFTPであれば アップロードしたgumbchk.cgiを右クリックメニューの「属性変更」から現在の属性を755へ。)<br />
				後はアップロードした場所へブラウザからアクセスするだけです。<br />
				<br />
				<h3>仕様</h3>
				gumbchk.cgiは自身以下のファイル階層にあるファイルをチェックします。<br />
				gumblar関連によるWEBページの改竄が行われると、.htmlや.jsといった拡張子のファイルの語尾に<br />
				以下のようなある程度決まった文章が追記されます。<br />
				<br />
				<a href="http://www.ahref.org/tech/wp-content/uploads/2010/02/gumblar.png"><img src="http://www.ahref.org/tech/wp-content/uploads/2010/02/gumblar.png" alt="gumblar" title="gumblar" width="499" height="173" class="alignleft size-full wp-image-688" /></a><br />
				<br />
				gumbchk.cgiではこの点に注目し.htmlや.jsといったファイルの中で<br />
				下線部の単語が存在すると「感染疑い」として検出します。<br />
				<br />
				ただしこの「window．onload」というタグは標準の使い方としても使用されているタグである為、<br />
				正常に使用しているものも検出されてしまいますので、ある程度は個人で判断して下さい。<br />
				<br />
				<h3>カスタマイズ</h3>
				74行目あたりの<br />
				my $keyword = &#8216;window\\.onload&#8217;;<br />
				<br />
				の部分のwindow\\.onload部分を変更する事で<br />
				検索する内容を変更できます。<br />
				</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ahref.org/tech/html/685.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://www.ahref.org/tech/html/685.html" />
	</item>
	</channel>
</rss>

