Giter Club home page Giter Club logo

ansible-webstack-php-fpm-nginx-mysql-centos6's Introduction

ansible-webstack-php-fpm-nginx-mysql-centos6

THIS IS A COMBINATION OF VAGRANT + ANSIBLE

You can also use the ansible playbooks only.

Full Web Stack for deploying PHP Applications - Repo Support, Mysql, PHP-FPM5.5, Nginx, Redis, Varnish, Gearman, RabbitMQ

============================================

I. Requirements

+ Vagrant (with Virtual Box)
+ Ansible

II. Install Vagrant for Local Development

1. Download Virtual Box to machine

	https://www.virtualbox.org/wiki/Downloads

2. Download Vagrant

	www.vagrantup.com/downloads.html 

3. Create a folder to store your virtual machines of vagrant

	Windows: C:\vms
	Mac: /Users/Name/vms

	(These are optional folders)

4. Download file Centos and store into the above folder

	https://github.com/2creatives/vagrant-centos/releases/download/v6.5.1/centos65-x86_64-20131205.box 

5. Create a 'dev' folder inside above folder

6. Go to dev folder, and run

	vagrant init
	vagrant box add dev /Users/Name/vms/centos65.box



7. Open file vms/dev/vagrantfile and edit

	- Change config.vm.box from "base" to "dev"
	- uncomment this line: config.vm.network :private_network, ip: "192.168.33.10" 
	- uncomment this line:  config.vm.network :forwarded_port, guest: 80, host: 8080 

	- If you have many VM Instances, remember to change above IP and host:8080

8. Boot VM, cd to dev folder.

	vagrant up

9. SSH into your machine

	vagrant ssh

10. Switch to root

	sudo -s

11. Config Sync Folder

	config.vm.synced_folder "/Users/Name/Source", "/srv/www", :mount_options => ['dmode=777', 'fmode=777']

	("/Users/Name/Source" is your machine folder)
	("/srv/www" is vm folder)


12. Other commands

	- Turn on VM: vagrant up
	- Shutdown VM: vagrant halt
	- Reload VM: vagrant reload
	- Run with provision (like ansible): vargrant provision

III. Ansible Configuration

1. Open Vagrant File

config.vm.provision "ansible" do |ansible|
	ansible.playbook = "ansible/install.yml" #Configure to use which playbook
	ansible.inventory_path = "ansible/hosts" #Configure to use which hosts
	ansible.verbose = true
	ansible.sudo = true
end


2. Note: If you encounter this error

ERROR: problem running path_to/ansible/hosts --list ([Errno 8] Exec format error)

do this: 

chmod -x path_to/ansible/hosts

3. If you have run swap module, remember to comment # it if you need to do other provison module later

IV. Setup Local Domain

1. Modify your host files for 

	sudo vi /etc/hosts

2. Add the new record (IP)

	192.168.33.35 mdev.com

ansible-webstack-php-fpm-nginx-mysql-centos6's People

Contributors

nganhtuan63 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.