Download free for 30 days
Sign in
Upload
Language (EN)
Support
Business
Mobile
Social Media
Marketing
Technology
Art & Photos
Career
Design
Education
Presentations & Public Speaking
Government & Nonprofit
Healthcare
Internet
Law
Leadership & Management
Automotive
Engineering
Software
Recruiting & HR
Retail
Sales
Services
Science
Small Business & Entrepreneurship
Food
Environment
Economy & Finance
Data & Analytics
Investor Relations
Sports
Spiritual
News & Politics
Travel
Self Improvement
Real Estate
Entertainment & Humor
Health & Medicine
Devices & Hardware
Lifestyle
Change Language
Language
English
Español
Português
Français
Deutsche
Cancel
Save
Submit search
EN
Uploaded by
Masashi Shinbara
81,817 views
もう XAMPP / MAMP はいらない! Vagrant で作る PHP 開発環境
http://www.1x1.jp/blog/2013/09/php-enviroment-with-vagrant.html
Technology
◦
Read more
265
Save
Share
Embed
Embed presentation
1
/ 47
2
/ 47
3
/ 47
4
/ 47
5
/ 47
6
/ 47
7
/ 47
8
/ 47
9
/ 47
10
/ 47
11
/ 47
12
/ 47
13
/ 47
14
/ 47
15
/ 47
16
/ 47
17
/ 47
18
/ 47
19
/ 47
20
/ 47
21
/ 47
22
/ 47
23
/ 47
24
/ 47
25
/ 47
26
/ 47
27
/ 47
28
/ 47
29
/ 47
30
/ 47
31
/ 47
32
/ 47
33
/ 47
34
/ 47
35
/ 47
36
/ 47
37
/ 47
38
/ 47
39
/ 47
40
/ 47
41
/ 47
42
/ 47
43
/ 47
44
/ 47
45
/ 47
46
/ 47
47
/ 47
More Related Content
PDF
Vagrant で作る PHP 開発環境 [実践編]
by
Masashi Shinbara
PDF
ビルドサーバで使うDocker
by
Masashi Shinbara
PDF
Vagrant を Web開発環境に使う
by
Masashi Shinbara
PDF
Vagrant体験入門
by
Masashi Shinbara
PDF
Vagrant で PHP 開発環境を作る ハンズオン
by
Masashi Shinbara
PDF
Ansible ではじめるサーバ作業の自動化
by
Masashi Shinbara
PDF
Heroku で作る スケーラブルな PHP アプリケーション
by
Masashi Shinbara
PDF
認証機能で学ぶ Laravel 5 アプリケーション
by
Masashi Shinbara
Vagrant で作る PHP 開発環境 [実践編]
by
Masashi Shinbara
ビルドサーバで使うDocker
by
Masashi Shinbara
Vagrant を Web開発環境に使う
by
Masashi Shinbara
Vagrant体験入門
by
Masashi Shinbara
Vagrant で PHP 開発環境を作る ハンズオン
by
Masashi Shinbara
Ansible ではじめるサーバ作業の自動化
by
Masashi Shinbara
Heroku で作る スケーラブルな PHP アプリケーション
by
Masashi Shinbara
認証機能で学ぶ Laravel 5 アプリケーション
by
Masashi Shinbara
What's hot
PDF
開発現場で活用するVagrant
by
Masashi Shinbara
PPTX
イベント駆動プログラミングとI/O多重化
by
Gosuke Miyashita
PPTX
OpenShift from Easy way to Hard ? Way
by
ロフト くん
PPTX
Ansibleを使ってdockerコンテナをプロビジョニングする
by
Ryo Adachi
PPTX
Pythonユーザのための構成管理入門 #pyconapac
by
Takeshi Komiya
PDF
Vagrant & Dockerによるイマドキの開発環境構築
by
Nakazawa Yuichi
PDF
仮想マシンを使った開発環境の簡単共有方法
by
Hideo Takahashi
PPTX
Alpine linuxを触ってみよう
by
Ryo Adachi
PDF
Twilio API を PHP で触ってみよう
by
Masashi Shinbara
PDF
VagrantからDockerに開発環境を移行した時の話
by
Daijiro Abe
PDF
130412 kayac-cinnamon
by
Yuki Shibazaki
PDF
いまどきのPHP開発現場 -2015年秋-
by
Masashi Shinbara
PDF
Azure Websites で作るスケーラブルな PHP アプリケーション
by
Masashi Shinbara
PDF
Vagrant環境のAnsibleを速くしたい
by
Kazuhiro Oinuma
PPTX
Dockerを使ってみよう
by
Ryo Adachi
PDF
Elixir Meetup #1 Loggerの構造と拡張
by
Sugawara Genki
PDF
さくらのインフラコード
by
Yukihiko SAWANOBORI
PDF
わかってるフレームワーク Laravel
by
Masashi Shinbara
PDF
Ansible 2.0 のサマライズとこれから
by
Takeshi Kuramochi
PDF
Ansible 2.0を使って組む kubernetesクラスタ vol.1
by
Hidetoshi Hirokawa
開発現場で活用するVagrant
by
Masashi Shinbara
イベント駆動プログラミングとI/O多重化
by
Gosuke Miyashita
OpenShift from Easy way to Hard ? Way
by
ロフト くん
Ansibleを使ってdockerコンテナをプロビジョニングする
by
Ryo Adachi
Pythonユーザのための構成管理入門 #pyconapac
by
Takeshi Komiya
Vagrant & Dockerによるイマドキの開発環境構築
by
Nakazawa Yuichi
仮想マシンを使った開発環境の簡単共有方法
by
Hideo Takahashi
Alpine linuxを触ってみよう
by
Ryo Adachi
Twilio API を PHP で触ってみよう
by
Masashi Shinbara
VagrantからDockerに開発環境を移行した時の話
by
Daijiro Abe
130412 kayac-cinnamon
by
Yuki Shibazaki
いまどきのPHP開発現場 -2015年秋-
by
Masashi Shinbara
Azure Websites で作るスケーラブルな PHP アプリケーション
by
Masashi Shinbara
Vagrant環境のAnsibleを速くしたい
by
Kazuhiro Oinuma
Dockerを使ってみよう
by
Ryo Adachi
Elixir Meetup #1 Loggerの構造と拡張
by
Sugawara Genki
さくらのインフラコード
by
Yukihiko SAWANOBORI
わかってるフレームワーク Laravel
by
Masashi Shinbara
Ansible 2.0 のサマライズとこれから
by
Takeshi Kuramochi
Ansible 2.0を使って組む kubernetesクラスタ vol.1
by
Hidetoshi Hirokawa
Similar to もう XAMPP / MAMP はいらない! Vagrant で作る PHP 開発環境
PPTX
勉強会0614 vagrant
by
Yu Ito
PDF
ローカル開発環境の構築をしよう VirtualBox + Vagrant
by
Kazuma Kimura
PDF
15分でCakePHPを始める方法(Nseg 2013-11-09 )
by
hiro345
PDF
PHP7を実際に動かしてみた@第96回PHP勉強会 #phpstudy
by
Hikari Fukasawa
PDF
VagrantユーザのためのDocker入門
by
Masashi Shinbara
PPTX
3分間 開発環境クッキング 2012.07 #pyfes
by
Takeshi Komiya
PDF
Vagrantと網元で開発環境を作ってみよう
by
Takuma Morikawa
PDF
仮想マシンざっくり解説と実践Vagrant | StaticPress × S3 × Vagrant 勉強会
by
Yukihiko SAWANOBORI
PDF
Vagrant+Chef
by
Daisuke Ando
PDF
Vagrant intro
by
t9md
PDF
20200129 bydstudy kashiwagi
by
beyond Co., Ltd.
PDF
モダン開発環境
by
Koji Agawa
PDF
Vagrant-concrete5
by
Kite Koga
PDF
仮想環境によるLinux
by
Shigeharu Matsumoto
PDF
Vagrant でお手軽開発環境
by
Hideki MACHIDA
PPTX
Vagrant chef
by
Masahiro Iitsuka
PDF
Vagrant chef
by
Hiroki Nigorinuma
PPTX
2017/04/12 mac/win対応の 仮想環境構築で複数インスタンスをぶん回せ!
by
Hikaru Tanaka
PDF
松本Linux勉強会 vagrant入門
by
Shiojiri Ohhara
PDF
Vagrant + VirtualBox + Chef を使った環境構築方法について
by
Shinya Kinoshita
勉強会0614 vagrant
by
Yu Ito
ローカル開発環境の構築をしよう VirtualBox + Vagrant
by
Kazuma Kimura
15分でCakePHPを始める方法(Nseg 2013-11-09 )
by
hiro345
PHP7を実際に動かしてみた@第96回PHP勉強会 #phpstudy
by
Hikari Fukasawa
VagrantユーザのためのDocker入門
by
Masashi Shinbara
3分間 開発環境クッキング 2012.07 #pyfes
by
Takeshi Komiya
Vagrantと網元で開発環境を作ってみよう
by
Takuma Morikawa
仮想マシンざっくり解説と実践Vagrant | StaticPress × S3 × Vagrant 勉強会
by
Yukihiko SAWANOBORI
Vagrant+Chef
by
Daisuke Ando
Vagrant intro
by
t9md
20200129 bydstudy kashiwagi
by
beyond Co., Ltd.
モダン開発環境
by
Koji Agawa
Vagrant-concrete5
by
Kite Koga
仮想環境によるLinux
by
Shigeharu Matsumoto
Vagrant でお手軽開発環境
by
Hideki MACHIDA
Vagrant chef
by
Masahiro Iitsuka
Vagrant chef
by
Hiroki Nigorinuma
2017/04/12 mac/win対応の 仮想環境構築で複数インスタンスをぶん回せ!
by
Hikaru Tanaka
松本Linux勉強会 vagrant入門
by
Shiojiri Ohhara
Vagrant + VirtualBox + Chef を使った環境構築方法について
by
Shinya Kinoshita
More from Masashi Shinbara
PDF
レイヤードアーキテクチャを意識したPHPアプリケーションの構築
by
Masashi Shinbara
PDF
いまどきのPHP
by
Masashi Shinbara
PDF
Laravel ユーザなら知っておくべきAuthオートログイン
by
Masashi Shinbara
PDF
How to learn Laravel5 application from Authentication
by
Masashi Shinbara
PDF
PHPコードではなく PHPコードの「書き方」を知る
by
Masashi Shinbara
PDF
レイヤードアーキテクチャを意識した PHPアプリケーションの構築 ver2
by
Masashi Shinbara
PDF
Twilio入門 -Web アプリ編-
by
Masashi Shinbara
PDF
Composer 再入門
by
Masashi Shinbara
PDF
PHP 5.5 Zend OPcache
by
Masashi Shinbara
PDF
先取り!PHP 7 と WordPress
by
Masashi Shinbara
KEY
10分で分かる最近のCakePHP
by
Masashi Shinbara
PDF
サーバの防災訓練
by
Masashi Shinbara
PDF
日本語消えたスライド
by
Masashi Shinbara
PDF
Kansai PHP Users Group 2012年活動報告
by
Masashi Shinbara
PDF
Twilio を使えば簡単にできる アプリケーションと電話/SMS連携
by
Masashi Shinbara
PDF
キャラ立ちしたエンジニアになる!
by
Masashi Shinbara
レイヤードアーキテクチャを意識したPHPアプリケーションの構築
by
Masashi Shinbara
いまどきのPHP
by
Masashi Shinbara
Laravel ユーザなら知っておくべきAuthオートログイン
by
Masashi Shinbara
How to learn Laravel5 application from Authentication
by
Masashi Shinbara
PHPコードではなく PHPコードの「書き方」を知る
by
Masashi Shinbara
レイヤードアーキテクチャを意識した PHPアプリケーションの構築 ver2
by
Masashi Shinbara
Twilio入門 -Web アプリ編-
by
Masashi Shinbara
Composer 再入門
by
Masashi Shinbara
PHP 5.5 Zend OPcache
by
Masashi Shinbara
先取り!PHP 7 と WordPress
by
Masashi Shinbara
10分で分かる最近のCakePHP
by
Masashi Shinbara
サーバの防災訓練
by
Masashi Shinbara
日本語消えたスライド
by
Masashi Shinbara
Kansai PHP Users Group 2012年活動報告
by
Masashi Shinbara
Twilio を使えば簡単にできる アプリケーションと電話/SMS連携
by
Masashi Shinbara
キャラ立ちしたエンジニアになる!
by
Masashi Shinbara
もう XAMPP / MAMP はいらない! Vagrant で作る PHP 開発環境
1.
2013/07/17 shin1x1 第7回 関西PHP勉強会 もう XAMPP
/ MAMP はいらない! Vagrant で作る PHP 開発環境
2.
@shin1x1 (c) 2013 Masashi
Shinbara @shin1x1 Shin x blog http://www.1x1.jp/blog/ PHP / DevOps / AWS / Varnish / Fabric / Chef
3.
Agenda (c) 2013 Masashi
Shinbara @shin1x1 • Vagrant とは • Vagrant で作るPHP 開発環境 • Vagrant Tips
4.
Vagrant (c) 2013 Masashi
Shinbara @shin1x1
5.
(c) 2013 Masashi
Shinbara @shin1x1 Web開発あるある
6.
エンジニアSさん (c) 2013 Masashi
Shinbara @shin1x1 • Macbook Air で開発 • Apache / PHP / DB • 複数案件を一台で
7.
エンジニアSさん (c) 2013 Masashi
Shinbara @shin1x1 1162 <VirtualHost *:80> 1163 ServerName candycane.local 1164 DocumentRoot "/Users/shin/sandbox/demo/candycane/app/webroot" 1165 </VirtualHost> 1166 1167 <VirtualHost *:80> 1168 ServerName demo.local 1169 DocumentRoot "/Users/shin/sandbox/demo/20130601_phpcon" 1170 php_value vld.active 1 1171 </VirtualHost> 1172 1173 <VirtualHost *:80> 1174 ServerName project1.local 1175 DocumentRoot "/Users/shin/project1/app/webroot" 1176 </VirtualHost> 1177 1178 <VirtualHost *:80> 1179 ServerName project2.local 1180 DocumentRoot "/Users/shin/project2/app/webroot" 1181 </VirtualHost>
8.
エンジニアSさん (c) 2013 Masashi
Shinbara @shin1x1 1162 <VirtualHost *:80> 1163 ServerName candycane.local 1164 DocumentRoot "/Users/shin/sandbox/demo/candycane/app/webroot" 1165 </VirtualHost> 1166 1167 <VirtualHost *:80> 1168 ServerName demo.local 1169 DocumentRoot "/Users/shin/sandbox/demo/20130601_phpcon" 1170 php_value vld.active 1 1171 </VirtualHost> 1172 1173 <VirtualHost *:80> 1174 ServerName project1.local 1175 DocumentRoot "/Users/shin/project1/app/webroot" 1176 </VirtualHost> 1177 1178 <VirtualHost *:80> 1179 ServerName project2.local 1180 DocumentRoot "/Users/shin/project2/app/webroot" 1181 </VirtualHost> 溢れる VirtualHost
9.
とある開発チームA (c) 2013 Masashi
Shinbara @shin1x1 • チームで開発 • Macbook / Windows で開発 • Apache / PHP / DB
10.
とある開発チームA (c) 2013 Masashi
Shinbara @shin1x1 あれ?動かない。 何か変なコード書いた? こっちは動いてるよ。 拡張追加しないとダメだよ。
11.
とある開発チームA (c) 2013 Masashi
Shinbara @shin1x1 あれ?動かない。 何か変なコード書いた? こっちは動いてるよ。 拡張追加しないとダメだよ。 俺の環境では動く
12.
WebデザイナーBさん (c) 2013 Masashi
Shinbara @shin1x1 • WordPressのデザイン • XAMPPをインストール • でもなんだか動かない。。。
13.
(c) 2013 Masashi
Shinbara @shin1x1 WebデザイナーBさん
14.
(c) 2013 Masashi
Shinbara @shin1x1 WebデザイナーBさん Port 80 は 俺のモノ
15.
そんなあなたに (c) 2013 Masashi
Shinbara @shin1x1
16.
Vagrantなら (c) 2013 Masashi
Shinbara @shin1x1 • プロジェクト毎に独立した環境を構築 • 他人と全く同じ環境を共有 • ホストPCとは分離された環境を構築
17.
Vagrantの構成 (c) 2013 Masashi
Shinbara @shin1x1 •Vagrant •仮想サーバ [ Provider ] (VirtualBox, VMWare, AWS等) •プロビジョニング [ Provisioning ] (Chef, Puppet, ShellScript等)
18.
(c) 2013 Masashi
Shinbara @shin1x1 VM起動 プロビジョニング実行 $ vagrant up Vagrantの構成
19.
(c) 2013 Masashi
Shinbara @shin1x1 VM起動 プロビジョニング実行 $ vagrant up Vagrantの構成
20.
(c) 2013 Masashi
Shinbara @shin1x1 VM起動 プロビジョニング実行 $ vagrant up Vagrantの構成
21.
Vagrant 覚えておきたい用語 (c) 2013
Masashi Shinbara @shin1x1 •Boxファイル => 仮想サーバイメージファイル •Vagrantfile => 仮想サーバ構築設定 •vagrantコマンド => 全ての操作はこのコマンドで
22.
Vagrant 主なコマンド (c) 2013
Masashi Shinbara @shin1x1 • Vagrantfile作成 $ vagrant init [boxファイル名] [boxファイルURL] • 仮想サーバ起動 $ vagrant up • 仮想サーバへ SSH ログイン $ vagrant ssh
23.
vagrant 主なコマンド (c) 2013
Masashi Shinbara @shin1x1 • 仮想サーバシャットダウン $ vagrant halt • 仮想サーバサスペンド $ vagrant suspend • 仮想サーバシャットダウン+破棄 $ vagrant destroy
24.
(c) 2013 Masashi
Shinbara @shin1x1 Vagrantで作る PHP開発環境
25.
サンプルプロジェクト (c) 2013 Masashi
Shinbara @shin1x1 • CakePHPプロジェクト • OSX 上の Vim で開発 • Vagrant + VirtualBox + ShellScript
26.
(c) 2013 Masashi
Shinbara @shin1x1 ファイル構成 $ tree /path/to/project . !"" src # !"" CONTRIBUTING.md # !"" README.md # !"" app # !"" build.properties # !"" build.xml # !"" index.php # !"" lib # !"" plugins # $"" vendors $"" vagrant !"" .gitignore !"" .vagrant $"" Vagrantfile アプリケーション Vagrant Git で管理
27.
(c) 2013 Masashi
Shinbara @shin1x1 $ cd vagrant $ cat .gitignore .vagrant •.vagrant/ は仮想サーバ固有の id が保存されているので git で 管理しない .gitignore
28.
(c) 2013 Masashi
Shinbara @shin1x1 # -*- mode: ruby -*- # vi: set ft=ruby : Vagrant.configure("2") do |config| config.vm.box = "centos64_ja" config.vm.network :private_network, ip: "192.168.33.100" config.vm.synced_folder "../src", "/src", :create => true, :owner=> 'vagrant', :group=>'vagrant', :extra => 'dmode=777,fmode=666' $ vim Vagrantfile Vagrantfile
29.
(c) 2013 Masashi
Shinbara @shin1x1 •ホストPCのディレクトリと 仮想サーバのディレクトリを同期 •開発はホストPCで、 実行は仮想サーバで •PhpStormやEclipseで開発可能 synced_folder
30.
(c) 2013 Masashi
Shinbara @shin1x1 config.vm.synced_folder "../src", "/src", :create => true, :owner=> 'vagrant', :group=>'vagrant', :extra => 'dmode=777,fmode=666' •ホストPC: ../src と 仮想サーバ: /src を共有 •仮想サーバに /src が無ければ自動生成 •/src は vagrant を owner / group に •/src 以下のパーミッションは ディレクトリが777、ファイルが666 synced_folder - Vagrantfile
31.
synced_folder 注意点 (c) 2013
Masashi Shinbara @shin1x1 •仮想サーバでの権限変更が反映されない •ホストPCでファイルが多いディレクトリは避ける •仮想サーバでのディスクアクセスは遅い => アプリケーションで大量のディスクIOが 発生する場合は synced_folder 以外の 領域を利用する
32.
(c) 2013 Masashi
Shinbara @shin1x1 provision = <<-"EOS" sudo yum -y update rpm -ivh http://ftp.riken.jp/Linux/fedora/epel/6/i386/epel-release-6-8.noarch.rpm rpm -ivh http://dl.iuscommunity.org/pub/ius/stable/CentOS/6/x86_64/ius- release-1.0-11.ius.centos6.noarch.rpm yum -y install php54 php54-pdo php54-cli php54-pgsql php54-mbstring php54-mcrypt php54-common php54-pecl-memcache php54-gd php54-xml php54-devel php54-pecl- xdebug php54-pecl-apc yum -y install httpd echo "date.timezone = Asia/Tokyo" >> /etc/php.ini echo "<VirtualHost *:80>" >> /etc/httpd/conf/httpd.conf echo " DocumentRoot /src/app/webroot" >> /etc/httpd/conf/httpd.conf echo "</VirtualHost>" >> /etc/httpd/conf/httpd.conf /sbin/service httpd start /sbin/chkconfig httpd on EOS config.vm.provision :shell, :inline => provision end Vagrantfile synced_folder を document_root に指定
33.
仮想サーバ起動 (c) 2013 Masashi
Shinbara @shin1x1 $ vagrant up $ open http://192.168.33.100/
34.
(c) 2013 Masashi
Shinbara @shin1x1 $ vim app/Config/bootstrap.php $ open http://192.168.33.100/ ホストPCでソース変更
35.
(c) 2013 Masashi
Shinbara @shin1x1 <?php phpinfo(); $ cd ../src/ $ vim app/webroot/info.php ホストPCでファイル追加 $ open http://192.168.33.100/info.php
36.
本格的な開発環境へ (c) 2013 Masashi
Shinbara @shin1x1 •複雑なプロビジョニングは Chef や Puppet で •できるだけプロビジョニングで自動化 => DB構築、初期データ投入、設定ファイル変更 •プロファイリングツールや phpMyAdmin など の管理ツールも一緒に入れると便利
37.
(c) 2013 Masashi
Shinbara @shin1x1 $ git clone http://extemple.com/project $ cd project/vagrant $ vagrant up •環境構築はこれだけ! Vagrantfile が git にあれば
38.
(c) 2013 Masashi
Shinbara @shin1x1 Vagrant Tips
39.
(c) 2013 Masashi
Shinbara @shin1x1 Configuration Version Vagrant::Config.run do |config| .... end • Version1 Vagrant.configure("2") do |config| Vagrant.configure("1") do |config| .... end • Version2 •blog等を見る時は、設定バージョンに注意。 バージョンが異なると動作しないことも。
40.
Sahara Plugin (c) 2013
Masashi Shinbara @shin1x1 • Vagrant Plugin https://github.com/jedi4ever/sahara • 仮想サーバの状態を DB の ROLLBACK のように戻せる
41.
Sahara Plugin (c) 2013
Masashi Shinbara @shin1x1 $ vagrant plugin install sahara • インストール
42.
Sahara Plugin (c) 2013
Masashi Shinbara @shin1x1 $ vagrant sandbox on • sandbox モード開始 = BEGIN; $ vagrant sandbox rollback • 元に戻す = ROLLBACK; $ vagrant sandbox commit • 変更確定 = COMMIT; $ vagrant sandbox off • sandbox モード終了
43.
参考1 (c) 2013 Masashi
Shinbara @shin1x1 http://docs.vagrantup.com/v2/
44.
参考2 (c) 2013 Masashi
Shinbara @shin1x1 http://www.amazon.co.jp/dp/1449335837
45.
参考2 (c) 2013 Masashi
Shinbara @shin1x1 http://www.amazon.co.jp/dp/1449335837
46.
Summary (c) 2013 Masashi
Shinbara @shin1x1 • プロジェクト毎に独立した環境を構築 => プロジェクト毎にVagrantfile • 他人と全く同じ環境を共有 => Boxファイル、Vagrantfileを共有 • ホストPCとは分離された環境を構築 => 開発はホストPC、実行は仮想マシン
47.
@shin1x1 (c) 2013 Masashi
Shinbara @shin1x1