Last active
June 24, 2017 15:50
-
-
Save Jung0/023aa62128f7fa7584f6 to your computer and use it in GitHub Desktop.
anyenvでモダンな開発環境構築。PHP,NodeJS,Ruby,Perl,Python ref: http://qiita.com/pfavill/items/f500e46444c86a6f8e6a
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--with-apxs2=/usr/sbin/apxs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ brew tap homebrew/dupes | |
$ brew tap homebrew/apache | |
$ brew search httpd | |
$ brew install httpd24 | |
# 次のようになっていることを確認 | |
$ which apachectl | |
/usr/local/bin/apachectl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ anyenv install plenv | |
$ anyenv install pyenv | |
$ anyenv install rbenv | |
$ anyenv install phpenv | |
$ anyenv install ndenv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ anyenv versions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ mkdir -p $(anyenv root)/plugins | |
$ git clone https://github.com/znz/anyenv-update.git $(anyenv root)/plugins/anyenv-update | |
$ anyenv update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ mkdir -p $(anyenv root)/plugins | |
$ git clone git://github.com/aereal/anyenv-exec.git $(anyenv root)/plugins/anyenv-exe | |
$ anyenv --version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ mkdir -p $(anyenv root)/plugins | |
$ git clone https://github.com/znz/anyenv-git.git $(anyenv root)/plugins/anyenv-git | |
$ anyenv git gc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ phpenv install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ phpenv install 5.6.9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ phpenv versions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ phpenv global 5.6.9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ php -v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cd ~/.anyenv/envs/phpenv/plugins/php-build/bin | |
$ curl https://gist.githubusercontent.com/tkuchiki/10112836/raw/php-build.patch | patch -u php-build - |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~/.anyenv/envs/phpenv/versions/5.6.9/libexec/libphp5.so |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ LANG=C ls -l ~/.anyenv/envs/phpenv/lib/libphp5.so | cut -f9- -d' ' | |
/home/ユーザー名/.anyenv/envs/phpenv/lib/libphp5.so -> /home/ユーザー名/.anyenv/envs/phpenv/versions/5.6.9/libexec/libphp5.so* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#LoadModule php5_module ~ディレクトリ | |
↓ | |
LoadModule php5_module ~ディレクトリ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cd ~/.anyenv/envs/phpenv/plugins |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ git clone https://github.com/php-build/php-build.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ anyenv update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo apachectl start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ apachectl -t |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ git clone https://github.com/riywo/anyenv ~/.anyenv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$vim .bashrc | |
if [ -d $HOME/.anyenv ] ; then | |
export PATH="$HOME/.anyenv/bin:$PATH" | |
eval "$(anyenv init -)" | |
# tmux対応 | |
for D in `\ls $HOME/.anyenv/envs` | |
do | |
export PATH="$HOME/.anyenv/envs/$D/shims:$PATH" | |
done | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ exec $SHELL -l |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ which anyenv | |
~/.anyenv/bin/anyenv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Use name-based virtual hosting. | |
# | |
# NameVirtualHost *:80 (Apache2.4からはこの記述いらないみたい。一応コメントとして残しておきます) | |
<VirtualHost *:80> | |
ServerName sample.local | |
DocumentRoot /Users/ユーザ名/httpd.confで指定したフォルダ名 | |
DirectoryIndex index.php index.html | |
<Directory "/Users/ユーザ名/httpd.confで指定したフォルダ名"> | |
AllowOverride All | |
Allow from All | |
</Directory> | |
</VirtualHost> | |
# | |
# VirtualHost example: | |
# Almost any Apache directive may go into a VirtualHost container. | |
# The first VirtualHost section is used for all requests that do not | |
# match a ServerName or ServerAlias in any <VirtualHost> block. | |
# | |
#<VirtualHost *:8080> | |
# ServerAdmin [email protected] | |
# DocumentRoot "/usr/local/opt/httpd22/docs/dummy-host.example.com" | |
# ServerName dummy-host.example.com | |
# ServerAlias www.dummy-host.example.com | |
# ErrorLog "/usr/local/var/log/apache2/dummy-host.example.com-error_log" | |
# CustomLog "/usr/local/var/log/apache2/dummy-host.example.com-access_log" common | |
#</VirtualHost> | |
#<VirtualHost *:8080> | |
# ServerAdmin [email protected] | |
# DocumentRoot "/usr/local/opt/httpd22/docs/dummy-host2.example.com" | |
# ServerName dummy-host2.example.com | |
# ErrorLog "/usr/local/var/log/apache2/dummy-host2.example.com-error_log" | |
# CustomLog "/usr/local/var/log/apache2/dummy-host2.example.com-access_log" common | |
#</VirtualHost> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 使用するポート番号の設定 | |
# localhost/で繋ぎたいので、80ポートにする | |
Listen 80 | |
# ServerNameの設定 | |
# 上でポート番号を80にしたので、ここも80にする | |
ServerName localhost:80 | |
# DocumentRootの変更 | |
DocumentRoot "/Users/ユーザ名/フォルダ名" | |
# .htaccessでURLのoverwriteを許可 (<Directory "/Users/furudate/htdocs">内) | |
AllowOverride All | |
# index.phpを使えるように修正 (IfModule dir_module内) | |
DirectoryIndex index.php index.html | |
# .phpを実行できるようにMIMEタイプを追加 (IfModule mime_module内) | |
AddType application/x-httpd-php .php | |
# バーチャルホストを利用できるようにコメントアウトを解除 | |
Include /usr/local/etc/apache2/2.4/extra/httpd-vhosts.conf | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment