How to build local environment for Magento 2 with using VCCW


As I wrote on this blog, VCCW is very useful for building local environment of Wordpress web apps but I found it's also useful to use it for LDAP apps. I this blog, I introduce the way for that. This example is configs for Magento2.



The way is very easy. After we install VCCW and vagrant up, you can find source code of Wordpress on Document Root. All we have to do is to remove the source code and deploy the source code of your app.
But I guess you often get some error and I'll show trouble shootings.

Get error when vagrant up

Run them.
$ vagrant reload
$ vagrant provision

Change configs and adopt optimum version

Config of apache

$ vi /etc/httpd/sites-enabled/wordpress.conf
#    AllowOverride FileInfo Options Limit
    AllowOverride All

Config and version of PHP

# Remove all applications related to current PHP
$ yum remove php-*
# Config to get applications via remi repository
$ vi /etc/yum.repos.d/remi.repo
[remi-php56]
name=Les RPM de remi de PHP 5.6 pour Enterprise Linux 6 - $basearch
#baseurl=http://rpms.famillecollet.com/enterprise/6/php56/$basearch/
mirrorlist=http://rpms.famillecollet.com/enterprise/6/php56/mirror
# WARNING: If you enable this repository, you must also enable "remi"
enabled=1
gpgcheck=1
priority=10
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi
$ yum --enablerepo=remi-php56 install php
$ yum --enablerepo=remi-php56 install php-pdo php-mbstring php-mcrypt php-mhash
$ yum --enablerepo=remi-php56 install php-xml php-gd php-intl php-devel php-mysql
$ vi /etc/php.ini
always_populate_raw_post_data = -1
max_execution_time = 18000
zlib.output_compression = On
$ service httpd restart

Config and version of MySQL

$ rpm -ivh http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm
$ vi /etc/yum.repos.d/mysql-community.repo
# Disable to use MySQL 5.5
[mysql55-community]
name=MySQL 5.5 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.5-community/el/6/$basearch/
enabled=0
gpgcheck=1
gpgkey=file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
# Enable to use MySQL 5.6
[mysql56-community]
name=MySQL 5.6 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.6-community/el/6/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
$ service mysqld stop
$ yum update mysql-server
$ mv /etc/my.cnf /etc/my.cnf.bk
$ mv /etc/my.cnf.rpmnew /etc/my.cnf
$ service mysqld start
#Create database and the user
$ mysql -uroot -pwordpress
create database database_name;
GRANT ALL PRIVILEGES ON username.* TO database_name@localhost IDENTIFIED BY 'password' WITH GRANT OPTION;
FLUSH PRIVILEGES;

Deploy source code

$ cd /var/www
$ rm -rf ./APP_ROOT
$ git clone https://github.com/username/repository.git APP_ROOT # case to deploy source code by git
$ cd APP_ROOT
$ find . -type d -exec chmod 770 {} \; && find . -type f -exec chmod 660 {} \; && chmod u+x bin/magento
$ chown -R :vagrant .

TROUBLE SHOOTING 1

`./APP_ROOT': デバイスもしくはリソースがビジー状態です
$ umount -lf ./APP_ROOT

TROUBLE SHOOTING 2

error: The requested URL returned error: 403 Forbidden while accessing https://github.com/username/repository.git/info/refs
fatal: HTTP request failed
$ git clone https://username@github.com/username/repository.git APP_ROOT

If you liked this article

Let's subscribe the updates of Scuti!
Share on Google Plus

About Tomohide Kakeya

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment
    Facebook Comment

1 Comments:

  1. You can get in contact 24/7 via reside chat or email, with the latter being a bit slower to respond. Instant play is still an choice however it's restricted to a portion of the catalog. Still, the platform ran smoothly on any device we tested it on. SuperSlots mobile on line casino is out there solely as a responsive website. It appears and feels nice on all gadgets however lacks dedicated apps for iOS or Android. Withdrawals are processed comparatively quick, excluding wire transfers and checks by courier, which takes 3-5 days 1xbet each.

    ReplyDelete