<?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>Weblogy &#187; apache</title>
	<atom:link href="http://blog.dacelo.info/apache/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.dacelo.info</link>
	<description>WordPressのカスタマイズとプラグイン、CSSテクニック、SEOの話題など。</description>
	<lastBuildDate>Fri, 16 Jul 2010 06:22:34 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://blog.dacelo.info/apache/feed" />
		<item>
		<title>Apacheのアクセスログから特定のIPを除外する</title>
		<link>http://blog.dacelo.info/apache/entry-799.html</link>
		<comments>http://blog.dacelo.info/apache/entry-799.html#comments</comments>
		<pubDate>Thu, 20 May 2010 11:33:32 +0000</pubDate>
		<dc:creator>dacelo</dc:creator>
				<category><![CDATA[apache]]></category>

		<guid isPermaLink="false">http://blog.dacelo.info/apache/entry-799.html</guid>
		<description><![CDATA[2分に1回、死活監視をするプログラムを走らせてたんですけど、それだとApacheのログがそのアクセスで一杯になっちゃうんですね。
あんまりアクセスのないサイトだと、9割方それで埋まります…。
そこで今日のお題。

Cus [...]


Related posts:<ol><li><a href='http://blog.dacelo.info/linux/entry-678.html' rel='bookmark' title='Permanent Link: Apacheアクセスログの設定'>Apacheアクセスログの設定</a> <small>httpd.confでVirtualHostのアクセスログの保存方法と場所を指定する。 common　… 共通のログファイルに書き込む combined　… 個別のログファイルに書き込む …ということだと思うんですが、事 [...]...</small></li><li><a href='http://blog.dacelo.info/linux/entry-755.html' rel='bookmark' title='Permanent Link: 「WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!」と怒られたら'>「WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!」と怒られたら</a> <small>sshで違うサーバーに接続しようとしたときに、こんな警告メッセージが出ることがあります。 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ [...]...</small></li><li><a href='http://blog.dacelo.info/apache/entry-714.html' rel='bookmark' title='Permanent Link: httpd.confでRedirectの設定'>httpd.confでRedirectの設定</a> <small>Webサイトの移転で必須のRedirect設定、.htaccessでやることが多いですが、 Apacheの設定ファイル・httpd.confでやってしまうと一括指定できて早いです。 &lt;VirtualHost 19 [...]...</small></li></ol>]]></description>
			<content:encoded><![CDATA[<p>2分に1回、死活監視をするプログラムを走らせてたんですけど、それだとApacheのログがそのアクセスで一杯になっちゃうんですね。<br />
あんまりアクセスのないサイトだと、9割方それで埋まります…。</p>
<p>そこで今日のお題。</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">CustomLog logs<span style="color: #000000; font-weight: bold;">/</span>access_log common <span style="color: #007800;"><span style="color: #c20cb9; font-weight: bold;">env</span></span>=<span style="color: #000000; font-weight: bold;">!</span>nolog 
SetEnvIf Remote_Addr 192.168.1. nolog 
SetEnvIf Remote_Addr 192.168.2. nolog</pre></div></div>

<p>これで当該サーバからのアクセスはログに記録されなくなり、めでたしめでたし。</p>
<div class="notes">
参照サイト<br />
<cite><a href="http://blog.papierplane.com/archives/97">紙ヒコーキが飛んでゆく… | Apache アクセスログに特定のIPを除外させる方法</a></cite>
</div>


<p>Related posts:<ol><li><a href='http://blog.dacelo.info/linux/entry-678.html' rel='bookmark' title='Permanent Link: Apacheアクセスログの設定'>Apacheアクセスログの設定</a> <small>httpd.confでVirtualHostのアクセスログの保存方法と場所を指定する。 common　… 共通のログファイルに書き込む combined　… 個別のログファイルに書き込む …ということだと思うんですが、事 [...]...</small></li><li><a href='http://blog.dacelo.info/linux/entry-755.html' rel='bookmark' title='Permanent Link: 「WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!」と怒られたら'>「WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!」と怒られたら</a> <small>sshで違うサーバーに接続しようとしたときに、こんな警告メッセージが出ることがあります。 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ [...]...</small></li><li><a href='http://blog.dacelo.info/apache/entry-714.html' rel='bookmark' title='Permanent Link: httpd.confでRedirectの設定'>httpd.confでRedirectの設定</a> <small>Webサイトの移転で必須のRedirect設定、.htaccessでやることが多いですが、 Apacheの設定ファイル・httpd.confでやってしまうと一括指定できて早いです。 &lt;VirtualHost 19 [...]...</small></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.dacelo.info/apache/entry-799.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://blog.dacelo.info/apache/entry-799.html" />
	</item>
		<item>
		<title>.htaccessでHTTPSのアクセスをHTTPにリダイレクト</title>
		<link>http://blog.dacelo.info/apache/entry-792.html</link>
		<comments>http://blog.dacelo.info/apache/entry-792.html#comments</comments>
		<pubDate>Wed, 21 Apr 2010 07:24:38 +0000</pubDate>
		<dc:creator>dacelo</dc:creator>
				<category><![CDATA[apache]]></category>

		<guid isPermaLink="false">http://blog.dacelo.info/apache/entry-792.html</guid>
		<description><![CDATA[.htaccessでの指定で、HTTPのアクセスをHTTPSにリダイレクトします。

RewriteEngine on
RewriteCond %&#123;SERVER_PORT&#125; ^443$
Rewrite [...]


Related posts:<ol><li><a href='http://blog.dacelo.info/wordpress/entry-794.html' rel='bookmark' title='Permanent Link: WordPressでindex.htmlをリダイレクトする方法'>WordPressでindex.htmlをリダイレクトする方法</a> <small>既存のサイトをWordPressに置き換えたあとによく発生する問題です。 リンクや検索エンジンの登録が、&#8221;/&#8221;ルートではなく　&#8221;/index.html&#8221;に対してなされている [...]...</small></li><li><a href='http://blog.dacelo.info/wordpress/entry-797.html' rel='bookmark' title='Permanent Link: WordPressでindexのリダイレクト(改訂版)'>WordPressでindexのリダイレクト(改訂版)</a> <small>index.htmlのリダイレクト、index.phpのリダイレクト、と色々研究してきましたが、最終的には ・index.htmlは通常のリダイレクトでOK ・index.phpはmod rewritを使用するか、Wor [...]...</small></li></ol>]]></description>
			<content:encoded><![CDATA[<p>.htaccessでの指定で、HTTPのアクセスをHTTPSにリダイレクトします。</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">RewriteEngine on
RewriteCond <span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>SERVER_PORT<span style="color: #7a0874; font-weight: bold;">&#125;</span> ^<span style="color: #000000;">443</span>$
RewriteRule ^<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>dacelo<span style="color: #000000; font-weight: bold;">/</span>html<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>.<span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> http:<span style="color: #000000; font-weight: bold;">//%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>HTTP_HOST<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">/</span>$<span style="color: #000000;">1</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #007800;">R</span>=<span style="color: #000000;">301</span>,L<span style="color: #7a0874; font-weight: bold;">&#93;</span></pre></div></div>

<p>解説</p>
<p>443ポート、すなわちHTTPSに来たアクセスを、HTTPにリライトしています。<br />
逆にHTTP→HTTPSにする場合は、リライトルールを 80番ポートにして、HTTPSに送るようにすればOKです。 <img src='http://blog.dacelo.info/wp-includes/images/smilies/icon_razz.gif' alt=':-P' class='wp-smiley' /> </p>


<p>Related posts:<ol><li><a href='http://blog.dacelo.info/wordpress/entry-794.html' rel='bookmark' title='Permanent Link: WordPressでindex.htmlをリダイレクトする方法'>WordPressでindex.htmlをリダイレクトする方法</a> <small>既存のサイトをWordPressに置き換えたあとによく発生する問題です。 リンクや検索エンジンの登録が、&#8221;/&#8221;ルートではなく　&#8221;/index.html&#8221;に対してなされている [...]...</small></li><li><a href='http://blog.dacelo.info/wordpress/entry-797.html' rel='bookmark' title='Permanent Link: WordPressでindexのリダイレクト(改訂版)'>WordPressでindexのリダイレクト(改訂版)</a> <small>index.htmlのリダイレクト、index.phpのリダイレクト、と色々研究してきましたが、最終的には ・index.htmlは通常のリダイレクトでOK ・index.phpはmod rewritを使用するか、Wor [...]...</small></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.dacelo.info/apache/entry-792.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://blog.dacelo.info/apache/entry-792.html" />
	</item>
		<item>
		<title>ApacheがRestartできない！(98)Address already in use: make_sock…</title>
		<link>http://blog.dacelo.info/apache/entry-782.html</link>
		<comments>http://blog.dacelo.info/apache/entry-782.html#comments</comments>
		<pubDate>Fri, 26 Mar 2010 13:59:30 +0000</pubDate>
		<dc:creator>dacelo</dc:creator>
				<category><![CDATA[apache]]></category>

		<guid isPermaLink="false">http://blog.dacelo.info/apache/entry-782.html</guid>
		<description><![CDATA[Apacheが突然死しているようなので再起動してみたら、どうもおかしい。
一旦立ち上がったんだけど、もう一度リスタートかけようとすると、こんなエラーメッセージが出て、停止もできない。
[root@www home]# s [...]


Related posts:<ol><li><a href='http://blog.dacelo.info/apache/entry-713.html' rel='bookmark' title='Permanent Link: Apacheのエラー：Could not reliably determine the server&#8217;s fully qualified domain name&#8230;'>Apacheのエラー：Could not reliably determine the server&#8217;s fully qualified domain name&#8230;</a> <small>Apacheを再起動した際に、 httpd: Could not reliably determine the server&#8217;s fully qualified...</small></li><li><a href='http://blog.dacelo.info/linux/entry-196.html' rel='bookmark' title='Permanent Link: Linux serviceの開始と停止コマンド'>Linux serviceの開始と停止コマンド</a> <small>apacheの設定を変更したときなど、よくservice httpd restartで再開を実行するけど、そういえばreloadなど他にも開始系コマンドがある。あとはサービスの状況によって動きが違うcondrestart [...]...</small></li><li><a href='http://blog.dacelo.info/tool/entry-790.html' rel='bookmark' title='Permanent Link: Google Skipfishのインストールと実行'>Google Skipfishのインストールと実行</a> <small>Googleが先月（2010年3月）にリリースした、オープンソースのウェブセキュリティスキャナ「skipfish」をインストールして試してみた。 ブラインドSQLやXMLインジェクションといったセキュリティホールがあるか [...]...</small></li></ol>]]></description>
			<content:encoded><![CDATA[<p>Apacheが突然死しているようなので再起動してみたら、どうもおかしい。<br />
一旦立ち上がったんだけど、もう一度リスタートかけようとすると、こんなエラーメッセージが出て、停止もできない。</p>
<div class="mysql">[root@www home]# service httpd restart<br />
httpd を停止中:                                            [<span style="color: #ff0000;">失敗</span>]<br />
httpd を起動中: (98)Address already in use: make_sock: could not bind to address [::]:80<br />
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80<br />
no listening sockets available, shutting down<br />
Unable to open logs<br />
[<span style="color: #ff0000;">失敗</span>]</div>
<p>これは通常、ポート80を他のプロセスが使用しているときに出るエラーメッセージ。<br />
どうやらApacheが異常終了したせいで、古いApacheのプロセスが残っているのを、新しいApacheが「80番ポートが使われている！？」と誤解しているらしい。</p>
<p>lsofでhttpのプロセスを調べ、一つずつ強制KILLすると解決する。</p>
<div class="mysql">[root@www ~]# /usr/sbin/lsof -i | grep http</div>
<div class="mysql">httpd      7524  apache    3u  IPv6 401602       TCP *:http (LISTEN)<br />
httpd      7524  apache    5u  IPv6 401607       TCP *:https (LISTEN)</div>
<p>こいつらが80番ポートに居残っているプロセス。</p>
<div class="mysql">[root@www ~]# kill -9  7464<br />
[root@www ~]# kill -9  7491</div>
<p>キル！キル！</p>
<div class="mysql">[root@www ~]# service httpd restart<br />
httpd を停止中:                                            [<span style="color: #ff0000;">失敗</span>]<br />
httpd を起動中:                                            [ <span style="color: #00ff00;"> OK</span> ]</div>
<p>全部キルしたらすっきりリスタートできるようになりました。</p>
<div class="note">
参照ページ<br />
<a href="http://kb.parallels.co.jp/index.php?action=artikel&amp;cat=3&amp;id=456&amp;artlang=ja" target="_blank">Parellels FAQ &#8211; Apacheが起動しない：&quot;(98)Address already in use: make_sock: could not bind to address&quot;</a>
</div>


<p>Related posts:<ol><li><a href='http://blog.dacelo.info/apache/entry-713.html' rel='bookmark' title='Permanent Link: Apacheのエラー：Could not reliably determine the server&#8217;s fully qualified domain name&#8230;'>Apacheのエラー：Could not reliably determine the server&#8217;s fully qualified domain name&#8230;</a> <small>Apacheを再起動した際に、 httpd: Could not reliably determine the server&#8217;s fully qualified...</small></li><li><a href='http://blog.dacelo.info/linux/entry-196.html' rel='bookmark' title='Permanent Link: Linux serviceの開始と停止コマンド'>Linux serviceの開始と停止コマンド</a> <small>apacheの設定を変更したときなど、よくservice httpd restartで再開を実行するけど、そういえばreloadなど他にも開始系コマンドがある。あとはサービスの状況によって動きが違うcondrestart [...]...</small></li><li><a href='http://blog.dacelo.info/tool/entry-790.html' rel='bookmark' title='Permanent Link: Google Skipfishのインストールと実行'>Google Skipfishのインストールと実行</a> <small>Googleが先月（2010年3月）にリリースした、オープンソースのウェブセキュリティスキャナ「skipfish」をインストールして試してみた。 ブラインドSQLやXMLインジェクションといったセキュリティホールがあるか [...]...</small></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.dacelo.info/apache/entry-782.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://blog.dacelo.info/apache/entry-782.html" />
	</item>
		<item>
		<title>apacheのトリビア</title>
		<link>http://blog.dacelo.info/apache/entry-769.html</link>
		<comments>http://blog.dacelo.info/apache/entry-769.html#comments</comments>
		<pubDate>Wed, 27 Jan 2010 08:57:54 +0000</pubDate>
		<dc:creator>dacelo</dc:creator>
				<category><![CDATA[apache]]></category>

		<guid isPermaLink="false">http://blog.dacelo.info/apache/entry-769.html</guid>
		<description><![CDATA[apacheのServerAliasには、果たしてどのくらいまで登録できるのか？
検証してみました。
【結論：8719byteまでOK】
ドメイン数ではなく、文字数で限界が設定されていました。


No related  [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>apacheのServerAliasには、果たしてどのくらいまで登録できるのか？<br />
検証してみました。<br />
【結論：8719byteまでOK】<br />
ドメイン数ではなく、文字数で限界が設定されていました。</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.dacelo.info/apache/entry-769.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://blog.dacelo.info/apache/entry-769.html" />
	</item>
		<item>
		<title>httpd.confでsafe_modeをon/offにする</title>
		<link>http://blog.dacelo.info/apache/entry-765.html</link>
		<comments>http://blog.dacelo.info/apache/entry-765.html#comments</comments>
		<pubDate>Tue, 05 Jan 2010 06:44:56 +0000</pubDate>
		<dc:creator>dacelo</dc:creator>
				<category><![CDATA[apache]]></category>

		<guid isPermaLink="false">http://blog.dacelo.info/apache/entry-765.html</guid>
		<description><![CDATA[皆様、明けましておめでとうございます。いやぁ、早いものでこのブログも2年目なんですね。今年もちょぼちょぼと更新してまいりますのでよろしくお願いいたします。
さて、今回はsafe_modeについて。
phpのsafe_mo [...]


Related posts:<ol><li><a href='http://blog.dacelo.info/apache/entry-714.html' rel='bookmark' title='Permanent Link: httpd.confでRedirectの設定'>httpd.confでRedirectの設定</a> <small>Webサイトの移転で必須のRedirect設定、.htaccessでやることが多いですが、 Apacheの設定ファイル・httpd.confでやってしまうと一括指定できて早いです。 &lt;VirtualHost 19 [...]...</small></li><li><a href='http://blog.dacelo.info/apache/entry-94.html' rel='bookmark' title='Permanent Link: cgi-bin以外のフォルダでもCGIが使えるようにする'>cgi-bin以外のフォルダでもCGIが使えるようにする</a> <small>テストでMovable Typeを設置しようとしたんだけど、mt-check.cgi（環境チェック用プログラム）を実行しようとしたらコードがズラっと表示されてしまう。あれ、おかしいな権限かな…。しかし権限が適切に設定され [...]...</small></li><li><a href='http://blog.dacelo.info/linux/entry-424.html' rel='bookmark' title='Permanent Link: 複数サイトでphpMyAdminを共有する'>複数サイトでphpMyAdminを共有する</a> <small>CMSを使って、同一サーバーで複数のサイトを管理していたりするときに、phpMyAdminをサイトの数だけそれぞれのドキュメントルートに突っ込んだりしていませんか？ どうせ覗くのは同じMySQLサーバーなのに、面倒だしサ [...]...</small></li></ol>]]></description>
			<content:encoded><![CDATA[<p>皆様、明けましておめでとうございます。いやぁ、早いものでこのブログも2年目なんですね。今年もちょぼちょぼと更新してまいりますのでよろしくお願いいたします。</p>
<p>さて、今回はsafe_modeについて。<br />
phpのsafe_modeは、PHP6で正式に削除されることが決定しているので、使わないことが推奨されているんですが、まぁ諸々の事情で使わざるを得ないことがあります。<br />
通常、php.iniでon/offを切り替えるんですが、使うんであれば限定的に、あるサイトのバーチャルホストの中だけで有効にしたい、というような気持ちってありますね。</p>
<p>そんなときは、httpd.confにて次のように書きます。</p>
<blockquote class="mysql"><p><VirtualHost 192.168.11.111:80><br />
    DocumentRoot /home/blog.dacelo.info/<br />
    ServerName blog.dacelo.info<br />
    <Directory "/home/blog.dacelo.info"><br />
    AllowOverride All<br />
    Options ExecCGI FollowSymlinks<br />
    </Directory><br />
    <IfModule mod_php5.c><br />
      php_admin_flag safe_mode on<br />
    </IfModule><br />
</VirtualHost>
</p></blockquote>
<p>これで、blog.dacelo.infoの中でだけsafe_modeがonになりました。</p>


<p>Related posts:<ol><li><a href='http://blog.dacelo.info/apache/entry-714.html' rel='bookmark' title='Permanent Link: httpd.confでRedirectの設定'>httpd.confでRedirectの設定</a> <small>Webサイトの移転で必須のRedirect設定、.htaccessでやることが多いですが、 Apacheの設定ファイル・httpd.confでやってしまうと一括指定できて早いです。 &lt;VirtualHost 19 [...]...</small></li><li><a href='http://blog.dacelo.info/apache/entry-94.html' rel='bookmark' title='Permanent Link: cgi-bin以外のフォルダでもCGIが使えるようにする'>cgi-bin以外のフォルダでもCGIが使えるようにする</a> <small>テストでMovable Typeを設置しようとしたんだけど、mt-check.cgi（環境チェック用プログラム）を実行しようとしたらコードがズラっと表示されてしまう。あれ、おかしいな権限かな…。しかし権限が適切に設定され [...]...</small></li><li><a href='http://blog.dacelo.info/linux/entry-424.html' rel='bookmark' title='Permanent Link: 複数サイトでphpMyAdminを共有する'>複数サイトでphpMyAdminを共有する</a> <small>CMSを使って、同一サーバーで複数のサイトを管理していたりするときに、phpMyAdminをサイトの数だけそれぞれのドキュメントルートに突っ込んだりしていませんか？ どうせ覗くのは同じMySQLサーバーなのに、面倒だしサ [...]...</small></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.dacelo.info/apache/entry-765.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://blog.dacelo.info/apache/entry-765.html" />
	</item>
		<item>
		<title>httpd.confでRedirectの設定</title>
		<link>http://blog.dacelo.info/apache/entry-714.html</link>
		<comments>http://blog.dacelo.info/apache/entry-714.html#comments</comments>
		<pubDate>Tue, 26 May 2009 06:08:52 +0000</pubDate>
		<dc:creator>dacelo</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://blog.dacelo.info/apache/entry-714.html</guid>
		<description><![CDATA[Webサイトの移転で必須のRedirect設定、.htaccessでやることが多いですが、
Apacheの設定ファイル・httpd.confでやってしまうと一括指定できて早いです。

&#60;VirtualHost 19 [...]


Related posts:<ol><li><a href='http://blog.dacelo.info/apache/entry-765.html' rel='bookmark' title='Permanent Link: httpd.confでsafe_modeをon/offにする'>httpd.confでsafe_modeをon/offにする</a> <small>皆様、明けましておめでとうございます。いやぁ、早いものでこのブログも2年目なんですね。今年もちょぼちょぼと更新してまいりますのでよろしくお願いいたします。 さて、今回はsafe_modeについて。 phpのsafe_mo [...]...</small></li><li><a href='http://blog.dacelo.info/apache/entry-713.html' rel='bookmark' title='Permanent Link: Apacheのエラー：Could not reliably determine the server&#8217;s fully qualified domain name&#8230;'>Apacheのエラー：Could not reliably determine the server&#8217;s fully qualified domain name&#8230;</a> <small>Apacheを再起動した際に、 httpd: Could not reliably determine the server&#8217;s fully qualified...</small></li><li><a href='http://blog.dacelo.info/wordpress/entry-797.html' rel='bookmark' title='Permanent Link: WordPressでindexのリダイレクト(改訂版)'>WordPressでindexのリダイレクト(改訂版)</a> <small>index.htmlのリダイレクト、index.phpのリダイレクト、と色々研究してきましたが、最終的には ・index.htmlは通常のリダイレクトでOK ・index.phpはmod rewritを使用するか、Wor [...]...</small></li></ol>]]></description>
			<content:encoded><![CDATA[<p>Webサイトの移転で必須のRedirect設定、.htaccessでやることが多いですが、<br />
Apacheの設定ファイル・httpd.confでやってしまうと一括指定できて早いです。</p>
<pre class="mysql">
&lt;VirtualHost 192.168.0.200&gt;
ServerName old.example.jp
Redirect permanent / http://www.example.com/
&lt;/VirtualHost&gt;
</pre>
<p>上記例では、使わなくなったサブドメイン「old」をwwwに恒久的リダイレクトさせています。<br />
複数のサブドメインを指定する際には、ServerAliasで設定すればOKです。</p>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" src="http://img.zemanta.com/pixy.gif?x-id=98d7688e-7330-87d0-a58b-596f0e2a1632" /></div>


<p>Related posts:<ol><li><a href='http://blog.dacelo.info/apache/entry-765.html' rel='bookmark' title='Permanent Link: httpd.confでsafe_modeをon/offにする'>httpd.confでsafe_modeをon/offにする</a> <small>皆様、明けましておめでとうございます。いやぁ、早いものでこのブログも2年目なんですね。今年もちょぼちょぼと更新してまいりますのでよろしくお願いいたします。 さて、今回はsafe_modeについて。 phpのsafe_mo [...]...</small></li><li><a href='http://blog.dacelo.info/apache/entry-713.html' rel='bookmark' title='Permanent Link: Apacheのエラー：Could not reliably determine the server&#8217;s fully qualified domain name&#8230;'>Apacheのエラー：Could not reliably determine the server&#8217;s fully qualified domain name&#8230;</a> <small>Apacheを再起動した際に、 httpd: Could not reliably determine the server&#8217;s fully qualified...</small></li><li><a href='http://blog.dacelo.info/wordpress/entry-797.html' rel='bookmark' title='Permanent Link: WordPressでindexのリダイレクト(改訂版)'>WordPressでindexのリダイレクト(改訂版)</a> <small>index.htmlのリダイレクト、index.phpのリダイレクト、と色々研究してきましたが、最終的には ・index.htmlは通常のリダイレクトでOK ・index.phpはmod rewritを使用するか、Wor [...]...</small></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.dacelo.info/apache/entry-714.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://blog.dacelo.info/apache/entry-714.html" />
	</item>
		<item>
		<title>Apacheのエラー：Could not reliably determine the server&#8217;s fully qualified domain name&#8230;</title>
		<link>http://blog.dacelo.info/apache/entry-713.html</link>
		<comments>http://blog.dacelo.info/apache/entry-713.html#comments</comments>
		<pubDate>Mon, 25 May 2009 01:25:47 +0000</pubDate>
		<dc:creator>dacelo</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://blog.dacelo.info/uncategorized/entry-713.html</guid>
		<description><![CDATA[Apacheを再起動した際に、
httpd: Could not reliably determine the server&#8217;s fully qualified domain name, using 127. [...]


Related posts:<ol><li><a href='http://blog.dacelo.info/apache/entry-782.html' rel='bookmark' title='Permanent Link: ApacheがRestartできない！(98)Address already in use: make_sock…'>ApacheがRestartできない！(98)Address already in use: make_sock…</a> <small>Apacheが突然死しているようなので再起動してみたら、どうもおかしい。 一旦立ち上がったんだけど、もう一度リスタートかけようとすると、こんなエラーメッセージが出て、停止もできない。 [root@www home]# s [...]...</small></li><li><a href='http://blog.dacelo.info/tool/entry-747.html' rel='bookmark' title='Permanent Link: phpPgAdminにログインできないときの解決法'>phpPgAdminにログインできないときの解決法</a> <small>phpで書かれたWebベースのPostgreSQL管理ツール、phpPgAdminのレスキューtipsです。 「phpPgAdmin :: Web Based PostgreSQL Administration Tool [...]...</small></li><li><a href='http://blog.dacelo.info/mysql/entry-9.html' rel='bookmark' title='Permanent Link: Mysqlに「Can&#8217;t connect to local MySQL server through socket」が出て接続できない'>Mysqlに「Can&#8217;t connect to local MySQL server through socket」が出て接続できない</a> <small>MySQLに接続しようとすると（ターミナルでもphpMyAdminでもMovableTypeでも何でも）、　「Can&#8217;t connect to local MySQL server through socke [...]...</small></li></ol>]]></description>
			<content:encoded><![CDATA[<p>Apacheを再起動した際に、</p>
<blockquote class="mysql"><p>httpd: Could not reliably determine the server&#8217;s fully qualified domain name, using 127.0.0.1 for ServerName</p></blockquote>
<p>というエラーが出る場合がある。<br />
これでも起動はするので、Apache自体は動くのだが、エラーをそのままにしておくのは気持ちが悪いし、あとあと問題を引き起こす可能性が高い。</p>
<p>日本語訳をすると</p>
<blockquote><p>ServerNameに127.0.0.1を使用した、FQDN（完全に適切なドメイン名）が確定できませんでした。</p></blockquote>
<p>といった感じか。</p>
<p>このエラーは、/etc/hosts にlocalhost以外に自分で設定したホスト名が、Apacheの設定ファイルに定義されていないために発生する。</p>
<pre class="mysql">
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1               dacelo localhost.localdomain localhost
</pre>
<p>と書いた場合、/etc/httpd/conf/httpd.conf のServerNameの設定にも次のように書いておく。</p>
<pre class="mysql">
# ServerName gives the name and port that the server uses to identify itself.
# This can often be determined automatically, but we recommend you specify
# it explicitly to prevent problems during startup.
#
# If this is not set to valid DNS name for your host, server-generated
# redirections will not work.  See also the UseCanonicalName directive.
#
# If your host doesn't have a registered DNS name, enter its IP address here.
# You will have to access it by its address anyway, and this will make
# redirections work in a sensible way.
#
#ServerName www.example.com:80
ServerName dacelo:80
</pre>


<p>Related posts:<ol><li><a href='http://blog.dacelo.info/apache/entry-782.html' rel='bookmark' title='Permanent Link: ApacheがRestartできない！(98)Address already in use: make_sock…'>ApacheがRestartできない！(98)Address already in use: make_sock…</a> <small>Apacheが突然死しているようなので再起動してみたら、どうもおかしい。 一旦立ち上がったんだけど、もう一度リスタートかけようとすると、こんなエラーメッセージが出て、停止もできない。 [root@www home]# s [...]...</small></li><li><a href='http://blog.dacelo.info/tool/entry-747.html' rel='bookmark' title='Permanent Link: phpPgAdminにログインできないときの解決法'>phpPgAdminにログインできないときの解決法</a> <small>phpで書かれたWebベースのPostgreSQL管理ツール、phpPgAdminのレスキューtipsです。 「phpPgAdmin :: Web Based PostgreSQL Administration Tool [...]...</small></li><li><a href='http://blog.dacelo.info/mysql/entry-9.html' rel='bookmark' title='Permanent Link: Mysqlに「Can&#8217;t connect to local MySQL server through socket」が出て接続できない'>Mysqlに「Can&#8217;t connect to local MySQL server through socket」が出て接続できない</a> <small>MySQLに接続しようとすると（ターミナルでもphpMyAdminでもMovableTypeでも何でも）、　「Can&#8217;t connect to local MySQL server through socke [...]...</small></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.dacelo.info/apache/entry-713.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://blog.dacelo.info/apache/entry-713.html" />
	</item>
		<item>
		<title>.htaccessでSSL(https)必須にする &#8220;SSLRequireSSL&#8221;</title>
		<link>http://blog.dacelo.info/apache/entry-697.html</link>
		<comments>http://blog.dacelo.info/apache/entry-697.html#comments</comments>
		<pubDate>Thu, 05 Mar 2009 07:33:16 +0000</pubDate>
		<dc:creator>dacelo</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://blog.dacelo.info/apache/entry-697.html</guid>
		<description><![CDATA[phpMyAdminとか、クリティカルでデリケートなWebアプリケーションを扱うとき、httpで普通に操作するのはちょっと不用心すぎます。
httpは暗号化されてないので、データベースの情報やパスワードがそのままヒラヒラ [...]


Related posts:<ol><li><a href='http://blog.dacelo.info/apache/entry-765.html' rel='bookmark' title='Permanent Link: httpd.confでsafe_modeをon/offにする'>httpd.confでsafe_modeをon/offにする</a> <small>皆様、明けましておめでとうございます。いやぁ、早いものでこのブログも2年目なんですね。今年もちょぼちょぼと更新してまいりますのでよろしくお願いいたします。 さて、今回はsafe_modeについて。 phpのsafe_mo [...]...</small></li><li><a href='http://blog.dacelo.info/linux/entry-424.html' rel='bookmark' title='Permanent Link: 複数サイトでphpMyAdminを共有する'>複数サイトでphpMyAdminを共有する</a> <small>CMSを使って、同一サーバーで複数のサイトを管理していたりするときに、phpMyAdminをサイトの数だけそれぞれのドキュメントルートに突っ込んだりしていませんか？ どうせ覗くのは同じMySQLサーバーなのに、面倒だしサ [...]...</small></li><li><a href='http://blog.dacelo.info/linux/entry-307.html' rel='bookmark' title='Permanent Link: シンボリックリンクが削除できない！？'>シンボリックリンクが削除できない！？</a> <small>別サイトに設置したphpMyAdminを流用しようとして作ったシンボリックリンクが削除できない。 [root@dacelo DocumentRoot]# rm phpMyAdmin/ rm: cannot remove [...]...</small></li></ol>]]></description>
			<content:encoded><![CDATA[<p>phpMyAdminとか、クリティカルでデリケートなWebアプリケーションを扱うとき、httpで普通に操作するのはちょっと不用心すぎます。<br />
httpは暗号化されてないので、データベースの情報やパスワードがそのままヒラヒラと飛び交ってしまうからです。<br />
そんなときは、.htaccessでお手軽にSSL必須設定にしておきましょう。<br />
.htaccess に</p>
<pre class="mysql">SSLRequireSSL</pre>
<p>と書くだけで、そのディレクトリ以下はSSL必須となり、httpの場合はAccess Forbiddenになります。</p>
<p>httpd.confに記述するなら</p>
<pre class="mysql">　　&lt;Directory "/home/hoge/DocumentRoot"&gt;
　　　SSLRequireSSL
　　&lt;/Directory&gt;</pre>
<p>といった感じです。</p>


<p>Related posts:<ol><li><a href='http://blog.dacelo.info/apache/entry-765.html' rel='bookmark' title='Permanent Link: httpd.confでsafe_modeをon/offにする'>httpd.confでsafe_modeをon/offにする</a> <small>皆様、明けましておめでとうございます。いやぁ、早いものでこのブログも2年目なんですね。今年もちょぼちょぼと更新してまいりますのでよろしくお願いいたします。 さて、今回はsafe_modeについて。 phpのsafe_mo [...]...</small></li><li><a href='http://blog.dacelo.info/linux/entry-424.html' rel='bookmark' title='Permanent Link: 複数サイトでphpMyAdminを共有する'>複数サイトでphpMyAdminを共有する</a> <small>CMSを使って、同一サーバーで複数のサイトを管理していたりするときに、phpMyAdminをサイトの数だけそれぞれのドキュメントルートに突っ込んだりしていませんか？ どうせ覗くのは同じMySQLサーバーなのに、面倒だしサ [...]...</small></li><li><a href='http://blog.dacelo.info/linux/entry-307.html' rel='bookmark' title='Permanent Link: シンボリックリンクが削除できない！？'>シンボリックリンクが削除できない！？</a> <small>別サイトに設置したphpMyAdminを流用しようとして作ったシンボリックリンクが削除できない。 [root@dacelo DocumentRoot]# rm phpMyAdmin/ rm: cannot remove [...]...</small></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.dacelo.info/apache/entry-697.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://blog.dacelo.info/apache/entry-697.html" />
	</item>
		<item>
		<title>cgi-bin以外のフォルダでもCGIが使えるようにする</title>
		<link>http://blog.dacelo.info/apache/entry-94.html</link>
		<comments>http://blog.dacelo.info/apache/entry-94.html#comments</comments>
		<pubDate>Mon, 08 Sep 2008 02:50:52 +0000</pubDate>
		<dc:creator>dacelo</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[Movable Type]]></category>

		<guid isPermaLink="false">http://www.dacelo.info/blog/uncategorized/entry-113.html</guid>
		<description><![CDATA[テストでMovable Typeを設置しようとしたんだけど、mt-check.cgi（環境チェック用プログラム）を実行しようとしたらコードがズラっと表示されてしまう。あれ、おかしいな権限かな…。しかし権限が適切に設定され [...]


Related posts:<ol><li><a href='http://blog.dacelo.info/wordpress/entry-185.html' rel='bookmark' title='Permanent Link: WordPress vs Movable Type'>WordPress vs Movable Type</a> <small>WordPressとMovable Type、今はどっちが強いのか！？ 一つの目安として、Google Trendsで、WordPressとMovable Typeの検索状況を比較してみよう。 これは検索動向の調査ツール [...]...</small></li><li><a href='http://blog.dacelo.info/movabletype/entry-114.html' rel='bookmark' title='Permanent Link: Movable Type4.2のインストールが進まない件'>Movable Type4.2のインストールが進まない件</a> <small>MT4をインストールしようとしたところ、初期ログイン画面から一向に進まない現象が発生。 以下、顛末と簡易分析。 mt-check.cgiが起動し、モジュール群がそろっていることを確認。 次に、そのまま設置ディレクトリ/ [...]...</small></li><li><a href='http://blog.dacelo.info/uncategorized/entry-201.html' rel='bookmark' title='Permanent Link: 英語翻訳版ブログ'>英語翻訳版ブログ</a> <small>ウェブの機械翻訳を通すことによって、擬似的に英語ページができあがる。 いくつかのサービスで、英語版を模索してみた。 Google System training blog Yahoo System ascetic pra...</small></li></ol>]]></description>
			<content:encoded><![CDATA[<p>テストでMovable Typeを設置しようとしたんだけど、mt-check.cgi（環境チェック用プログラム）を実行しようとしたらコードがズラっと表示されてしまう。あれ、おかしいな権限かな…。しかし権限が適切に設定されていない場合は500エラーになるはず…。</p>
<p>「そうか、CGIの設定がデフォルト（/var/www/cgi-bin/のみで実行）のままなんだ」</p>
<h3>任意のフォルダでCGIを実行する設定</h3>
<p>CGIは、通常CGI専用のフォルダで実行されるようになっています。ただしこういうテストの場合や、セキュリティに不安がない場合、他の場所で実行したいことがあります。<br />
そんなときは、apacheの設定に1箇所追加します。CGIを実行したいディレクトリの.htaccessでも結構です。</p>
<pre class="source">
Options +ExecCGI</pre>
<p>これで、userユーザーのwww以下ならどこのフォルダでもCGIが実行されるようになりました。</p>
<p>あとは、Movable Typeでは.plの形式のファイルもあるので、拡張子の設定に.plを追加します。</p>
<pre class="source">AddHandler cgi-script .cgi .pl</pre>
<p>[service httpd restart]でApacheを再起動して完了。<br />
Hello Worldなどを好きな場所に置いて動作確認しましょう。</p>
<p>↓「Hello, World.」を表示するPerlプログラム</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/usr/bin/perl</span>
<span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;Content-type: text/html<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;Hello, World.&quot;</span><span style="color: #339933;">;</span></pre></div></div>



<p>Related posts:<ol><li><a href='http://blog.dacelo.info/wordpress/entry-185.html' rel='bookmark' title='Permanent Link: WordPress vs Movable Type'>WordPress vs Movable Type</a> <small>WordPressとMovable Type、今はどっちが強いのか！？ 一つの目安として、Google Trendsで、WordPressとMovable Typeの検索状況を比較してみよう。 これは検索動向の調査ツール [...]...</small></li><li><a href='http://blog.dacelo.info/movabletype/entry-114.html' rel='bookmark' title='Permanent Link: Movable Type4.2のインストールが進まない件'>Movable Type4.2のインストールが進まない件</a> <small>MT4をインストールしようとしたところ、初期ログイン画面から一向に進まない現象が発生。 以下、顛末と簡易分析。 mt-check.cgiが起動し、モジュール群がそろっていることを確認。 次に、そのまま設置ディレクトリ/ [...]...</small></li><li><a href='http://blog.dacelo.info/uncategorized/entry-201.html' rel='bookmark' title='Permanent Link: 英語翻訳版ブログ'>英語翻訳版ブログ</a> <small>ウェブの機械翻訳を通すことによって、擬似的に英語ページができあがる。 いくつかのサービスで、英語版を模索してみた。 Google System training blog Yahoo System ascetic pra...</small></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.dacelo.info/apache/entry-94.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://blog.dacelo.info/apache/entry-94.html" />
	</item>
	</channel>
</rss>
