<?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>heureux heure*</title>
	<atom:link href="http://heureux.jp/blog/feed" rel="self" type="application/rss+xml" />
	<link>http://heureux.jp/blog</link>
	<description>思いついたことを 思いついたときに 思いついたように</description>
	<lastBuildDate>Fri, 03 Sep 2010 23:10:20 +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://heureux.jp/blog/feed" />
		<item>
		<title>ブログを移転というか、ドメインの変更</title>
		<link>http://heureux.jp/blog/2010/09/04/89.html</link>
		<comments>http://heureux.jp/blog/2010/09/04/89.html#comments</comments>
		<pubDate>Fri, 03 Sep 2010 23:10:20 +0000</pubDate>
		<dc:creator>Heureux</dc:creator>
				<category><![CDATA[記事]]></category>

		<guid isPermaLink="false">http://heureux.jp/blog/?p=89</guid>
		<description><![CDATA[うまくいってればいいけど、これで色々問題が発生したら修正するのが面倒くさそう。
]]></description>
			<content:encoded><![CDATA[<p>うまくいってればいいけど、これで色々問題が発生したら修正するのが面倒くさそう。</p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://heureux.jp/blog/2010/09/04/89.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://heureux.jp/blog/2010/09/04/89.html" />
	</item>
		<item>
		<title>MacPorts で PHP5 をインストール</title>
		<link>http://heureux.jp/blog/2010/08/27/86.html</link>
		<comments>http://heureux.jp/blog/2010/08/27/86.html#comments</comments>
		<pubDate>Thu, 26 Aug 2010 15:19:38 +0000</pubDate>
		<dc:creator>Heureux</dc:creator>
				<category><![CDATA[記事]]></category>
		<category><![CDATA[MacPorts]]></category>

		<guid isPermaLink="false">http://heureux.jp/blog/?p=86</guid>
		<description><![CDATA[今までは
sudo port install php5 +apache2 +imap +mysql5 +pear +sqlite +curl +gd +readline +tidy
でインストールしてたんだけど、気づいた [...]]]></description>
			<content:encoded><![CDATA[<p>今までは</p>
<pre><code>sudo port install php5 +apache2 +imap +mysql5 +pear +sqlite +curl +gd +readline +tidy</code></pre>
<p>でインストールしてたんだけど、気づいたら</p>
<pre><code>The +imap variant is obsolete. Please install the php5-imap port instead.
The +mysql5 variant is obsolete. Please install the php5-mysql port instead.
The +sqlite variant is obsolete. Please install the php5-sqlite port instead.
The +tidy variant is obsolete. Please install the php5-tidy port instead.</code></pre>
<p>と、古いから別個にインストールしろという指示が。<br />
こまめに見てないとダメだねぇ…。</p>
<p>ということで、別個にインストール。</p>
<pre><code>sudo port install php5 +apache2 +pear +curl +gd +readline php5-imap php5-mysql php5-sqlite php5-tidy</code></pre>
<!-- PHP 5.x -->
	Tags: <a href="http://heureux.jp/blog/tag/macports" title="MacPorts" rel="tag">MacPorts</a><br />
]]></content:encoded>
			<wfw:commentRss>http://heureux.jp/blog/2010/08/27/86.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://heureux.jp/blog/2010/08/27/86.html" />
	</item>
		<item>
		<title>WordPress の自動更新をするのに手こずった</title>
		<link>http://heureux.jp/blog/2010/08/02/84.html</link>
		<comments>http://heureux.jp/blog/2010/08/02/84.html#comments</comments>
		<pubDate>Sun, 01 Aug 2010 18:42:16 +0000</pubDate>
		<dc:creator>Heureux</dc:creator>
				<category><![CDATA[日記]]></category>

		<guid isPermaLink="false">http://heureux.jp/blog/?p=84</guid>
		<description><![CDATA[FTP の情報を入力しろみたいな画面が出てきて、FTP なんて入れてないしどうしようと悩んだ。結局 WordPress ディレクトリ全部を apache:apache にして解決したけど、これはなかなか悩んだ。さっさと検 [...]]]></description>
			<content:encoded><![CDATA[<p>FTP の情報を入力しろみたいな画面が出てきて、FTP なんて入れてないしどうしようと悩んだ。結局 WordPress ディレクトリ全部を apache:apache にして解決したけど、これはなかなか悩んだ。さっさと検索かければよかったんだけど、ついつい解決策が目の前に提示されるとそっちに集中しちゃうもんだ。</p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://heureux.jp/blog/2010/08/02/84.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://heureux.jp/blog/2010/08/02/84.html" />
	</item>
		<item>
		<title>パッケージの追加 – Linode 初期設定 CentOS 5.5(64bit版)</title>
		<link>http://heureux.jp/blog/2010/07/19/83.html</link>
		<comments>http://heureux.jp/blog/2010/07/19/83.html#comments</comments>
		<pubDate>Mon, 19 Jul 2010 02:48:26 +0000</pubDate>
		<dc:creator>Heureux</dc:creator>
				<category><![CDATA[Server]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[VPS]]></category>
		<category><![CDATA[yum]]></category>

		<guid isPermaLink="false">http://heureux.jp/blog/?p=83</guid>
		<description><![CDATA[パッケージのインストール
Apache やら zsh やら MySQL やらを追加していきます。ただ zsh は探しても yum のは古い ver. しかないようなので、これは手動で追加します。
sudo yum ins [...]]]></description>
			<content:encoded><![CDATA[<h4>パッケージのインストール</h4>
<p>Apache やら zsh やら MySQL やらを追加していきます。ただ zsh は探しても yum のは古い ver. しかないようなので、これは手動で追加します。</p>
<pre><code>sudo yum install httpd.x86_64 httpd-devel.x86_64 httpd-manual.x86_64</code>
<code>sudo yum --enablerepo=remi install php.x86_64 php-devel.x86_64 php-mbstring.x86_64  php-mysql.x86_64 php-mcrypt.x86_64</code>
<code>sudo yum --enablerepo=remi install mysql.x86_64 mysql-devel.x86_64 mysql-server.x86_64</code>
<code>sudo yum install gcc.x86_64 make.x86_64</code>
<code>sudo yum install ncurses-devel.x86_64</code>
<code>sudo yum install expat-devel.x86_64</code>
<code>sudo yum install curl-devel.x86_64</code>
<code>sudo yum install git.x86_64</code></pre>
<p>gcc, ncurses-devel は zsh をインストールするのに必要なようです。curl-devel, expat-devel は git に必要なようです。</p>
<h4>zsh のインストール</h4>
<p>ソースからさくっと入れます。</p>
<pre><code>cd ~/src</code>
<code>wget http://sourceforge.net/projects/zsh/files/zsh-doc-dev/4.3.10/zsh-4.3.10-doc.tar.gz/download</code>
<code>wget http://sourceforge.net/projects/zsh/files/zsh-dev/4.3.10/zsh-4.3.10.tar.gz/download</code>
<code>tar xzfv zsh-4.3.10.tar.gz</code>
<code>tar xzfv zsh-4.3.10-doc.tar.gz</code>
<code>cd zsh-4.3.10</code>
<code>./configure --prefix=/usr/local</code>
<code>make</code>
<code>sudo make install</code></pre>
<p>zsh を使えるようにします。</p>
<pre><del datetime="2010-07-19T02:49:03+00:00"><code>vim ~/.bashrc</code>
<code>if [ -x /usr/local/bin/zsh ]; then
    exec /usr/loca/bin/zsh
fi</code></del></pre>
<p><del datetime="2010-07-19T03:25:12+00:00">以上です。</del><br />
上記のやり方だと scp ができなくなりました。これじゃマズいと言う事で</p>
<pre><code>if [ ""$PS1 = "" ]; then return ; fi</code>
<code>if [ -x /usr/local/bin/zsh ]; then</code>
<code>    exec /usr/local/bin/zsh</code>
<code>fi</code></pre>
<p>これで今のところうまくいってます。ちょっと様子見。<br />
って全然うまくいってなかった。</p>
<pre><code>-bash: [: too many arguments</code></pre>
<p>こんなの出てきます。なので</p>
<pre><code>if [ "$PS1" ]; then
if [ -x /usr/local/bin/zsh ]; then
        exec /usr/local/bin/zsh
fi
fi</code></pre>
<p>に修正。非対話シェルならその場で読み込みを終えて、対話シェルなら続けるの処理の方がいい気がしたんだけどなぁ。とりあえずこれで様子見。</p>
<pre><code>if [ -z "$PS1" ]; then return ; fi
if [ -x /usr/local/bin/zsh ]; then
        exec /usr/local/bin/zsh
fi</code></pre>
<p>これでいけたー！</p>
<!-- PHP 5.x -->
	Tags: <a href="http://heureux.jp/blog/tag/centos" title="CentOS" rel="tag">CentOS</a>, <a href="http://heureux.jp/blog/tag/vps" title="VPS" rel="tag">VPS</a>, <a href="http://heureux.jp/blog/tag/yum" title="yum" rel="tag">yum</a><br />
]]></content:encoded>
			<wfw:commentRss>http://heureux.jp/blog/2010/07/19/83.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://heureux.jp/blog/2010/07/19/83.html" />
	</item>
		<item>
		<title>yum リポジトリの設定 – Linode 初期設定 CentOS 5.5(64bit版)</title>
		<link>http://heureux.jp/blog/2010/07/19/81.html</link>
		<comments>http://heureux.jp/blog/2010/07/19/81.html#comments</comments>
		<pubDate>Mon, 19 Jul 2010 01:23:13 +0000</pubDate>
		<dc:creator>Heureux</dc:creator>
				<category><![CDATA[Server]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[VPS]]></category>
		<category><![CDATA[yum]]></category>

		<guid isPermaLink="false">http://heureux.jp/blog/?p=81</guid>
		<description><![CDATA[この辺はよく分からなかったので

Linode申込後の初期設定のメモ(環境設定) &#8211; 積み重ねた日々

を参考にさせて頂きました。ありがとうございました。
yum リポジトリに優先度を
yum リポジトリに優 [...]]]></description>
			<content:encoded><![CDATA[<p>この辺はよく分からなかったので</p>
<ul>
<li><a href='http://d.hatena.ne.jp/solitary_shell/20100324/1269448947' title='Linode申込後の初期設定のメモ(環境設定) - 積み重ねた日々'>Linode申込後の初期設定のメモ(環境設定) &#8211; 積み重ねた日々</a></li>
</ul>
<p>を参考にさせて頂きました。ありがとうございました。</p>
<h4>yum リポジトリに優先度を</h4>
<p>yum リポジトリに優先度をつけて、基本パッケージを最優先にする。</p>
<pre><code>sudo yum install yum-priorities</code></pre>
<p>これをインストールしたら /etc/yum.repos.d/CentOS-Base.repo を開き、優先度をつけていきます。base, updates, addons, extras, centosplus, contrib の項目の下に「priority=1」をそれぞれ追加。あと [centosplus] の enabled=0 というのを enabled=1 にしておきます。</p>
<h4>rpmforge リポジトリの追加</h4>
<p>rpm を</p>
<ul>
<li><a href="http://dag.wieers.com/rpm/packages/rpmforge-release/">http://dag.wieers.com/rpm/packages/rpmforge-release/</a></li>
</ul>
<p>からインストールします。</p>
<pre><code>http://dag.wieers.com/rpm/packages/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm</code></pre>
<p>64bit なのでこっちです。このインストールが終わればまた、優先度をつけます。今度の優先度は <strong>10</strong> です。「priority=10」。</p>
<h4>DAG リポジトリの追加</h4>
<p>DAG リポジトリも作っておくといいようです。これはダウンロードしてではなくて、自分でせっせと書くようです。</p>
<pre><code>cat /etc/yum.repos.d/dag.repo</code>
<code>[dag]
name=Dag RPM Repository for Fedora Core
baseurl=http://ftp.riken.jp/Linux/dag/redhat/el$releasever/en/$basearch/dag
enabled=0
gpgcheck=1
gpgkey=http://ftp.riken.jp/Linux/dag/packages/RPM-GPG-KEY.dag.txt
priority=10</code></pre>
<h4>EPEL リポジトリの追加</h4>
<p>rpm は</p>
<ul>
<li>http://download.fedora.redhat.com/pub/epel/5/x86_64/</li>
</ul>
<p>です。</p>
<pre><code>sudo rpm -ivh http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-3.noarch.rpm</code></pre>
<p>これもまた優先度をつけていきます。優先度は <strong>10</strong> です。</p>
<h4>Remi リポジトリの追加</h4>
<p>PHP や MySQL の最新パッケージ？ を手に入れるにはこの Remi リポジトリが必要なようです。インストール時に「yum install &#8211;enablerepo=remi」と指定するようになります。</p>
<pre><code>rpm --import http://rpms.famillecollet.com/RPM-GPG-KEY-remi</code>
<code>rpm -ivh rpm http://rpms.famillecollet.com/enterprise/remi-release-5.rpm</code></pre>
<p>あとは「priority=1」と「enabled=1」を設定して終了です。</p>
<p>実際もう少しだけ repo の中身を触った記憶があるんですが、何をどう触ったかあんまり覚えてないという…。眠いときにやるんじゃなかった。もっと調べておかしいところがあれば臨機応変に設定変更！</p>
<!-- PHP 5.x -->
	Tags: <a href="http://heureux.jp/blog/tag/centos" title="CentOS" rel="tag">CentOS</a>, <a href="http://heureux.jp/blog/tag/vps" title="VPS" rel="tag">VPS</a>, <a href="http://heureux.jp/blog/tag/yum" title="yum" rel="tag">yum</a><br />
]]></content:encoded>
			<wfw:commentRss>http://heureux.jp/blog/2010/07/19/81.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://heureux.jp/blog/2010/07/19/81.html" />
	</item>
		<item>
		<title>yum-cron と yum-updatesd &#8211; Linode 初期設定 CentOS 5.5(64bit版)</title>
		<link>http://heureux.jp/blog/2010/07/17/79.html</link>
		<comments>http://heureux.jp/blog/2010/07/17/79.html#comments</comments>
		<pubDate>Sat, 17 Jul 2010 13:57:46 +0000</pubDate>
		<dc:creator>Heureux</dc:creator>
				<category><![CDATA[Server]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Linode]]></category>
		<category><![CDATA[VPS]]></category>
		<category><![CDATA[yum]]></category>

		<guid isPermaLink="false">http://heureux.jp/blog/?p=79</guid>
		<description><![CDATA[yum の自動更新にはタイトルの二つがあるみたいで、 yum-updatesd は常駐型。なんかメモリ食って手動で追加した物がおかしくなることがある「らしい」。らしいだからよく知らないけど yum-cron はメモリを食 [...]]]></description>
			<content:encoded><![CDATA[<p>yum の自動更新にはタイトルの二つがあるみたいで、 yum-updatesd は常駐型。なんかメモリ食って手動で追加した物がおかしくなることがある「らしい」。らしいだからよく知らないけど yum-cron はメモリを食わないらしい。詳しい人の言うことにとりあえず従ってみます。yum-cron じゃダメって話を聞いたこともないしね。現状どちらもインストールされていないので</p>
<pre><code>yum install yum-cron</code></pre>
<p>次に簡単に設定します。</p>
<pre><code>vim /etc/sysconfig/yum-cron</code>
<code>CHECK_ONLY=yes</code>
<code>DOWNLOAD_ONLY=yes</code></pre>
<p>これでチェックしたあとにダウンロードするって設定になります。</p>
<pre><code>service yum-cron restart</code>
<code>chkconfig yum-cron on</code></pre>
<p>これで OK.</p>
<!-- PHP 5.x -->
	Tags: <a href="http://heureux.jp/blog/tag/centos" title="CentOS" rel="tag">CentOS</a>, <a href="http://heureux.jp/blog/tag/linode" title="Linode" rel="tag">Linode</a>, <a href="http://heureux.jp/blog/tag/vps" title="VPS" rel="tag">VPS</a>, <a href="http://heureux.jp/blog/tag/yum" title="yum" rel="tag">yum</a><br />
]]></content:encoded>
			<wfw:commentRss>http://heureux.jp/blog/2010/07/17/79.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://heureux.jp/blog/2010/07/17/79.html" />
	</item>
		<item>
		<title>Google Apps を併用している時の Postfix. &#8211; Linode 初期設定 CentOS 5.5(64bit版)</title>
		<link>http://heureux.jp/blog/2010/07/17/78.html</link>
		<comments>http://heureux.jp/blog/2010/07/17/78.html#comments</comments>
		<pubDate>Sat, 17 Jul 2010 13:18:08 +0000</pubDate>
		<dc:creator>Heureux</dc:creator>
				<category><![CDATA[Server]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Linode]]></category>
		<category><![CDATA[Postfix]]></category>
		<category><![CDATA[VPS]]></category>

		<guid isPermaLink="false">http://heureux.jp/blog/?p=78</guid>
		<description><![CDATA[Google Apps を併用しているので、面倒くさくない Postfix の設定を行った。ログの送信なんかもしたかったので、まずは Postfix をインストール。
yum -y install postfix
それか [...]]]></description>
			<content:encoded><![CDATA[<p>Google Apps を併用しているので、面倒くさくない Postfix の設定を行った。ログの送信なんかもしたかったので、まずは Postfix をインストール。</p>
<pre><code>yum -y install postfix</code></pre>
<p>それからまずは main.cf の設定を行います。</p>
<pre><code>vim /etc/postfix/main.cf</code></pre>
<p>送信専用だし、いろいろやるのは面倒だったので</p>
<pre><code>mydomain = hogehoge</code>
<code>myorigin = $mydomain</code>
<code>mydestination =</code></pre>
<p>の3箇所だけ変更しました。<br />
これでローカル配信は全部そのまま飛ばして Google Apps にいきます。ただここからもメールを直接送信することもあるので、<br />
<a href='http://www.microsoft.com/mscorp/safety/content/technologies/senderid/wizard/default.aspx' title='Sender ID Framework SPF Record Wizard'>Sender ID Framework SPF Record Wizard</a><br />
から SPF record を作成してこれを設定します。</p>
<pre><code>v=spf1 ip4:xxx.xxx.xxx.xxx include:aspmx.googlemail.com ~all</code></pre>
<p>こんなの…。<br />
とりあえずこれで Postfix はオッケーと言う事で。</p>
<p>追記</p>
<pre><code>myhostname = mail.hogehoge </code>
<code>mydestination = $myhostname</code></pre>
<p>に修正。</p>
<!-- PHP 5.x -->
	Tags: <a href="http://heureux.jp/blog/tag/centos" title="CentOS" rel="tag">CentOS</a>, <a href="http://heureux.jp/blog/tag/linode" title="Linode" rel="tag">Linode</a>, <a href="http://heureux.jp/blog/tag/postfix" title="Postfix" rel="tag">Postfix</a>, <a href="http://heureux.jp/blog/tag/vps" title="VPS" rel="tag">VPS</a><br />
]]></content:encoded>
			<wfw:commentRss>http://heureux.jp/blog/2010/07/17/78.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://heureux.jp/blog/2010/07/17/78.html" />
	</item>
		<item>
		<title>iptables &#8211; Linode 初期設定 CentOS 5.5(64bit版)</title>
		<link>http://heureux.jp/blog/2010/07/17/76.html</link>
		<comments>http://heureux.jp/blog/2010/07/17/76.html#comments</comments>
		<pubDate>Sat, 17 Jul 2010 13:04:19 +0000</pubDate>
		<dc:creator>Heureux</dc:creator>
				<category><![CDATA[Server]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Linode]]></category>
		<category><![CDATA[VPS]]></category>

		<guid isPermaLink="false">http://heureux.jp/blog/?p=76</guid>
		<description><![CDATA[とっても大事なので即やりました。でも、なかなかうまくいかない。何をやっても「Setting chains to policy ACCEPT: raw nat mangle fi[FAILED]」のエラー。調べた結果 Co [...]]]></description>
			<content:encoded><![CDATA[<p>とっても大事なので即やりました。でも、なかなかうまくいかない。何をやっても「Setting chains to policy ACCEPT: raw nat mangle fi[FAILED]」のエラー。調べた結果 Configuration Profiles -> Kernel -> paravirt となっているのを stable に変更。あとは</p>
<ul>
<li><a href='http://daretoku-unix.blogspot.com/2010/05/serversmanvpsiptablesstate.html' title='誰得UNIX-Blog: ServersMan@VPSでのiptables設定(state版)'>誰得UNIX-Blog: ServersMan@VPSでのiptables設定(state版)</a></li>
<li><a href='http://fedorasrv.com/iptables.shtml' title='ファイアウォール構築(iptables) - Fedoraで自宅サーバー構築'>ファイアウォール構築(iptables) &#8211; Fedoraで自宅サーバー構築</a></li>
</ul>
<p>を参考にさせて頂きました。<br />
やってることは同じなので調整したものをちょっとずつ書き足そうと思います。</p>
<!-- PHP 5.x -->
	Tags: <a href="http://heureux.jp/blog/tag/centos" title="CentOS" rel="tag">CentOS</a>, <a href="http://heureux.jp/blog/tag/linode" title="Linode" rel="tag">Linode</a>, <a href="http://heureux.jp/blog/tag/vps" title="VPS" rel="tag">VPS</a><br />
]]></content:encoded>
			<wfw:commentRss>http://heureux.jp/blog/2010/07/17/76.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://heureux.jp/blog/2010/07/17/76.html" />
	</item>
		<item>
		<title>いろいろ &#8211; Linode 初期設定 CentOS 5.5(64bit版)</title>
		<link>http://heureux.jp/blog/2010/07/17/75.html</link>
		<comments>http://heureux.jp/blog/2010/07/17/75.html#comments</comments>
		<pubDate>Sat, 17 Jul 2010 07:50:03 +0000</pubDate>
		<dc:creator>Heureux</dc:creator>
				<category><![CDATA[Server]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Linode]]></category>
		<category><![CDATA[VPS]]></category>

		<guid isPermaLink="false">http://heureux.jp/blog/?p=75</guid>
		<description><![CDATA[準備
いくらぼんくらでも起動してそのまま放置しておけば危険なことは分かってる。そこで起動の前に色々確認しておかないと。

VPS の IP アドレス。
コンソールなんかで秘密鍵と公開鍵を作成しておく。
ユーザ名とパスワー [...]]]></description>
			<content:encoded><![CDATA[<h4>準備</h4>
<p>いくらぼんくらでも起動してそのまま放置しておけば危険なことは分かってる。そこで起動の前に色々確認しておかないと。</p>
<ul>
<li>VPS の IP アドレス。</li>
<li>コンソールなんかで秘密鍵と公開鍵を作成しておく。</li>
<li>ユーザ名とパスワードを考えて紙に書いておく（特に I と l は間違えやすいので）。</li>
</ul>
<p>ちなみに絶対やることと言えば</p>
<ol>
<li>作業ユーザを作成する。</li>
<li>SSHログインを鍵認証にして、root ログイン・パスワードログインをできなくする。</li>
<li>iptables なんかでファイアーウォールの構築。</li>
<li>yum リポジトリの追加。</li>
</ol>
<h5>公開鍵の作成</h5>
<p>公開鍵を作成しておきます（パスフレーズなし）。</p>
<pre><code>ssh-keygen -f ~/.ssh/id_rsa_linode -N '' -C 'xxx.xxx.xxx.xxx' -t rsa </code></pre>
<p>準備としてはこんなもの？？とにかく OS を起動します。</p>
<h4>ユーザ作成</h4>
<p>まずは root しかないのでこいつでログインします。</p>
<pre><code>ssh root@xxx.xxx.xxx.xxx</code></pre>
<p>で、ユーザ作成を行って、wheel グループにして、パスワードも設定します。</p>
<pre><code>useradd -G wheel hogehoge</code>
<code>passwd hogehoeg</code></pre>
<h4>root, sudo 関連</h4>
<p>wheelグループだけ root になれるよう。</p>
<pre><code>vi /etc/pam.d/su</code>

<code>-    #auth            required        pam_wheel.so use_uid</code>
<code>+    auth            required        pam_wheel.so use_uid</code></pre>
<p>wheelグループだけ sudo を実行できるよう。</p>
<pre><code>visudo</code>

<code>-    #%wheel  ALL=(ALL)       NOPASSWD: ALL</code>
<code>+    %wheel  ALL=(ALL)       NOPASSWD: ALL</code></pre>
<p>sudo の時にパスワードがいらないようにもした。パスワード入力する方がいいんだろうけど、とりあえずこれで。</p>
<h4>公開鍵でのログイン設定</h4>
<pre><code>scp ~/.ssh/id_rsa_linode.pub hogehoge@xxx.xxx.xxx.xxx:~</code></pre>
<p>今度は作成したユーザで linode へログインして</p>
<pre><code>mkdir ~/.ssh</code>
<code>chmod 700 ~/.ssh</code>
<code>cat id_rsa_linode.pub >> ~/.ssh/authorized_keys</code>
<code>chmod 600 ~/.ssh/authorized_keys</code>
<code>rm id_rsa_linode.pub</code></pre>
<h4>sshd の設定変更</h4>
<p>あとは sshd で鍵認証だけの設定にしちゃえばオッケーだと思います。</p>
<pre><code>sudo vi /etc/ssh/sshd_config</code>

<code>PermitRootLogin no</code>
<code>PubkeyAuthentication yes</code>
<code>AuthorizedKeysFile      .ssh/authorized_keys</code>
<code>PermitEmptyPasswords no</code>
<code>PasswordAuthentication no</code>
<code>ChallengeResponseAuthentication no</code>
<code>UsePAM no</code>
<code>X11Forwarding no</code>
<code>UseDNS no</code>
<code>AllowUsers hogehoge</code></pre>
<p>あとは sshd を再起動させて</p>
<pre><code>sudo service sshd restart</code></pre>
<p>でオッケー。こんなものかな。あ、あとタイムゾーンを変更して、環境変数と LANG の設定も。</p>
<pre><code>mv /etc/localtime /etc/localtime.org</code>
<code>cp /usr/share/zoneinfo/Asia/Tokyo /etc/localtime</code></pre>
<pre><code>vi ~/.bash_profile</code>
<code>PATH=$PATH:$HOME/bin:/sbin:/usr/sbin</code>
<code>source ~/.bash_profile</code></pre>
<pre><code>vim /etc/sysconfig/i18n</code>
<code>LANG="ja_JP"</code></pre>
<p>こんな感じ。</p>
<!-- PHP 5.x -->
	Tags: <a href="http://heureux.jp/blog/tag/centos" title="CentOS" rel="tag">CentOS</a>, <a href="http://heureux.jp/blog/tag/linode" title="Linode" rel="tag">Linode</a>, <a href="http://heureux.jp/blog/tag/vps" title="VPS" rel="tag">VPS</a><br />
]]></content:encoded>
			<wfw:commentRss>http://heureux.jp/blog/2010/07/17/75.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://heureux.jp/blog/2010/07/17/75.html" />
	</item>
		<item>
		<title>Linode 借りてみた</title>
		<link>http://heureux.jp/blog/2010/07/17/74.html</link>
		<comments>http://heureux.jp/blog/2010/07/17/74.html#comments</comments>
		<pubDate>Sat, 17 Jul 2010 06:27:59 +0000</pubDate>
		<dc:creator>Heureux</dc:creator>
				<category><![CDATA[Server]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[VPS]]></category>

		<guid isPermaLink="false">http://heureux.jp/blog/?p=74</guid>
		<description><![CDATA[ちょっと色々試したいことがあったのと、ドメインが余ってた（余ってたと言うよりなんとかしたかった）ので、ちまたで大人気？ の Linode を借りてみた。
フレモント（西海岸）があいていれば絶対オススメということだったので [...]]]></description>
			<content:encoded><![CDATA[<p>ちょっと色々試したいことがあったのと、ドメインが余ってた（余ってたと言うよりなんとかしたかった）ので、ちまたで大人気？ の Linode を借りてみた。</p>
<p>フレモント（西海岸）があいていれば絶対オススメということだったので、さっくり申し込み。申し込んだ日からの日割りになるのと、ちょうど先日メモリから増量されてたようでかなりいい感じの環境だと思った（無料の DNS があるし）。<br />
申し込んだら即使えるようで、確か OS を選んで5分もしないうちに触れた。</p>
<p>できるならさくらインターネットから移転できるように、Apach から色々入れていこうと思う。VPS 借りるのは初めてなので、これもまた勉強なり。</p>
<!-- PHP 5.x -->
	Tags: <a href="http://heureux.jp/blog/tag/centos" title="CentOS" rel="tag">CentOS</a>, <a href="http://heureux.jp/blog/tag/vps" title="VPS" rel="tag">VPS</a><br />
]]></content:encoded>
			<wfw:commentRss>http://heureux.jp/blog/2010/07/17/74.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://heureux.jp/blog/2010/07/17/74.html" />
	</item>
	</channel>
</rss>
