開発環境を構築する

とある方面の開発で自由に開発できる環境が欲しくなったため、準備することにしました。今まで使っているKVM上にゲストOSとして構築しますが、今回はUbuntuではなく本番機と同じCentOSにしました。

目標

今回は次のような環境を構築します。

  • ミドルウェア(OS、Apache、PHPなどアプリケーションの動作に必要な環境)は本番環境に一致させる
  • データベースはスキーマのみを本番環境から引き抜き、本番環境のデータを用いた開発は行わない(当然ながら本番環境から抜いてくることも手順上可能)
  • 外部へ送信するメールはすべてローカルの1ヵ所に集約し、外部へメールを送信しない

構築した環境の情報です。

CentOSやApacheなど

インストール

てきとうに書く

Apache

MySQL

PHP

Postfix

メールは外部へ飛ばないように設定をします。後半の差分が、その設定になります。

% diff -u main.cf.orig main.cf
--- main.cf.orig        2008-08-15 06:07:43.000000000 +0900
+++ main.cf     2011-09-04 22:20:29.000000000 +0900
@@ -407,7 +407,7 @@
 # "Maildir/" for qmail-style delivery (the / is required).
 #
 #home_mailbox = Mailbox
-#home_mailbox = Maildir/
+home_mailbox = Maildir/

 # The mail_spool_directory parameter specifies the directory where
 # UNIX-style mailboxes are kept. The default setting depends on the
@@ -665,3 +665,9 @@
 # readme_directory: The location of the Postfix README files.
 #
 readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES
+
+# development environment settings
+# http://wp.xn--ockc3f5a.com/2011/06/27/postfix%E3%82%92%E5%88%A9%E7%94%A8%E3%81%99%E3%82%8B/
+default_transport = local
+luser_relay = archive
+local_recipient_maps =

 

メールのアーカイブ

MHonArc

postconf | fgrep commands –> forward

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *