Giter Club home page Giter Club logo

mage2_vagrant's Introduction

Magento2 Vagrant Box

A simple way to get magento2 up and running. It consists of a Debian Wheezy box provised via Puppet. The provider is Virtual Box. It will install apache2 +fastcgi, php, php-fpm, mysql and any other necessary dependancies.

The Magento 2 repository is a git submodule and can be edited/explored from the host machine. It is accessed by the guest via shared directories.

Usage

Installation

  1. Clone this repository: git clone --recursive https://github.com/rgranadino/mage2_vagrant.git
  2. Navigate into the repository via cd
  3. IMPORTANT: If you cloned the repository without the --recursive param, you need to initialize the required submodules: git submodule update --init --recursive
  4. Start up virtual machine: vagrant up
  5. Point a host name to 192.168.56.10 in /etc/hosts echo '192.168.56.10 mage2.dev' >> /etc/hosts

NOTE: Some composer dependancies require git. Agent Forwarding over SSH is enabled in the Vagrant file but you must have ssh-agent running and your key added. Running ssh-add should add the default key to the identities list, which presumably is the same key used to access github/bitbucket. You'll may also need to create a API access token in github, instructions can be found here:

  1. Once the machine completes provisioning, SSH to the server (vagrant ssh).
  2. Add your Magento Connect authentication credentials to the global composer auth.json:
  • Open or create the file ~/.composer/auth.json
  • Add the Magento Connect authentication credentials (if you don't have any, please check here on how to create them):
{
    "http-basic": {
        "repo.magento.com": {
            "username": "<public key>",
            "password": "<private key>"
        }
    }
}
  • Or you can use the composer config command: composer.phar global config http-basic.repo.magento.com <public_key> <private_key>
  1. Install Magento 2 by running:
  • Via CLI (recommended)

    • reinstall (Magento without sample data) or reinstall -s (Magento with sample data).
  • Via Web Installer

    • Please go to the Magento directory within the vagrant box (cd /vagrant/data/magento2/) and run composer install. Then open 'http://mage2.dev/setup' in your browser and go through the installation process.

Updating

  1. From the host machine run git pull && git submodule update --init && vagrant provision.
  • If there is an update to the manifests/mage.pp or files/* files it is recommended to provision the guest machine. This can be done by running: vagrant provision. There is also a cron that runs every 15 minutes to provision within the guest machine in the event it's not done after updating.
  1. If you want to start from a clean slate run: reinstall from within the guest machine. This will uninstall the application and reinstall it from scratch.

Shell Aliases / Scripts

  • m - cd into the base magento directory: /vagrant/data/magento2
  • reinstall - run magento shell uninstall script with the cleanup_database flag and run installation again, uses http://mage2.dev as base URL
  • reinstall -s - install magento with sample data
  • mt - run bulk magento test suites

Status and Debug utilities

A status vhost on port 88 has been setup to view apache's server status, php-fpm status as well as some other utilities.

Magento Admin User

  • Username: admin
  • Password: password123

Database Info

  • Username: root
  • Password: mage2
  • DB Name: mage2

SSH Info

  • username: vagrant
  • password: vagrant

It's also possible to use vagrant ssh from within the project directory

File Structure

Host Machine / Project directory

  • manifests/mage.pp - Puppet manifest file
  • files/ - contains various service configuration files
    • bash_aliases - vagrant user bash aliases script
    • fastcgi.conf - fastcgi configuration
    • reinstall.sh - magento reinstall wrapper script
    • site.conf - apache virtual host configuration
    • www.conf - php-fpm pool configuration
    • xdebug.ini - php xdebug configuration file
  • data/magento2 - Git submodule to Magento2 Github repository: https://github.com/magento/magento2
  • data/magento2-sample-data - Git submodule to Magento2 Sample Data Github repository: https://github.com/magento/magento2-sample-data

Guest Machine

  • /vagrant/data/magento2 - Apache Document Root

mage2_vagrant's People

Contributors

rgranadino avatar therouv avatar vinai avatar mzeis avatar mattdunbar avatar steverobbins avatar schrank avatar morgon avatar steig avatar tonegolf71 avatar rikwillems avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.