Giter Site home page Giter Site logo

gardening's Introduction

Gardening

pre-packaged Vagrant box that provides you a wonderful development environment
without requiring you to install PHP(7.0 ~ 7.2), a web server(Nginx or Apache),
and any other server software on your local machine.

php7 box:

{
  "require-dev": {
    "ytake/gardening": "~1.0"
  }
}

(supported for virtualbox only)

boxes

https://atlas.hashicorp.com/ytake

Included Software

  • CentOS 7
  • Git
  • PHP 7.x (remi repository)
  • Apache (2.4.6)
  • Nginx (1.14)
  • MySQL (5.7)
  • Sqlite3
  • PostgreSQL (10.1)
  • Composer (1.5)
  • Node.js (Gulp, webpack)
  • Redis(4.0)
  • Memcached
  • Elasticsearch(6.1)
  • Kibana(6.1)
  • MongoDB
  • Java(1.8)
  • fluentd
  • Couchbase(5.1)
  • beanstalkd(1.10)
  • RabbitMQ(3.7.2)
  • Apache Cassandra(3.11)
  • Apache Spark(2.2.1)
  • Apache Kafka(1.0.0 / Confluent Platform)

included php extensions

[PHP Modules]
amqp
apc
apcu
ast
bcmath
bz2
calendar
cassandra
Core
couchbase
ctype
curl
date
dom
ds
event
exif
fileinfo
filter
ftp
gd
geoip
gettext
gmp
grpc
hash
iconv
igbinary
imagick
intl
json
ldap
libsodium
libxml
mbstring
mcrypt
memcached
memprof
mongodb
msgpack
mysqli
mysqlnd
openssl
pcntl
pcre
pcs
PDO
pdo_dblib
pdo_mysql
pdo_pgsql
pdo_sqlite
pdo_sqlsrv
pgsql
phalcon
Phar
phpiredis
posix
protobuf
rdkafka
readline
redis
Reflection
session
shmop
SimpleXML
soap
sockets
sodium
solr
SPL
sqlite3
sqlsrv
ssh2
standard
Stomp
swoole
sysvmsg
sysvsem
sysvshm
tokenizer
uopz
uuid
wddx
xdebug
xhprof
xml
xmlreader
xmlrpc
xmlwriter
xsl
yaml
Zend OPcache
zip
zlib
zmq

[Zend Modules]
Xdebug
Zend OPcache

Composer global

included:

  • friendsofphp/php-cs-fixer
  • squizlabs/php_codesniffer
  • phpmd/phpmd

MySQL and PostgreSQL, RabbitMQ

  • user: gardening
  • password: 00:secreT,@

Xdebug

default:

xdebug.remote_enable = 1
xdebug.remote_connect_back = 1
xdebug.max_nesting_level = 512
xdebug.idekey = PHPSTORM

php7.0

xdebug.remote_port = 9070

php7.1

xdebug.remote_port = 9071

php7.2

xdebug.remote_port = 9072

Install Gardening Box

case 1, your "home" directory

$ cd ~
$ git clone https://github.com/ytake/gardening.git gardening

setup.sh(Windows .bat) command from the gardening directory to create the vagrant.yaml configuration file.(~/.gardening hidden directory)

$ bash setup.sh

case2, Per Project Installation

To install gardening directly into your project, require it using Composer:

$ composer require ytake/gardening --dev

use the make command to generate the Vagrantfile and gardening.yaml(or gardening.json) file in your project root.

$ ./vendor/bin/gardening gardening:setup

gardening.json:

$ ./vendor/bin/gardening gardening:setup --filetype=json

Configuration

Choose Web Server

default Nginx

web_server: nginx

Apache can be selected if necessary

web_server: httpd

Choose PHP version

default PHP7.2

php-alternatives: "7.1"

(7.0 or 7.1 or 7.2)

Configuring Shared Folders

folders:
    - map: /path/to/yourProject
      to: /home/vagrant/yourProjectName

many shared folders:

folders:
    - map: /path/to/yourProject
      to: /home/vagrant/yourProjectName
    - map: /path/to/yourSecondfProject
      to: /home/vagrant/yourSecondProjectName

Configuring Sites

sites:
    - map: gardening.app.vagrant
      to: /home/vagrant/yourProject/public

many sites:

sites:
    - map: gardening.app.vagrant
      to: /home/vagrant/yourProject/public
    - map: gardening.second.app
      to: /home/vagrant/yourSecondProject/public

use symfony by setting the type option:

sites:
    - map: gardening.app.vagrant
      to: /home/vagrant/yourProject/public
      type: symfony

symfony: symfony2, 3 / symfony4: symfony4

Multiple PHP Versions

sites:
    - map: gardening.app.vagrant
      to: /home/vagrant/yourProject/public
      php: "7.1"
    - map: gardening.second.app
      to: /home/vagrant/yourSecondProject/public
      php: "7.2"

Optional

Fluentd

Fluentd

use Fluentd by setting the fluentd option to true:

fluentd: true

MongoDB

MongoDB

use MongoDB by setting the mongodb option to true:

mongodb: true

Elasticsearch

Elasticsearch

use Elasticsearch by setting the elasticsearch option to true:

elasticsearch: true

Kibana

Kibana

use Kibana by setting the kibana option to true:

kibana: true

Access to Kibana http://vagrantIpAddress:5601/app/kibana

Couchbase

Couchbase

use Couchbase by setting the couchbase option to true:

couchbase: true

Access to admin console http://vagrantIpAddress:8091

Apache Cassandra

Cassabdra
Cassabdra(DataStax)

use Apache Cassandra by setting the cassandra option to true:

cassandra: true

RabbitMQ

RabbitMQ

use Couchbase by setting the rabbitmq option to true:

rabbitmq: true

Access to rabbitmq management web ui http://vagrantIpAddress:15672

Apache Kafka (Confluent Platform)

Apache Kafka
Confluent

use Kafka by setting the confluent option to true:

confluent: true

Ports

By default, the following ports are forwarded to your gardening environment:

  • SSH: 2222 → Forwards To 22
  • HTTP: 8000 → Forwards To 80
  • HTTPS: 44300 → Forwards To 443
  • MySQL: 33060 → Forwards To 3306
  • Postgres: 54320 → Forwards To 5432
  • MongoDB: 47017 → Forwards To 27017
  • Elasticsearch: 19200 → Forwards To 9200
  • kibana: 56010 → Forwards To 5601
  • Cassandra: 19042 → Forwards To 9024
  • Kafka: 19092 → Forwards To 9092

Forwarding Additional Ports:

ports:
    - send: 7777
      to: 777

Notice

gardening's People

Contributors

ytake avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

gardening's Issues

failed mount

vagrant up

default: Removed symlink /etc/systemd/system/multi-user.target.wants/nginx.service.
    default: Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
    default: Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.

failed mount

利用させて頂きました。
既存のlaravel5.2 に追加したんですが、

vagrant up

すると以下のようにmountに失敗します。

Failed to mount folders in Linux guest. This is usually because
the "vboxsf" file system is not available. Please verify that
the guest additions are properly installed in the guest and
can work properly. The command attempted was:

mount -t vboxsf -o uid=`id -u vagrant`,gid=`getent group vagrant | cut -d: -f3` vagrant /vagrant
mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g vagrant` vagrant /vagrant

The error output from the last command was:

/sbin/mount.vboxsf: mounting failed with the error: No such device

consoleを遡ると、以下のように Guest Additions module の追加に失敗しています。

Removing installed version 5.0.6 of VirtualBox Guest Additions...
Removing existing VirtualBox non-DKMS kernel modules[  OK  ]
Copying additional installer modules ...
Installing additional modules ...
Removing existing VirtualBox non-DKMS kernel modules[  OK  ]
Building the VirtualBox Guest Additions kernel modules
Building the main Guest Additions module[失敗]
(Look at /var/log/vboxadd-install.log to find out what went wrong)
Doing non-kernel setup of the Guest Additions[  OK  ]

vagrant ssh 後以下のようにkernelのupdate,compilerのinstallをすると、
正常にmountが可能でした。

sudo yum -y update kernel
sudo yum -y install kernel-devel kernel-headers dkms gcc gcc-c++

以下box fileのkernelを update, その他kernel周りの package,compilerのinstallをしてはいかがですか?
https://atlas.hashicorp.com/ytake/boxes/gardening/

private_networkが設定されない

以下のようなvagrant.ymlvagrant upするとprivate_networkが設定されませんでした。

ip: "192.168.10.14"
memory: 4096
cpus: 1
hostname: myapp
name: myapp
authorize: ~/.ssh/id_rsa.pub
keys:
    - ~/.ssh/id_rsa
folders:
    - map: ./
      to: /home/vagrant/myapp
sites:
    - map: myapp.app
      to: "/home/vagrant/myapp/public"
      hhvm: false
elasticsearch: false
fluentd: true
mongodb: false
couchbase: true
[vagrant@myapp:~/myapp]$ ifconfig
enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.0.2.15  netmask 255.255.255.0  broadcast 10.0.2.255
        inet6 fe80::a00:27ff:fef6:b007  prefixlen 64  scopeid 0x20<link>
        ether 08:00:27:f6:b0:07  txqueuelen 1000  (Ethernet)
        RX packets 712  bytes 79932 (78.0 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 468  bytes 67736 (66.1 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 0  (Local Loopback)
        RX packets 622  bytes 67842 (66.2 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 622  bytes 67842 (66.2 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

scripts/builder.rbのネットワーク設定にauto_config:falseを指定すると設定されました。

    # Configure A Private Network IP
    config.vm.network :private_network, ip: settings["ip"] ||= "192.168.10.10", auto_config:false
[vagrant@myapp:~/myapp]$ ifconfig
enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.0.2.15  netmask 255.255.255.0  broadcast 10.0.2.255
        inet6 fe80::a00:27ff:fef6:b007  prefixlen 64  scopeid 0x20<link>
        ether 08:00:27:f6:b0:07  txqueuelen 1000  (Ethernet)
        RX packets 352  bytes 40338 (39.3 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 241  bytes 34846 (34.0 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

enp0s8: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.10.14  netmask 255.255.255.0  broadcast 192.168.10.255
        inet6 fe80::a00:27ff:fe56:d9af  prefixlen 64  scopeid 0x20<link>
        ether 08:00:27:56:d9:af  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 12  bytes 888 (888.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 0  (Local Loopback)
        RX packets 366  bytes 41455 (40.4 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 366  bytes 41455 (40.4 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

HOST: macOS Sierra 10.12.2
GUEST: CentOS Linux release 7.1.1503 (Core)
Vagrant: 1.9.1

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.