Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Mac・Windows共通のPHP開発環境
Search
komagata
April 28, 2015
Programming
1
5.4k
Mac・Windows共通のPHP開発環境
vagrant + ansibleでPHP開発環境
komagata
April 28, 2015
Tweet
Share
More Decks by komagata
See All by komagata
FBCの紹介@RailsGirls
komagata
0
83
フィヨルドブートキャンプの紹介
komagata
0
260
プログラミングスクールでのOSS教育
komagata
0
230
FBCの紹介@RailsGIrls
komagata
0
2.1k
FBCのご紹介
komagata
0
300
Unlimited Web Services
komagata
1
1.4k
漬け水に浸かる
komagata
13
6k
迷わない道案内を簡単に作る Kulku
komagata
1
250
交換型インターンシップ
komagata
4
4.1k
Other Decks in Programming
See All in Programming
これが俺の”自分戦略” プロセスを楽しんでいこう! - Developers CAREER Boost 2024
niftycorp
PRO
0
190
17年周年のWebアプリケーションにTanStack Queryを導入する / Implementing TanStack Query in a 17th Anniversary Web Application
saitolume
0
250
Stackless и stackful? Корутины и асинхронность в Go
lamodatech
0
690
なまけものオバケたち -PHP 8.4 に入った新機能の紹介-
tanakahisateru
1
120
Асинхронность неизбежна: как мы проектировали сервис уведомлений
lamodatech
0
700
useSyncExternalStoreを使いまくる
ssssota
6
1k
StarlingMonkeyを触ってみた話 - 2024冬
syumai
3
270
testcontainers のススメ
sgash708
1
120
Mermaid x AST x 生成AI = コードとドキュメントの完全同期への道
shibuyamizuho
0
160
Keeping it Ruby: Why Your Product Needs a Ruby SDK - RubyWorld 2024
envek
0
180
ゆるやかにgolangci-lintのルールを強くする / Kyoto.go #56
utgwkk
1
370
創造的活動から切り拓く新たなキャリア 好きから始めてみる夜勤オペレーターからSREへの転身
yjszk
1
130
Featured
See All Featured
Building Applications with DynamoDB
mza
91
6.1k
Optimizing for Happiness
mojombo
376
70k
For a Future-Friendly Web
brad_frost
175
9.4k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
28
2.1k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
26
1.9k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5k
Optimising Largest Contentful Paint
csswizardry
33
3k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
A Philosophy of Restraint
colly
203
16k
How to train your dragon (web standard)
notwaldorf
88
5.7k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
44
9.3k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Transcript
.BDɾ8JOEPXTڞ௨ͷ 1)1։ൃڥ ۨܗਅ@߹ಉձࣾϑΟϤϧυ Twitter: @komagata blog: http://docs.komagata.org
ϨΨγʔ1)1ͱʑઓ͍ͬͯ·͢ http://docs.komagata.org/5241
• Ϩϯλϧαʔόʔ • Windowsɹ • Subversionɹ • ڞ௨։ൃαʔόʔ • खಈσϓϩΠ
• खಈςετ ϨΨγʔ1)1։ൃڥ
• ϨϯλϧαʔόʔɹˠɹΫϥυ • WindowsɹˠɹMac or Linux • SubversionɹˠɹGithub • ڞ௨։ൃαʔόʔɹˠɹݸਓ։ൃڥ
• खಈσϓϩΠɹˠɹܧଓతσϓϩΠ • खಈςετɹˠɹࣗಈςετ ϨΨγʔ1)1։ൃڥ ͜Μͳײ͡ʹม͍͖͍͑ͯͨΑͶ
Կ͔ΒखΛ͚ͭΔʁ
ݸਓ։ൃڥ͔ΒखΛ͚ͨ wڞ௨։ൃαʔόʔ༧Ҏ্ʹ͔͍ͬ w ίϯϑϦΫτ ʮ͜Ε͔Βࢲ͕৮ΔͷͰΈͳ͞Μ"""αΠτ৮Βͳ͍ͳ͍Ͱ͍ͩ͘͞ʯ w HJUʹͯ̍͠ਓ͕CSBODIมߋ͢ΔͱશһCSBODI͕มΘΔ w ωοτϫʔΫӽ͠ͷTWOPOTBNCB͍͍͢͝ w
͔ࣾΒ͔͠ݟ͑ͳ͍ w %#ͷ༰͕ൿͷλϨԽ w ͍Βͳ͍ϑΝΠϧͨ͘͞Μ
WBHSBOU BOTJCMFͰ ααͬͱ࡞Γ·ͨ͠
ӕͰ͢ windowsϚγϯങ͍·ͨ͠ɻ
ͦΜͳαΫοͱͰ͖ͯͳ͍ windowsϚγϯങ͍·ͨ͠ɻ ΤΠεʔε
TIJOYCMPHਆ vagrantansibleʹ͍ͭͯ@shin1x1͞Μͷϒϩάݟͨ΄͏͕ྑ͍Ͱ͢
XJONBD BOTJCMFͰͷ 1)1։ൃڥͷίπ ʢ˺ϋϚΓͲ͜Ζʣ
WBHSBOU Vagrant.configure(2) do |config| config.vm.box = "chef/centos-6.6" config.vm.network "private_network", ip:
"192.168.33.10" config.vm.provision "shell", inline: <<-SHELL yum -y install epel-release yum -y install ansible ansible-playbook /vagrant/vagrant.yml --connection=local SHELL end ansibleΛΘͣɺshellͰansibleΛΠϯετʔϧͯ͠ ࣗࣗΛprovisionɻ ʢwindows൛ansibleແ͍ͷͰʣ
BOTJCMF VagrantfileͱplaybookΛಉ͡reposͰཧ
େྔαΠτ ཧ͍ͯ͠ΔαΠτ͕े͋ΔͷͰɺڥΛ࡞Δͷ͕ େมɻ ྫʣ 1.VirtualHostͷઃఆΛՃ͢Δ 2.HostsʹυϝΠϯɾIPΛઃఆ͢Δ αΠτ͕૿͑Δͨͼʹશһ͕͜ΕͷઃఆΛ͢Δ
7JSUVBM%PDVNFOU3PPU NameVirtualHost *:80 <VirtualHost *:80> VirtualDocumentRoot /srv/%0 </VirtualHost> <directory /srv/*>
Order allow,deny Allow from all </directory> foo.jpͰΞΫηε͞ΕͨΒ/srv/foo.jpΛDocumentRootͱ͢Δ ศརػೳɻ ʢapacheͷɻnginxͰͬͱී௨ʹͰ͖Δʣ
EPDSPPUIBDL NameVirtualHost *:80 <VirtualHost *:80> VirtualDocumentRoot /srv/%0 php_admin_value auto_prepend_file /srv/set_docroot_hack.php
</VirtualHost> VirtualDocumentRoot͏ͱPHPͷDOCUMENT_ROOT͕ ਖ਼͘͠ઃఆ͞Εͳ͍ͷճආɻ ʢnginxͰུ <?php $_SERVER['DOCUMENT_ROOT'] = str_replace($_SERVER['SCRIPT_NAME'], '', $_SERVER['SCRIPT_FILENAME']);
YJQJPͰWJSUVBMIPTU
YJQJPͰWJSUVBMIPTU DNSઃఆ͍ΒͣͰࣗ༝ʹsubdomain͑Δɻ subdomainʹipΛೖΕΔͱͦΕΛฦ͢ɻ ipͷsubdomainʹԿ͔ೖΕͯແࢹͯ͘͠ΕΔɻ ͜ΕΛ͑virtualboxͷprivate networkͷhostʹର ͯ͠ઃఆແ͠ʹsubdomainΛউखʹ࡞ΕΔɻ 192.168.33.10.xip.io -> 192.168.33.10
foo.192.168.33.10.xip.io -> 192.168.33.10 bar.192.168.33.10.xip.io -> 192.168.33.10
XJOEPXTͷ ύοέʔδϚωʔδϟʔ homebrewΈ͍ͨͳͷɻΫοιศརɻ
DIPDPMBUFZ ඞཁͳ͕ҰൃͰͦΖ͏ɻΫοιศརʢೋʣ > @powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object
net.webclient).DownloadString('https://chocolatey.org/ install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin ίϚϯυϓϩϯϓτ͔ΒΠϯετʔϧ > choco install googlechrome firefox curl git virtualbox vagrant -y PowerShellͱ͔NuGetͱ͔windowsͷྲّྀʹैͬͯ ΔͷͰ҆৺ʂ
.BD8JOڞ௨ͷ 1)1։ൃڥ͕Ͱ͖ͨ $ git clone
[email protected]
:komagata/php-development.git $ cd php-development $
vagrant up
ϨΨγʔ1)1վળͷ͝༻໋ ฐࣾ·Ͱ
Ҏ্Ͱ͢ɻ ͋Γ͕ͱ͏͍͟͝·ͨ͠ɻ