GithubHelp home page GithubHelp logo

kmhtoo / try-yii2 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ijackua/try-yii2

0.0 2.0 0.0 248 KB

Try Yii2 with Vagrant VM + Ansible provisioning = Complete readymade virtual server playground

License: MIT License

try-yii2's Introduction

Try Yii2 with Vagrant VM + Ansible provisioning

Tested on Ubuntu Linux host machine. But should work on Windows host too as Ansible is being installed on VM, not on Host.

Out of the box...

  • Ubuntu 14.04 64 bit ( + bulk of system soft like mc, curl, etc.)
  • PHP-FPM 5.5 ( + modules intl, gd, xdebug etc.)
  • Nginx 1.6
  • MySQL 5.5
  • Composer
  • phpMyAdmin 4.0
  • Adminer 4.1.0
  • Redis 2.8 ( + PhpRedis)
  • MongoDB 2.6.1 ( + php_mongo)
  • PostgreSQL 9.3
  • Sqlite 2.8.17
  • Memcached 1.4.14 ( + php5_memcached)
  • Imported Sakila DB for playing around
  • And of course Yii2 Advanced Project template imported
  • Local IP loop on Host machine /etc/hosts and Virtual hosts in Nginx already set up too !

Quick start

Install

  • Virtualbox 4.3+ + VirtualBox Extension Pack

  • Vagrant 1.6+ additional Vagrant modules (optional, but provide full automation) :

  • vagrant plugin install vagrant-hostsupdater vagrant-vbguest vagrant-cachier

You don't need to have Ansible installed on host machine. It will be installed on VM and self-provisioning will be launched. So it is possible to run everything on Windows machine.

RUN

  • Clone this sources from Git
  • Run vagrant up.
  • It will start VM creation and Provisioning. Could take some time 15-30 min... Drink coffee and get back for complete virtual server with Yi2 project ready for play !

PLAY

Ok, now if everything went fine you can access these Urls in your browser

Note : These local domains .local will be available on your host machine only if hosts file was modified correctly. It should be done automatically by vagrant-hostsupdater plugin. But if url http://yii2.local/ or other is not found by your browser - make sure your hosts file contain correct assignment of VM IP and local domains:
It should have such lines :

192.168.33.33 yii2.local
192.168.33.33 admin.yii2.local
192.168.33.33 phpmyadmin.yii2.local
192.168.33.33 adminer.yii2.local

File location. On Linux /etc/hosts. On Windows %SystemRoot%\system32\drivers\etc\hosts

Let's make something

Input there ...  
Table Name : actor  
Model Class : Actor  
Namespace : frontend\models

Press - Preview and then Generate
Input there ...  
Model Class : frontend\models\Actor  
Search Model Class : frontend\models\ActorSearch  
Controller Class : frontend\controllers\ActorController

Press - Preview and then Generate
  • And now your Actor CRUD page is generated. You can access it here http://yii2.local/index.php?r=actor
  • Continue playing with other Models, modify code (on your host machine in folder .../try-yii2/yii2-app-advanced) make relations between Models etc. Whatever you wish!

Getting deeper ...

  • In try-yii2 folder run vagrant ssh to access virtual dev server via SSH. You can modify and setup additionally anything you want.
  • Or modify Ansible provisioning YML files (if you are familiar with it) and run vagrant provision to update server config (WARNING! I can't guarantee that your changes will not be overwritten!)

TODO :

Complete Ansible provisioning scripts for all software stack Yii2 works out of the box

  • Sphinx
  • Elastic Search
  • CUBRID

Make option for yii-basic-template checkout

Made by Evgeniy Kuzminov. Thanks for support to Anton Logvinenko.

try-yii2's People

Contributors

ijackua avatar e-kuzminov-md 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.