概要
EC-CUBE、とりあえず試してみたくない?
前提
- Vagrantは使える
できあがるもの
- EC-CUBEがインストールされている何か
- ホスト側のディレクトリ(ゲストでいう
/vagrant
)にソースコード置いてます。同期します多分。 - http://localhost:8080 でアクセスできるはず
※あ、ガチめにアホなので、おかしいとこあればばんばん指摘ほしいです、、
※Chefとかあんしぶるとかは、勉強したことなかったのでシェルにしてみました
さあ始めよう!
- こいつを保存して
vagrant up
Vagrantfile.
Vagrant.configure("2") do |config|
config.vm.box = "bento/centos-7.2"
config.vm.network "forwarded_port", guest: 80, host: 8080
config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--memory", "2048"]
end
config.vm.provision "shell", inline: <<-SHELL
yum -y update
service iptables stop
chkconfig iptables off
# Apache
yum -y install httpd
service httpd start
chkconfig httpd on
# MySQL
yum -y install mysql mysql-server mysql-devel
service mysqld start
chkconfig mysqld on
# PHP
yum -y install php php-opcache php-devel php-mbstring php-mcrypt php-mysql php-phpunit-PHPUnit php-pecl-xdebug php-pecl-xhprof php-xml
cp /etc/php.ini /etc/php.ini_org
sed -i -e "s|expose_php = On|expose_php = Off|" /etc/php.ini
sed -i -e "s|;date.timezone =|date.timezone = Asia/Tokyo|" /etc/php.ini
sed -i -e "s|display_errors = Off|display_errors = On|" /etc/php.ini
sed -i -e "s|;mbstring.language = Japanese|mbstring.language = Japanese|" /etc/php.ini
service httpd restart
# Git
cd /usr/local/src/
yum -y install curl-devel expat-devel gettext-devel openssl-devel zlib-devel perl-ExtUtils-MakeMaker
yum install gcc
wget https://www.kernel.org/pub/software/scm/git/git-2.4.0.tar.gz
tar zxvf git-2.4.0.tar.gz
cd git-2.4.0
make prefix=/usr/local all
make prefix=/usr/local install
# Git Update
cd /usr/local/src/
git clone git://git.kernel.org/pub/scm/git/git.git
cd git
git pull
make prefix=/usr/local all
make prefix=/usr/local install
# others
yum install wget vim unzip zip
# EC CUBE
cd /vagrant
wget http://downloads.ec-cube.net/src/eccube-3.0.13.zip
unzip eccube-3.0.13.zip
SHELL
# Sync folders
config.vm.synced_folder File.join(File.dirname(__FILE__),"/eccube-3.0.13"), "/var/www",
type: "rsync",
rsync_auto: true
# rsync__exclude: [".git/"]
end
おわり
- 実際のところ、上記のシェル、かなり失敗します。
-
unzip
がインストールされてないことがある?その場合手動で解凍お願いします、、
-
- なぜなのかわからない(疲れた)
- でもEC-CUBEは動いてるし、まあ良いよね(誰か助けて)