<?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/"
	>

<channel>
	<title>Web活メモ帳 &#187; サーバー関連</title>
	<atom:link href="http://blog.verygoodtown.com/category/server-side/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.verygoodtown.com</link>
	<description>WEB開発者が使える世界の情報を発信します。</description>
	<lastBuildDate>Thu, 09 Feb 2012 02:01:28 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>CentOSでユーザ一覧を確認する方法</title>
		<link>http://blog.verygoodtown.com/2010/09/centos-user-list/</link>
		<comments>http://blog.verygoodtown.com/2010/09/centos-user-list/#comments</comments>
		<pubDate>Fri, 03 Sep 2010 01:13:42 +0000</pubDate>
		<dc:creator>linja</dc:creator>
				<category><![CDATA[サーバー関連]]></category>
		<category><![CDATA[CentOS]]></category>

		<guid isPermaLink="false">http://blog.verygoodtown.com/?p=5016</guid>
		<description><![CDATA[CentOS内のユーザ一覧を確認する方法です。
良く忘れるのでメモ。
/etc/passwdにあります。

[root@localhost ~]# cat /etc/passwd

]]></description>
			<content:encoded><![CDATA[<p>CentOS内のユーザ一覧を確認する方法です。</p>
<p>良く忘れるのでメモ。</p>
<p>/etc/passwdにあります。</p>
<pre class="code">
[root@localhost ~]# cat /etc/passwd
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.verygoodtown.com/2010/09/centos-user-list/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>サーバーOS再インストール時のSSHクライアント設定</title>
		<link>http://blog.verygoodtown.com/2010/08/ssh-client-setting-mac/</link>
		<comments>http://blog.verygoodtown.com/2010/08/ssh-client-setting-mac/#comments</comments>
		<pubDate>Tue, 31 Aug 2010 00:22:41 +0000</pubDate>
		<dc:creator>linja</dc:creator>
				<category><![CDATA[サーバー関連]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://blog.verygoodtown.com/?p=4983</guid>
		<description><![CDATA[WEBサーバーのOSを再インストールした際にMacのSSHクライアントから接続できなくなってしまいました。
クライアントにはiTermとJellySSHを使用しています。

JellySSHにホスト名とユーザー名を入力し [...]]]></description>
			<content:encoded><![CDATA[<p>WEBサーバーのOSを再インストールした際にMacのSSHクライアントから接続できなくなってしまいました。</p>
<p>クライアントには<strong>iTermとJellySSH</strong>を使用しています。</p>
<p><span id="more-4983"></span></p>
<p>JellySSHにホスト名とユーザー名を入力して接続しようとした所、ターミナルが立ち上がるのですが、すぐに閉じてしまいます。</p>
<p>色々ためして見た所、どうやらknown_hostsの値が一致しないためのエラーだったようです。</p>
<p>Macのデフォルトのターミナルからコマンドを実行した所、それっぽいエラーメッセージが出たため判明しました。</p>
<pre class="code">
$ ssh root@IPアドレス
    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    @    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!      @
    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
    Someone could be eavesdropping on you right now (man-in-the-middle attack)!
    It is also possible that the RSA host key has just been changed.
    The fingerprint for the RSA key sent by the remote host is
    a8:6a:60:5a:48:64:ac:90:33:b9:f2:7c:be:56:92:81.
    Please contact your system administrator.
    Add correct host key in /var/root/.ssh/known_hosts to get rid of this message.
    Offending key in /var/root/.ssh/known_hosts:1
    RSA host key for napster has changed and you have requested strict checking.
    Host key verification failed.
</pre>
<p>どうやら /var/root/.ssh/known_hosts の１行目に別なキーが登録されているためのエラーのようです。<br />
known_hostsのファイルを一度削除する事で問題なく動作しました。</p>
<pre class="code">
# rm -f .ssh/known_hosts
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.verygoodtown.com/2010/08/ssh-client-setting-mac/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SSH接続にイーモバイルのIP帯域を追加</title>
		<link>http://blog.verygoodtown.com/2010/08/ssh-emobile-ip/</link>
		<comments>http://blog.verygoodtown.com/2010/08/ssh-emobile-ip/#comments</comments>
		<pubDate>Mon, 30 Aug 2010 00:25:55 +0000</pubDate>
		<dc:creator>linja</dc:creator>
				<category><![CDATA[サーバー関連]]></category>
		<category><![CDATA[emobile]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://blog.verygoodtown.com/?p=4926</guid>
		<description><![CDATA[SSHのアクセス制限にイーモバイルからのアクセスを許可する方法のメモ。
とあるサーバーのメンテの際にSSH接続する必要があったのですが、イーモバイルは接続するたびにIPアドレスが変更されるためイーモバイルは全て許可するよ [...]]]></description>
			<content:encoded><![CDATA[<p>SSHのアクセス制限に<strong>イーモバイルからのアクセスを許可する方法</strong>のメモ。</p>
<p>とあるサーバーのメンテの際にSSH接続する必要があったのですが、イーモバイルは接続するたびにIPアドレスが変更されるためイーモバイルは全て許可するように設定しました。</p>
<p><span id="more-4926"></span></p>
<h3>2008年から更新されない公式情報</h3>
<p>単純にIPを許可すれば良いだけなのですが、公式サイトにある情報が2008年から更新されていない&#8230; orz<br />
<a href="http://developer.emnet.ne.jp/ipaddress.html" target="_blank">IPアドレス帯域 &#8211; 技術情報 | イー・モバイル</a></p>
<p>調べた所、以下のipが使われているようです。</p>
<pre class="code">
whois -h whois.nic.ad.jp ^NT5299JP
60.254.192.0/18
111.188.0.0/14
114.48.0.0/14
117.55.0.0/17
119.72.0.0/16
</pre>
<p>/etc/hosts.allowに以下を追加しておきました。</p>
<pre class="code">
sshd : 60.254.192.
sshd : 111.188. 111.189. 111.190. 111.191.
sshd : 114.48. 114.49. 114.50. 114.51.
sshd : 117.55.
sshd : 119.72.
</pre>
<p>※作業が完了した後は必要なければコメントアウトしておきましょう。</p>
<p>以下のサイトを参考にさせていただきました。ありがとうございます！<br />
<a href="http://funkyz.jp/blog/archives/2010/03/mobile_ip.html" target="_blank">イーモバイルのIPアドレス帯域</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.verygoodtown.com/2010/08/ssh-emobile-ip/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CentOSにtripwireをインストール際のC++エラー回避</title>
		<link>http://blog.verygoodtown.com/2010/08/webarena-tripwire-install/</link>
		<comments>http://blog.verygoodtown.com/2010/08/webarena-tripwire-install/#comments</comments>
		<pubDate>Thu, 26 Aug 2010 01:44:41 +0000</pubDate>
		<dc:creator>linja</dc:creator>
				<category><![CDATA[サーバー関連]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[WebARENA]]></category>

		<guid isPermaLink="false">http://blog.verygoodtown.com/?p=5098</guid>
		<description><![CDATA[Tripwireをインストールする際にエラーが、、、

configure: error: C++ preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details.


gcc-c++をインストールする事で解決しました。

[root@localhost ~]# yum -y install gcc-c++
Loaded plugins: downloadonly, fastestmirror, priorities
Loading mirror speeds from cached hostfile
 * addons: rsync.atworks.co.jp
 * base: rsync.atworks.co.jp
 * extras: rsync.atworks.co.jp
 * rpmforge: ftp-stud.fht-esslingen.de
 * updates: rsync.atworks.co.jp
rpmforge               [...]]]></description>
			<content:encoded><![CDATA[<p>Tripwireをインストールする際にエラーが、、、</p>
<pre class="code">
configure: error: C++ preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details.
</pre>
<p><span id="more-5098"></span><br />
gcc-c++をインストールする事で解決しました。</p>
<pre class="code">
[root@localhost ~]# yum -y install gcc-c++
Loaded plugins: downloadonly, fastestmirror, priorities
Loading mirror speeds from cached hostfile
 * addons: rsync.atworks.co.jp
 * base: rsync.atworks.co.jp
 * extras: rsync.atworks.co.jp
 * rpmforge: ftp-stud.fht-esslingen.de
 * updates: rsync.atworks.co.jp
rpmforge                                                           | 1.1 kB     00:00
Excluding Packages in global exclude list
Finished
402 packages excluded due to repository priority protections
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package gcc-c++.x86_64 0:4.1.2-48.el5 set to be updated
--> Processing Dependency: libstdc++-devel = 4.1.2-48.el5 for package: gcc-c++
--> Running transaction check
---> Package libstdc++-devel.x86_64 0:4.1.2-48.el5 set to be updated
rpmforge/filelists                                                 | 2.9 MB     00:04
--> Finished Dependency Resolution

Dependencies Resolved

==========================================================================================
 Package                   Arch             Version                  Repository      Size
==========================================================================================
Installing:
 gcc-c++                   x86_64           4.1.2-48.el5             base           3.8 M
Installing for dependencies:
 libstdc++-devel           x86_64           4.1.2-48.el5             base           2.8 M

Transaction Summary
==========================================================================================
Install       2 Package(s)
Upgrade       0 Package(s)

Total download size: 6.6 M
Downloading Packages:
(1/2): libstdc++-devel-4.1.2-48.el5.x86_64.rpm                     | 2.8 MB     00:00
(2/2): gcc-c++-4.1.2-48.el5.x86_64.rpm                             | 3.8 MB     00:00
------------------------------------------------------------------------------------------
Total                                                     190 kB/s | 6.6 MB     00:35
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : libstdc++-devel                                                    1/2
  Installing     : gcc-c++                                                            2/2 

Installed:
  gcc-c++.x86_64 0:4.1.2-48.el5                                                           

Dependency Installed:
  libstdc++-devel.x86_64 0:4.1.2-48.el5                                                   

Complete!
[root@localhost ~]#
</pre>
<p>こちらの記事を参考にさせて頂きました！サンクスです！<br />
<a href="http://labs.uechoco.com/blog/2008/07/linuxconfgure%E3%81%A7c-preprocessor-libcpp-fails-sanity-check.html" target="_blank">[Linux]confgureでC++ preprocessor “/lib/cpp” fails sanity check</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.verygoodtown.com/2010/08/webarena-tripwire-install/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>サーバー管理者には必要かもしれないViチートシート</title>
		<link>http://blog.verygoodtown.com/2010/05/vi-cheat-sheet-pdf/</link>
		<comments>http://blog.verygoodtown.com/2010/05/vi-cheat-sheet-pdf/#comments</comments>
		<pubDate>Wed, 05 May 2010 01:33:22 +0000</pubDate>
		<dc:creator>linja</dc:creator>
				<category><![CDATA[サーバー関連]]></category>
		<category><![CDATA[Cheat Sheet]]></category>
		<category><![CDATA[vi]]></category>

		<guid isPermaLink="false">http://blog.verygoodtown.com/?p=4335</guid>
		<description><![CDATA[viのチートシートがダウンロードできる「VI Editor / Linux Terminal Cheat Sheet (PDF)」というエントリーをご紹介。

サイトではviのコマンドが書かれたPDFファイルがダウンロー [...]]]></description>
			<content:encoded><![CDATA[<p>viのチートシートがダウンロードできる「<a href="http://www.smashingmagazine.com/2010/05/03/vi-editor-linux-terminal-cheat-sheet-pdf/" target="_blank">VI Editor / Linux Terminal Cheat Sheet (PDF)</a>」というエントリーをご紹介。</p>
<p><span id="more-4335"></span></p>
<p>サイトではviのコマンドが書かれたPDFファイルがダウンロード可能になっています。</p>
<p>かなり知らないコマンドがありました。<br />
ファイル名を指定する際に編集する行番号を指定できたりしたんですね。</p>
<p><img src="http://blog.verygoodtown.com/wordpress/wp-content/uploads/2010/05/201000504-01.jpg" alt="201000504-01" title="201000504-01" width="500" height="708" class="alignnone size-full wp-image-4336" /></p>
<p>普段操作しないサーバーで修正などする場合にvimやEmacsなど入っていない場合があります。<br />
viならば比較的デフォルトで入っている気がするのですが、どうでしょうか。</p>
<p>viしか使えない場合にそなえて覚えておいても良いかもしれませんね。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.verygoodtown.com/2010/05/vi-cheat-sheet-pdf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Open Source の今をまとめた画像</title>
		<link>http://blog.verygoodtown.com/2010/02/open-source-open-world/</link>
		<comments>http://blog.verygoodtown.com/2010/02/open-source-open-world/#comments</comments>
		<pubDate>Thu, 18 Feb 2010 10:32:07 +0000</pubDate>
		<dc:creator>linja</dc:creator>
				<category><![CDATA[サーバー関連]]></category>
		<category><![CDATA[Open Sourc]]></category>

		<guid isPermaLink="false">http://blog.verygoodtown.com/?p=2468</guid>
		<description><![CDATA[
オープンソースの現在の状況やマーケットをまとめたOpen Source Open Worldというエントリーのご紹介。
オープンソースの歴史やLinuxの世界の使用状況などをまとめたシートになっています。
英語ですが、 [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.verygoodtown.com/wordpress/wp-content/uploads/2010/02/20100219-01.jpg" alt="20100219-01" title="20100219-01" width="529" height="286" class="alignnone size-full wp-image-2469" /><br />
オープンソースの現在の状況やマーケットをまとめた<a href="http://www.focus.com/fyi/information-technology/open-source-open-world" target="_blank">Open Source Open World</a>というエントリーのご紹介。</p>
<p>オープンソースの歴史やLinuxの世界の使用状況などをまとめたシートになっています。<br />
英語ですが、興味のある方はぜひ。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.verygoodtown.com/2010/02/open-source-open-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>オープンソースのMySQL自動バックアップツール「Sypex Dumper」</title>
		<link>http://blog.verygoodtown.com/2010/02/open-source-mysql-auto-backup-tool-sypex-dumper/</link>
		<comments>http://blog.verygoodtown.com/2010/02/open-source-mysql-auto-backup-tool-sypex-dumper/#comments</comments>
		<pubDate>Mon, 15 Feb 2010 12:49:58 +0000</pubDate>
		<dc:creator>linja</dc:creator>
				<category><![CDATA[サーバー関連]]></category>
		<category><![CDATA[BSD License]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[Sypex Dumper]]></category>
		<category><![CDATA[バックアップ]]></category>

		<guid isPermaLink="false">http://blog.verygoodtown.com/?p=2334</guid>
		<description><![CDATA[
「Sypex Dumper」はMySQLデータベースを自動的にバックアップしてくれるオープンソースのウェブアプリケーションです。
PHPとAjaxで作成されており、Webインターフェースを使ってMySQLのバックアップ [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.verygoodtown.com/wordpress/wp-content/uploads/2010/02/sypexDumper1.png" alt="sypexDumper1" title="sypexDumper1" width="600" height="120" class="alignnone size-full wp-image-2371" /><br />
「<a href="http://sypex.net/en/" target="_blank">Sypex Dumper</a>」はMySQLデータベースを<strong>自動的にバックアップしてくれる</strong>オープンソースのウェブアプリケーションです。</p>
<p>PHPとAjaxで作成されており、Webインターフェースを使ってMySQLのバックアップを作成する事ができます。<br />
自動バックアップには<strong>タスク・スケジューラかcronの設定が必要</strong>ですが、それ以外はWEB上から設定可能になっています。</p>
<p>ファイル圧縮(GzipとBzip2)のサポートをしており、多言語インタフェースあり。ただし日本語はないみたいです。</p>
<h3>設置してみる</h3>
<p><a href="http://sypex.net/en/products/dumper/downloads/" target="_blank">ダウンロードページ</a>へアクセスします。</p>
<p><img src="http://blog.verygoodtown.com/wordpress/wp-content/uploads/2010/02/sypexDumper3.png" alt="sypexDumper3" title="sypexDumper3" width="359" height="97" class="alignnone size-full wp-image-2376" /></p>
<p>ポチッとダウンロードします。</p>
<p><img src="http://blog.verygoodtown.com/wordpress/wp-content/uploads/2010/02/20100215-01.png" alt="20100215-01" title="20100215-01" width="600" height="130" class="alignnone size-full wp-image-2377" /></p>
<p>設置は簡単でファイルをサーバーにアップするだけです。</p>
<h3>自動バックアップをしてみる</h3>
<p>早速自動バックアップを設定してみます。まずは設置したURLにアクセスします。</p>
<p><img src="http://blog.verygoodtown.com/wordpress/wp-content/uploads/2010/02/20100215-02.png" alt="20100215-02" title="20100215-02" width="401" height="217" class="alignnone size-full wp-image-2385" /></p>
<p>バックアップしたいユーザーでログインします。今回はローカルでのテストなのでrootユーザーでログインしました。</p>
<p><img src="http://blog.verygoodtown.com/wordpress/wp-content/uploads/2010/02/20100215-031.png" alt="20100215-03" title="20100215-03" width="600" height="473" class="alignnone size-full wp-image-2387" /></p>
<p>バックアップしたいデータベースとテーブルを指定を選択します。</p>
<p><img src="http://blog.verygoodtown.com/wordpress/wp-content/uploads/2010/02/20100215-07.png" alt="20100215-07" title="20100215-07" width="426" height="207" class="alignnone size-full wp-image-2400" /></p>
<p>自動バックアップのJobに名前をつけてあげます。ここでつけた名前を後で使うので忘れないようにしましょう。<br />
今回は「my_job」という名前にしました。</p>
<h3>コマンドラインで実行</h3>
<p>あとはconsoleやcronで指定のコマンドを実行するだけです。<br />
コマンドはこんな感じです。</p>
<pre class="code">
php <strong>Sypex Dumperへのパス</strong>/index.php -j=<strong>ジョブ名</strong>
</pre>
<p>最後のジョブ名は先ほど入力した値（ここではmy_job）を指定します。</p>
<p>実行するとこんな感じで表示されます。</p>
<pre class="code">
C:\>php c:\xampp\htdocs\SypexDumper\index.php -j=my_job

2010.02.15 21:29:12     1       Start export DB `wordpress`
2010.02.15 21:29:12     1       Export table `wp_cimy_uef_data`
2010.02.15 21:29:12     1       Export table `wp_cimy_uef_fields`
2010.02.15 21:29:12     1       Export table `wp_cimy_uef_wp_fields`
2010.02.15 21:29:12     1       Export table `wp_commentmeta`
2010.02.15 21:29:12     1       Export table `wp_comments`
2010.02.15 21:29:12     1       Export table `wp_links`
…
…
</pre>
<p>実行後にSypex Dumperの下の「backup」フォルダを見てみます。</p>
<p><img src="http://blog.verygoodtown.com/wordpress/wp-content/uploads/2010/02/20100215-06.png" alt="20100215-06" title="20100215-06" width="332" height="102" class="alignnone size-full wp-image-2395" /></p>
<p>圧縮ファイルになったデータが保存されています。これでバックアップは完了です。<br />
結構簡単にできましたね。</p>
<p><img src="http://blog.verygoodtown.com/wordpress/wp-content/uploads/2010/02/20100215-05.png" alt="20100215-05" title="20100215-05" width="581" height="406" class="alignnone size-full wp-image-2391" /></p>
<p>もちろん、ブラウザ上からバックアップする事も可能です。</p>
<p>便利ですねー。早速自分のサイトにも設定してみました！<br />
サーバーの定期バックアップをやられている方は、使ってみてもよいかもしれません。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.verygoodtown.com/2010/02/open-source-mysql-auto-backup-tool-sypex-dumper/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CentOSでyum高速化を行う「yum-fastestmirror」</title>
		<link>http://blog.verygoodtown.com/2010/02/centos-yum-speed-up-yum-fastestmirror/</link>
		<comments>http://blog.verygoodtown.com/2010/02/centos-yum-speed-up-yum-fastestmirror/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 03:37:46 +0000</pubDate>
		<dc:creator>linja</dc:creator>
				<category><![CDATA[サーバー関連]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[yum]]></category>
		<category><![CDATA[yum-fastestmirror]]></category>

		<guid isPermaLink="false">http://blog.verygoodtown.com/?p=1988</guid>
		<description><![CDATA[
yum-fastestmirrorはCentOSでyumを実行する際に接続が速いミラーサーバに接続してくれるパッケージです。
FedoraとCentOSで使用可能です。
事前準備
CentOS4の場合、プラグインを有効 [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.verygoodtown.com/wordpress/wp-content/uploads/yum-fastestmirror.png" alt="yum-fastestmirror" title="yum-fastestmirror" width="600" height="160" class="alignnone size-full wp-image-2002" /><br />
yum-fastestmirrorはCentOSでyumを実行する際に接続が速いミラーサーバに接続してくれるパッケージです。<br />
FedoraとCentOSで使用可能です。</p>
<h3>事前準備</h3>
<p>CentOS4の場合、プラグインを有効にする設定が必要になります。</p>
<pre class="code">
# vi /etc/yum.conf
</pre>
<p>プラグンを有効にする1文を追加します。</p>
<pre class="code">
plugins=1
</pre>
<h3>インストール</h3>
<p>CentOS5 の場合</p>
<pre class="code">
# yum -y install yum-fastestmirror
</pre>
<p>CentOS4 の場合</p>
<pre class="code">
yum -y install yum-plugin-fastestmirror
</pre>
<p>これだけでインストール作業は完了です。</p>
<h3>動作確認</h3>
<p>yum-fastestmirrorが実際に動作しているかどうかはcheck-updateコマンドで確認する事が可能です。</p>
<pre class="code">
# yum check-update
Loading "fastestmirror" plugin
Setting up repositories
Determining fastest mirrors
</pre>
<h3>それでもyumが遅かったら</h3>
<p>通常は上記設定だけで高速化されるはずですが、何度かyumを実行しているとキャッシュファイルがたまり、以前ははやかったけど今は遅いミラーを使用してしまう場合があります。</p>
<p>そんな時はキャッシュファイルを削除してあげましょう。まずはキャッシュファイルの場所を調べます。</p>
<pre class="code">
cat /etc/yum/pluginconf.d/fastestmirror.conf
…
hostfilepath=/var/cache/yum/timedhosts.txt
</pre>
<p>hostfilepathにキャッシュファイルが格納されています。<br />
こちらをリネームしてあげれば新しくミラーを探しにいってくれます。</p>
<pre class="code">
# mv /var/cache/yum/timedhosts.txt /var/cache/yum/timedhosts.txt.bak
</pre>
<p>以下のサイトを参考にさせていただきました。感謝！</p>
<p><a href="http://labs.uechoco.com/blog/2008/01/linux_yum_y_install_yumfastestmirroryum.html" target="_blank">[Linux]# yum -y install yum-fastestmirrorでyum高速化 : うえちょこ＠ぼろぐ</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.verygoodtown.com/2010/02/centos-yum-speed-up-yum-fastestmirror/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CentOSにAPCをインストールする方法</title>
		<link>http://blog.verygoodtown.com/2010/02/centos-apc-install-how-to/</link>
		<comments>http://blog.verygoodtown.com/2010/02/centos-apc-install-how-to/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 08:39:56 +0000</pubDate>
		<dc:creator>linja</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[サーバー関連]]></category>
		<category><![CDATA[ApacheBench]]></category>
		<category><![CDATA[APC]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[pecl]]></category>

		<guid isPermaLink="false">http://blog.verygoodtown.com/?p=1966</guid>
		<description><![CDATA[
APCはPHPの中間コードのキャッシュや最適化を行う拡張モジュールです。基本的にPHPを使うサーバーに全て入れてよいようです。
本日とあるサーバーにインストールしたのでやり方をメモ。
環境
まずは環境ですが、CentO [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.verygoodtown.com/wordpress/wp-content/uploads/apc21.png" alt="apc2" title="apc2" width="600" height="180" class="alignnone size-full wp-image-1970" /><br />
APCはPHPの中間コードのキャッシュや最適化を行う拡張モジュールです。基本的にPHPを使うサーバーに全て入れてよいようです。<br />
本日とあるサーバーにインストールしたのでやり方をメモ。</p>
<h3>環境</h3>
<p>まずは環境ですが、CentOS 4.4 + PHP 5.1.6 です。</p>
<h3>事前準備</h3>
<p>まず、peclが入っているかどうか調べます。</p>
<pre class="code">
# pecl list-all apc
All packages:
=============
Package            Latest   Local
pecl/KTaglib       0.2.0           Library to edit audio properties and tags on MPEG and OGG files
pecl/FliteTTS                      Text to speech voice synthesis for PHP
pecl/Ovrimos                       Ovrimos interface
pecl/DTrace        1.0.3           A Solaris Dtrace provider
pecl/inclued       0.1.0           Clued-in about your inclueds
pecl/zookeeper     0.1.0           PHP extension for interfacing with Apache ZooKeeper
…
…
…
…
</pre>
<p>インストールされているパッケージが表示されれば、このSTEPは読み飛ばしてOKです。<br />
なければインストールます。</p>
<pre class="code">
# yum install -y php-pear
Setting up Install Process
Setting up repositories
update                    100% |=========================|  951 B    00:00
base                      100% |=========================| 1.1 kB    00:00
…
…
…
</pre>
<p>phpizeもインストールします。</p>
<pre class="code">
# yum install -y php-devel
</pre>
<p>apxsも無ければインストール</p>
<pre class="code">
# yum install -y httpd-devel
</pre>
<p>これでやっとpeclがインストールできます。</p>
<h3>インストール</h3>
<p>peclコマンドでインストールできます。</p>
<pre class="code">
# pecl install APC
</pre>
<p>無事にインストールが完了すると以下のようなメッセージがでます。</p>
<pre class="code">
Build process completed successfully
Installing '/var/tmp/pear-build-root/install-APC-3.0.19//usr/lib/php/modules/apc.so'
install ok: channel://pecl.php.net/APC-3.0.19
You should add "extension=apc.so" to php.ini
</pre>
<p>ふむふむ。php.iniに追加しろって事ですね。<br />
って事でphp.iniに以下の行を追加。場所はどこでもかまいません。</p>
<pre class="code">
extension=apc.so
</pre>
<p>iniファイルを編集したらapacheを再起動します。</p>
<p>これでとりあえず作業は完了です。<br />
phpinfoの画面でapcの項目があるか確認します。</p>
<p><img src="http://blog.verygoodtown.com/wordpress/wp-content/uploads/apc1.png" alt="apc" title="apc" width="600" height="660" class="alignnone size-full wp-image-1972" /></p>
<h3>アップグレード</h3>
<p>apcのアップグレードは以下のコマンドで。</p>
<pre class="code">
# pecl upgrade apc
</pre>
<h3>ベンチマーク</h3>
<p>ApacheBenchでどのくらい効果が変わったか測定します。<br />
1000件のリクエストを100の同時接続で計測した結果です。</p>
<pre class="code">
# ab -n 1000 -c 100 http://127.0.0.1/*****/test.php

Benchmarking 127.0.0.1 (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Finished 1000 requests

Server Software:        Apache/2.0.63
Server Hostname:        127.0.0.1

Document Path:          /*****/test.php
Document Length:        1257 bytes

Concurrency Level:      100
Time taken for tests:   13.193656 seconds
Complete requests:      1000
Failed requests:        557
   (Connect: 0, Length: 557, Exceptions: 0)
Write errors:           0
Total transferred:      1897728 bytes
HTML transferred:       1504335 bytes
Requests per second:    75.79 [#/sec] (mean)
Time per request:       1319.366 [ms] (mean)
Time per request:       13.194 [ms] (mean, across all concurrent requests)
Transfer rate:          140.45 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    5  17.9      0      80
Processing:    74  923 879.0    498    5931
Waiting:       56  919 880.2    497    5930
Total:        102  929 877.3    502    5931

Percentage of the requests served within a certain time (ms)
  50%    502
  66%    974
  75%   1209
  80%   1371
  90%   2181
  95%   2667
  98%   3048
  99%   4531
 100%   5931 (longest request)
</pre>
<p>トータルで13秒でした。<br />
ふーむ。早くなってるんですかね。念のためapcを無効にして再度ベンチを図ってみました。</p>
<pre class="code">
# ab -n 1000 -c 100 http://127.0.0.1/*****/test.php

Benchmarking 127.0.0.1 (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Finished 1000 requests

Server Software:        Apache/2.0.63
Server Hostname:        127.0.0.1
Server Port:            80

Document Path:          /*****/test.php
Document Length:        1257 bytes

Concurrency Level:      100
Time taken for tests:   32.801446 seconds
Complete requests:      1000
Failed requests:        3
   (Connect: 0, Length: 3, Exceptions: 0)
Write errors:           0
Total transferred:      1651341 bytes
HTML transferred:       1258341 bytes
Requests per second:    30.49 [#/sec] (mean)
Time per request:       3280.145 [ms] (mean)
Time per request:       32.801 [ms] (mean, across all concurrent requests)
Transfer rate:          49.14 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0   62 171.8      0     599
Processing:   288 2895 1431.8   2741   22702
Waiting:        8 2886 1441.0   2740   22701
Total:        616 2958 1410.4   2760   23294

Percentage of the requests served within a certain time (ms)
  50%   2760
  66%   2896
  75%   2959
  80%   2987
  90%   3437
  95%   4084
  98%   6956
  99%   9495
 100%  23294 (longest request)
</pre>
<p>トータルで32秒でした。おお！19秒も違いますね。<br />
まさか、倍以上違うとは、、、</p>
<p>まだ入れてない方はぜひ。</p>
<h3>参考</h3>
<p>ちなみに高速化モジュールは他にも以下のようなものがあります。</p>
<ul>
<li>eAccelerator</li>
<li>PHPA(PHP Accelerator)</li>
<li>XCache</li>
</ul>
<p>今回はyumから入れたいという理由でAPCを採用しました。</p>
<p>導入にあたっては以下の記事を参考にさせていただきました。ありがとうございます。</p>
<p><a href="http://www.doyouphp.jp/tips/tips_apc.shtml" target="_blank">APC（Alternative PHP Cache）再び &#8211; Do You PHP?</a></p>
<p><a href="http://www.ideaxidea.com/archives/2009/01/php_apc.html" target="_blank">PHP（というかWordPress）高速化のためにAPC（Alternatice PHP Cache）入れた &#8211; IDEA*IDEA ～ 百式管理人のライフハックブログ</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.verygoodtown.com/2010/02/centos-apc-install-how-to/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CentOSのバージョンを調べる方法</title>
		<link>http://blog.verygoodtown.com/2010/02/centos-version-check/</link>
		<comments>http://blog.verygoodtown.com/2010/02/centos-version-check/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 04:09:53 +0000</pubDate>
		<dc:creator>linja</dc:creator>
				<category><![CDATA[サーバー関連]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[バージョン]]></category>

		<guid isPermaLink="false">http://blog.verygoodtown.com/?p=1962</guid>
		<description><![CDATA[以下のコマンドで調べる事が出来ました。

# cat /etc/redhat-release

CentOS release 5 (Final)とか表示されます。
いっつも忘れるのでメモメモ。
]]></description>
			<content:encoded><![CDATA[<p>以下のコマンドで調べる事が出来ました。</p>
<pre class="code">
# cat /etc/redhat-release
</pre>
<p>CentOS release 5 (Final)とか表示されます。<br />
いっつも忘れるのでメモメモ。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.verygoodtown.com/2010/02/centos-version-check/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

