LoginSignup
4
4

More than 5 years have passed since last update.

vagrantでVirtualBox4.3用のbox作ったので使い方 (CentOS6.4 LAMPP)

Last updated at Posted at 2013-10-31

boxダウンロード

はじめに

特徴

  • LAMPP環境を使う新人さん向け。
  • CentOS6.4 64bit、php5.5、mysql5.5、postfix
  • このkickstartでOSをインストールしました。
  • アカウント情報は、id:pass = vagrant:vagrant、root:vagrant
  • vagrantユーザのまま /var/log/httpd/{access_log,error_log}を読めます。
  • mysqlのクエリログが /var/log/mysql/mysql_query.logに出力されます。
  • mysqlをutf8設定済み。
  • manがカラー表示とかzsh入ってたり色々。
  • /etc/ が gitで自動バージョン管理されています。 (etckeeper)

便利URL

  • リンク集 現在、phpinfoとphpminiadmin、/vagrantへのリンク。

DB操作

  • phpminiadminを使うといいです。userをrootなり入れてください。

windows側

以下をインストールする

vagrant

コマンドプロンプトを起動。windowsキーを押しながらRを押して、cmd.exeを入力しOK押下。

コマンドプロンプトにて以下実行
vagrant box add centos64 https://www.dropbox.com/s/x66h28xf28kpxuy/CentOS6.4_x86_64_VirtualBox4.3.box
mkdir c:\vagrant\centos64
cd c:\vagrant\centos64
vagrant init centos64

Vagrantfileをエディタで編集

config.vm.network :forwarded_port, guest: 80, host: 8080 <- コメントを解除する
vagrant up

ssh接続

  • poderosaでlocalhost、ポート2222、ユーザーvagrant、パスワードvagrantにて接続

web画面確認

xdebug

sudo vim /etc/php.d/xdebug.ini
以下のように記入。
; Enable xdebug extension module
zend_extension=/usr/lib64/php/modules/xdebug.so

; see http://xdebug.org/docs/all_settings

xdebug.remote_enable= on
;xdebug.remote_enable= off
xdebug.remote_handler=dbgp
xdebug.remote_host=10.0.2.2
;xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_autostart = on
xdebug.remote_mode=req
xdebug.dump.GET = *
xdebug.dump.POST = *
設定の反映
sudo /etc/init.d/httpd restart

以下を切り替えることで、xdebug有効無効が切り替えられます。

xdebug.remote_enable= on
;xdebug.remote_enable= off
4
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4