Installation

From DreamFactory
Jump to: navigation, search
DreamFactoryInstallation

DreamFactory is free open source software available under the Apache License 2.0.

DreamFactory runs on Linux, Windows, and Mac OS X.

There are many ways to try out and use DreamFactory. Follow the installation instructions below.

Free Hosted Developer Environment

Sign up for a free DreamFactory-hosted developer account at www.dreamfactory.com. Your developer environment is hosted by DreamFactory and lets you try out the software. It supports almost all of the available service types, including the paid services so you can try before you buy. It's kept updated with the latest releases and patches.

Please note that the hosted environment is for trying out the platform, not for running production applications. For production applications you should install DreamFactory for yourself using one of the methods described below.

Bitnami Desktop/Server Installers

Installation

You can download DreamFactory as a simple click-through installer for the following desktop operating systems. Most common extensions and drivers are pre-packaged and available in these installers.

  • Linux (CentOS, Red Hat, Mint, Debian, and Ubuntu desktop and server).
  • Mac OS X.
  • Microsoft Windows (Windows 7, 8, 10 and Server 2008R2). Note: that some features may not be available or may be limited in this environment.

Bitnami Virtual Machine

You can download DreamFactory as a virtual machine for VMware, VirtualBox, or other hypervisor environments.

Docker Image

You can build your own Docker image or pull the latest Docker image from Docker Hub.

IaaS Clouds

You can easily install DreamFactory on IaaS cloud platforms with Bitnami. Follow the instructions below:

PaaS Clouds

You can install DreamFactory on PaaS cloud platforms (Platform as a Service). Follow the instructions below.

GitHub

You can also install DreamFactory directly from GitHub. Follow the general instructions after taking care of the requirements for your particular environment.

Note: This quick setup instruction assumes that you are familiar with composer, git and the basics of how to setup a web and database server.

Required Software and Extensions

At minimum, you will need the following software and extensions installed and enabled on your system in order to successfully install and run DreamFactory 2.X from GitHub.

  • PHP 5.5+ - check and install the requirements below for your particular environment.
    • PHP required modules: curl, sqlite, mongodb (see below)
  • Git - see https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
  • Composer - see https://getcomposer.org/download/, may require cURL to be installed from particular environment below.
  • MongoDB driver (i.e. mongodb.so) - Versions >= 2.1 require the new MongoDB driver to be installed to run composer successfully. If MongoDB is not to be used on your install, please remove the df-mongodb requirement from composer.json before running composer install or upgrade.

Linux

Mac OS X

  • Install v8js library
  • Using MAMP - Using MAMP allows simple stack setup and has some extensions already included. It does not however include v8js. You can follow the above compile instructions and place the v8js.so file in the desired MAMP PHP extension directory. Also note that MAMP ships with an older version of MySQL (5.5) which does not support some databases options that you may run into, particularly dealing with timestamp fields.

Windows

Installing Dreamfactory on Windows Server 2008 with IIS7


Note: These installation instructions assume a “Clean Install” for IIS. There may be sections which have already been accomplished or installed. If so, skip the sections which no longer apply to your situation.These instructions are concerned only with the installation of Dreamfactory. Please consult your Windows Administrator for hardening the web server and other security controls which are outside the scope of these instructions.
Install PHP for IIS
Before beginning the installation download the Web Platform Installer for IIS here.

  • In the Web Platform Installer, navigate to the Products tab and choose Frameworks from the sidebar. Select the appropriate PHP version. In our example, we're using PHP 5.6.
  • Click Add, then Install at the bottom. Follow the on screen prompts to accept the EULA to install PHP for IIS.


Setup PHP Module Mapping in IIS
Once PHP has been successfully installed, it must be set up in IIS7.

  • Open the IIS Services Manager and from the sidebar, click the server name.
  • Double-click Handler Mappings. PHP needs to be associated with the FastCGI handler in your PHP directory.

Note:If PHP was installed using the Web Platform Installer the handler mappings should have the FastCGI associations already. Check that the associations are correct and correspond to your local server.In the list of handler mappings the name of the mapping defaults to PHP_via_FastCGI,this is the mapping you will need to doublecheck. Click OK.

If the default handler mapping for PHP FastCGI isn't listed you will need to add it now:

  • From the Actions pane, click Add Module Mapping Enter the following information with the path to the php-cgi executable local to the server:
Request Path: *.php
Module: FastCgiModule
Executable: "C:\Program Files(x86)\PHP\v5.6\php-cgi.exe"
Name: PHPviaFastCGI
  • Click OK, then click Yes to confirm.
  • Using Internet Information Services (IIS) Manager click on the server you are working with and click Restart from the actions pane.


Test PHP for IIS
To test PHP, we are going to create a php info file within the web root directory. Typically, this directory is located in:


C:\inetpub\wwwroot
  • In the webroot directory, create an empty PHP file. At the top of file the type the following:
 <?php phpinfo();
  • Save the file as info.php. Ensure the filename and extension are info.php, not info.php.txt. This would be not shown if Hide Extensions for known file types is enabled from Folder Options. Make sure this is unchecked, if need be from Folder Options:


  • From a browser, navigate to the phpinfo file you just created. Typically, on a fresh server install it will be http://localhost/info.php in your web browser.
  • If you receive a 404.0 error, typically the problem is either that the extension is not .php or that file permissions are set incorrectly. If you receive a 403.3 error with the following message, MIME types must be set up correctly for PHP, please ensure that you followed the IIS PHP setup section above. If you are seeing a blank page, you may need to enable errors for debugging purposes in your php.ini file. Alternately, you can view the output of the php error.log for more info.
  • If the install was successful, you should see a PHP Info page in your browser. Keep this file in place until you finish the rest of the configuration, then delete it afterwards, as this file contains system-specific information.


Once you have PHP set up and working with IIS, you are ready to install Dreamfactory and add it as a site in IIS 7.

Install Dreamfactory on IIS 7
You will need to follow the Required Software and Extensions section to ensure you have Git, Composer, and optionally the MongoDB Driver, if needed. After completing that, the following describes how to install Dreamfactory on IIS7.

Note:If you plan on running SQL Server with Dreamfactory,you will need to purchase a Dreamfactory subscription before installing, so the appropriate dependencies can be added to your installation. Please contact Support for additional information.

  • Next, open a command prompt, Power Shell, or Windows Git Client
  • From the prompt, navigate to the directory you want to install Dreamfactory. Typically, this will be:
    C:\inetpub\wwwroot\

However you can choose any location you want. We will add this as a site later in IIS. In this example, we're choosing:
C:\inetpub\wwwroot\dreamfactory


  • Perform a Git clone into this directory for Dreamfactory:
git clone https://github.com/dreamfactorysoftware/dreamfactory


This will pull down the master branch of Dreamfactory into a directory called ./dreamfactory.

  • Navigate to the dreamfactory directory and install dependencies using composer. For production environment, use --no-dev, otherwise discard that option for a development environment. If you are not running or plan to run MongoDB, add —ignore-platform-reqs:
composer update—ignore-platform-reqs —no-dev

Otherwise run the following command to install the dependencies:

composer install --no-dev
  • Run DreamFactory setup command-line wizard. This will set up your configuration and prompt you for things like database settings, first admin user account, etc. It will also allow you to change environment settings midway and then run it again to complete the set up.
php artisan dreamfactory:setup


Follow the on-screen prompts to complete the setup.

Add Dreamfactory Site to IIS Manager

  • Open IIS Manager
  • From the Actions column, select Add Web Site
  • Enter in all pertinent information in the dialog. In the Physical Path field, enter the path to your Dreamfactory installation's public folder.


  • Enter your Host name as well for your instance.
  • Click OK to start the service.


Add URL Rewrite Rules to IIS
You will need to add rewrite rules to IIS 7 manually. To accomplish this follow the below steps:

  • Click on the Dreamfactory site and then choose URL Rewrite.
  • From the Actions column, choose Import Rules.
  • Navigate to the .htaccess file in the /public directory of your Dreamfactory installation in the Configuration File input, then click Import. The .htaccess file will automatically be converted to XML for you.
  • In Tree View, find any rules that have a red X icon. Click on that rule and it will be highlighted in the Rewrite Rules dialog box.



  • Remove that rule in the Rewrite Rules dialog box and repeat this for any additional rules until you see all green checkboxes.
  • Click Apply in the Actions column.


Ensure Dreamfactory Cache and Log Directories are Writable
You will need to set permissions on the following directories to ensure they are writable within the Dreamfactory installation folder. These are:

  • storage/framework/cache/
  • storage/framework/views/
  • storage/logs/


Please ensure that the Users group has full control of these directories to enable creation of log files, cache files, etc. Optionally, if you are using the included sqlite database for testing, please ensure the storage/databases/ directory also has write and modify permissions as well. Restart your web server and navigate to your Dreamfactory installation. If you are testing in the local environment, you can add a FQDN in your hosts file to allow navigating to the Dreamfactory site locally.

Set Up a Database

Install your native database and any additional drivers required for your database.

Switch System Database

If you want to change from one system database to another after you've already run setup/installation:

  • Stop Apache
  • Edit the .env file (in the htdocs folder) to include the right driver, host, and port number. Example:
DB_DRIVER=mysql
DB_HOST=localhost
DB_DATABASE=dreamfactory
DB_USERNAME=dreamfactory
DB_PASSWORD=dreamfactory
DB_PORT=3306
  • In your shell navigate to the dreamfactory root folder (htdocs in Bitnami installs)
  • Run these commands:
$ php artisan config:clear
$ php artisan cache:clear
$ php artisan dreamfactory:setup
//Answer the on screen prompts
  • Restart Apache

General Instructions

The commands shown here are primarily for a Linux based OS, but should also work on Windows (directory structure is obviously different) with all the required software and extensions installed.

  • Clone this repository to a directory on your system. For testing, using a directory under your home directory is easiest, otherwise choices like /var/www/ or /opt may be preferred.
$ git clone https://github.com/dreamfactorysoftware/dreamfactory.git ~/df2
  • Change your working path to that directory.
$ cd ~/df2
  • Install dependencies using composer. For production environment, use --no-dev, otherwise discard that option for a development environment.
$ composer install --no-dev
  • Run DreamFactory setup command-line wizard. This will set up your configuration and prompt you for things like database settings, first admin user account, etc. It will also allow you to change environment settings midway and then run it again to complete the set up.
$ php artisan dreamfactory:setup
  • Make sure your web server can read/write from/to storage/ (sub directories) and bootstrap/cache/ directories.

Example:

$ sudo chown -R {www user}:{your user group} storage/ bootstrap/cache/
$ sudo chmod -R 2775 storage/ bootstrap/cache/

Set Up a Web Server

Use PHP's built in web server (**Note**: Testing only, not for production use!)

$ php artisan serve

Or provision a web server to run your DreamFactory instance by following these instructions:

Nginx

Apache

Raspberry Pi 2

You can install and configure DreamFactory on Raspberry Pi 2 as an open source IoT gateway. Follow the general instructions here.

Additional Drivers and Modules