Giter Club home page Giter Club logo

fusionbox's Introduction

Introduction

Fusionbox is a preconfigured Vagrant Box that matches our Rackspace CentOS server setup, allowing the ability to easily run FusionCMS v4 locally in no time. It provides you with everything without requiring you to install PHP, Apache, or any other server software on your local machine. No more worrying about messing up your operating system! Vagrant boxes are completely disposable. If something goes wrong, you can destroy and re-create the box in minutes!

Fusionbox runs on any Windows, Mac, or Linux system, and includes the Apache web server, PHP 5.3, MySQL, and all of the other goodies you need to develop amazing v4 projects.

Included Software

  • CentOS 6
  • PHP 5.5.34
  • GD
  • PDO
  • mbstring
  • Soap
  • xml
  • MySQL

First Steps

Before launching your Fusionbox environment, you must install VirtualBox 5.x as well as Vagrant. Both of these software packages provide easy-to-use visual installers for all popular operating systems.

Installing the Fusionbox Vagrant Box

Once VirtualBox and Vagrant have been installed, you should add the fusion/box box to your Vagrant installation using the following command in your terminal. It will take a few minutes to download the box, depending on your internet connection speed:

vagrant box add fusion/box

If this command fails, make sure your Vagrant installation is up to date.

Installing Fusionbox

You may install Fusionbox by simply running the following command.

sh -c "$(curl -fsSL "https://raw.githubusercontent.com/efellemedia/fusionbox/master/src/bin/install")"

Configuring Fusionbox

You may configure your Fusionbox instance by using the fusionbox config command from your terminal.

Configuring Shared Folders

The folders property of the Fusionbox configuration file lists all the folders you wish to share with your Fusionbox environment. As files within these folders are changed, they will be kept in sync between your local machine and the Fusionbox environment. You may configure as many shared folders as necessary:

folders:
    - map: ~/Code
      to: /var/www

To enable NFS, just add a simple flag to your synced folder configuration. Enabling NFS will significantly speed up page load speeds for most users.

folders:
    - map: ~/Code
      to: /var/www
      type: "nfs"

Configuring Apache Sites

Not familiar with Apache? No problem. The sites property allows you to easily map a "domain" to a folder on your Fusionbox environment. A sample site configuration is included in the Fusionbox configuration file. Again, you may add as many sites to your Fusionbox environment as necessary. Fusionbox can serve as a convenient, virtualized environment for every v4 project you are working on (including the CMS itself):

sites:
    - map: hometikibar.dev
      to: /var/www/hometiki/trunk

If you change the sites property after provisioning the Fusionbox environment, you should re-run fusionbox reload --provision to update the virtual host configuration on the virtual machine.

The Hosts File

You must add the "domains" for your Apache sites to the hosts file on your machine. The hosts file will redirect requests for your Fusionbox sites in your Fusionbox machine. On Mac and Linux, this file is located at /etc/hosts. On Windows, it is located at C:\Windows\System32\drivers\etc\hosts. The lines you add to this file will look like the following:

192.168.10.80 hometikibar.dev

Make sure the IP address listed in the one set in your Fusionbox configuration file. Once you have added your domain to your hosts file, you can access the site via your web browser:

http://hometikibar.dev

Launching the Fusionbox Environment

Once you have edited the fusionbox.yaml file to your liking, run the vagrant up command from your Fusionbox directory. Vagrant will boot the virtual machine and automatically configure your shared folders and Apache sites.

To destroy the machine, you may use the fusionbox destroy --force command.

Daily Usage

Connecting via SSH

You can SSH into your virtual machine by running the fusionbox ssh terminal command.

Connecting to Databases

To connect to your MySQL database from your host machine via Navicat or Sequel Pro, you should connect to 127.0.0.1 and port 33060. The username and password is root / blank.

Note: You should only use this non-standard port when connecting to the databases from your host machine. You will use the default 3306 port in your v5 constants file since your v4 project is running within the virtual machine.

Adding Additional Sites

Once your Fusionbox environment is provisioned and running, you may want to add additional Apache sites for your v4 projects. You can run as many v4 projects as you wish on a single Fusionbox environment. To add an additional site, simply add the site to your Fusionbox configuration file (fusionbox config) and then run the fusionbox provision terminal command.

Ports

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

  • SSH: 2222 → Forwards to 22
  • HTTP: 8080 → Forwards to 80
  • MySQL: 33080 → Forwards to 3306

Forwarding Additional Ports

If you wish, you may forward additional ports to the Vagrant box, as well as specify their protocol:

ports:
    - send: 93000
      to: 9300
    - send: 7777
      to: 777
      protocol: udp

Network Interfaces

The networks property of the fusionbox.yaml configures network interfaces for your Fusionbox environment. You may configure as many interfaces as necessary:

networks:
    - type: "private_network"
      ip: "192.168.10.20"

Sharing Your Environment

Sometimes you may wish to share what you're currectly working on with coworkers or a client. Vagrant has a built-in way to support this via vagrant share; however, this will not work if you have multiple sites configured in your fusionbox.yaml file.

To solve this problem, Fusionbox includes its own share command. To get started, SSH into your Fusionbox machine via fusionbox ssh and run share domain.dev. This will share the domain.dev site from your fusionbox.yaml configuration file. Of course, you may substitute any of your other configured sites for domain.dev.

After running the command, you will see an Ngrok screen appear which contains the activity log and the publicly accessible URLs for the shared site.

Remember

Vagrant is inherently insecure and you are exposing your virtual machine to the internet when running the share command. Always close the connection when you are done.

Updating Fusionbox

You can update Fusionbox in two simple steps. First, you should update the Vagrant box using the fusionbox box update command:

fusionbox box update

Next, you need to update the Fusionbox source code. Simply cd to ~/.fusionbox and run git pull origin master.

cd ~/.fusionbox
git pull origin master

fusionbox's People

Contributors

kaidesu avatar

Stargazers

Shane Krolikowski avatar  avatar

Watchers

James Cloos avatar  avatar Shane Krolikowski avatar

fusionbox's Issues

Increase file upload size

Currently set to 2MB, should update it to a hefty 20MB or so since we need to test large file uploads from time to time.

File: /etc/php.ini

; Maximum allowed size for uploaded files.
; http://php.net/upload-max-filesize
upload_max_filesize = 20M

Access denied when attempting to read log files

  • Go to /var/log/httpd then subl error_log (edited)
  • Change the ownership of the folder to root:apache and add yourself to the apache group:
    sudo chown -R root:apache /var/log/httpd
  • Open the /etc/group file and add the following to the group 'apache'
  1. sudo vi /etc/group
  2. add the following to the group ‘apache’: apache:x:48:vagrant
  3. sudo chmod -R 755 /var/log/httpd

Thanks @cam-vanorman

After destroying Fusionbox and setting back up, css files were not being updated after compilation.

Expected Result
When compiling (using gulp) css files should be read by the local site and be visible after compilation.

Actual Result
Files compile without incident, but the most updated versions of the files would not be available to the local site.

Resolution
Editing the httpd.conf file ( fusionbox ssh, cd /etc/httpd/conf && sudo nano httpd.conf ) to EnableSendfile and then restarting the httpd service ( sudo service httpd restart ) seemed to resolve this issue. An ideal fix would be to update the fusionbox deployment to have this setting correct to begin with.

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.