RaspberryPi2
DreamFactory can be installed and configured on Raspberry Pi 2 as an open source IoT gateway.
Since DreamFactory relies on PHP and Laravel frameworks, the existing Raspbian distribution needs to be upgraded from Wheezy to Jessie. The upgrade process involves some manual work, including updating the package sources for Jessie and building PHP 5.6 from the sources. [Ubuntu Mate](https://ubuntu-mate.org/) is a stable, easy-to-use Debian distribution that can run on Raspberry Pi 2. Since it comes with PHP 5.6, it is easy to install all the required dependencies through simple apt-get install commands.
Here is a step-by-step guide to install DreamFactory on Raspberry Pi 2.
- Install Ubuntu Mate on Raspberry Pi 2
Follow the same procedure as setting up Raspbian for installing Ubuntu Mate on Raspberry Pi 2. Download the [image](https://ubuntu-mate.org/raspberry-pi/), uncompress it, and write it to a SD card. You can take the help of [Pi Filler](http://ivanx.com/raspberrypi/) to burn the .img file to the SD card. Boot Raspberry Pi with the SD card and follow the on-screen instructions. Make sure that the operating system is successfully installed.
Pi Filler prompting to insert the SD card
Ubuntu Mate Desktop on Raspberry Pi 2
- Install Apache, MySQL, and PHP
Open the terminal window and run the following commands:
$ sudo apt-get install –y curl apache2 php5 php5-common php5-cli php5-curl php5-json mcrypt php5-mcrypt php5-gd php5-mysql mysql-server mysql-client git
You may be prompted to enter the password for MySQL root user.
Once that's done, open Firefox in Ubuntu Mate Desktop and visit http://localhost to confirm the installation of Apache. You should see the default Apache2 Ubuntu page.
- Install phpMyAdmin
phpMyAdmin will be a handy tool that we can use later. Installing it will confirm that the LAMP stack is properly configured. You can setup phpMyAdmin with just one command:
$ sudo apt-get install phpmyadmin
- Set up the DreamFactory database in MySQL
DreamFactory expects a database to be in place during the installation. Run the following commands to set up the database in MySQL:
$ mysql -u root –p
Within the MySQL environment, run the following SQL commands:
mysql> create database dreamfactory; mysql> grant all privileges on dreamfactory.* to df_admin'@'localhost' identified by df_admin'; mysql> quit
- Clone DreamFactory repo
With all the prerequisites in place, you're now ready to set up DreamFactory. Run the below commands to clone the GitHub repo.
$ cd /opt $ git clone https://github.com/dreamfactorysoftware/dreamfactory.git $ cd dreamfactory $ cp .env-dist .env
We need to point the DreamFactory environment variables to the MySQL database. To do this, we copied the .env-dist file .env. If you created a user with a different name than df_admin, you need to update the database settings section of the .env file. Otherwise, you need not make any changes to the file.
The directory needs appropriate permissions to function properly. Run the following commands to configure them:
$ sudo chown -R www-data:www-data /opt/dreamfactory/ $ sudo chmod -R 777 /opt/dreamfactory/storage/ $ sudo chmod -R 777 /opt/dreamfactory/bootstrap/cache