Installation

From DreamFactory
Jump to: navigation, search
DreamFactoryInstallation

DreamFactory is free open source software available under the [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0.html). We provide an optional paid support package. More information on the support package is available on DreamFactory's [website](https://www.dreamfactory.com/developers/support).

There are many ways to try out and use DreamFactory.

      1. Free Hosted Developer Environment

Sign up for a free DreamFactory-hosted developer account at [www.dreamfactory.com](http://www.dreamfactory.com). Your developer environment is hosted by DreamFactory and lets you try out the software. It has all the same capabilities as the installed open source package (except for server-side scripting), but it's for trying out DreamFactory, not for running production applications.

      1. Bitnami Desktop/Server Installers

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.

      1. Bitnami Virtual Machine

You can download DreamFactory as a [virtual machine](https://bitnami.com/stack/dreamfactory/virtual-machine) for VMware, VirtualBox, or other hypervisor environments.

      1. Docker Image

You can build your own Docker [image](https://github.com/dreamfactorysoftware/df-docker/) or pull the latest [Docker image from Docker Hub](https://hub.docker.com/r/dreamfactorysoftware/df-docker/).

      1. IaaS Clouds

You can install DreamFactory on IaaS cloud platforms (Infrastructure as a Service). Follow the instructions for the desired platform.

      1. PaaS Clouds

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

  • [Pivotal Web Services]() - Coming Soon.
  • [IBM Bluemix]() - Coming Soon.
  • [Red Hat OpenShift]() - Coming Soon.
  • [Heroku]() - Coming Soon.
      1. GitHub

You can also install DreamFactory [directly from GitHub](https://github.com/dreamfactorysoftware/dreamfactory). 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._

        1. 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.0 from GitHub.

  • PHP 5.5+ - check and install the requirements below for your particular environment.
  • Git - see [[1]]
  • Composer - see [[2]], may require cURL to be installed from particular environment below.
          1. Linux
  • [CentOS or RedHat](Installation/Linux/Yum)
  • [Mint, Debian or Ubuntu](Installation/Linux/Apt)
          1. Mac OS X

mcrypt library v8js library

            1. Using MAMP

Using MAMP allows simple stack setup and has some extensions already included, like mcrypt. 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.

          1. Windows

To date, the best way to install DreamFactory on Windows is to use the Bitnami installer mentioned above. Some have had success running DreamFactory on existing WAMP stacks or even IIS. We don't currently have a set of installable instructions, but will address this in the near future.


        1. Setup a Database

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

  • [SQLite](Installation/Databases/SQLite)
  • [MySQL, MariaDB, or Percona](Installation/Databases/MySQL)
  • [PostgreSQL](Installation/Databases/PostgreSQL)
  • [Microsoft SQL Server](Installation/Databases/SQLServer)
  • [SAP SQL Anywhere](Installation/Databases/SQLAnywhere)
        1. 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 make environment settings changes midway and then run it again to complete the setup.

> 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/

        1. Setup 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...

          1. Nginx

Debian/Ubuntu https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-14-04-lts > $ sudo apt-get install nginx

CentOS/RedHat https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-centos-7 > $ sudo yum install nginx


          1. Apache
$ sudo yum install httpd
$ sudo apt-get install apache2


Open the Firewall for http

$ setenforce 0
$ firewall-cmd --permanent --add-service=http
$ firewall-cmd --reload

Enable Site

Finally, we need to configure httpd to connect to the DreamFactory application.

Below are the instructions to change the default site on httpd. For instructions on setting up virtual hosts, review the httpd documentation.

Edit the httpd default configuration file.

> $ sudo nano /etc/httpd/conf/httpd.conf

Change the DocumentRoot and the Directory settings

DocumentRoot "/opt/dreamfactory/platform/web"

<Directory "/opt/dreamfactory/platform/web">
    Options -Indexes +FollowSymLinks -MultiViews
    AllowOverride All
    Require all granted
    RewriteEngine on
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^.*$ /index.php [L]
    <LimitExcept GET HEAD PUT DELETE PATCH POST>
        Allow from all
    </LimitExcept>
</Directory>

Enable the apache2 rewrite engine.

Restart the httpd server

> $ sudo service httpd restart


Your DreamFactory Application should now be active, and available by entering the DNS name or IP address of your server into a web browser.

Enable Site

Finally we need to configure apache to connect to the DreamFactory application.

Below are the instructions to change the default site on Apache2. For instructions on setting up virtual hosts on apache 2.2 and 2.4 please review the apache documentation.

In this example we will edit the Apache default configuration file.

> $ sudo nano /etc/apache2/sites-available/000-default.conf


Change the DocumentRoot to /opt/dreamfactory/platform/web

> DocumentRoot /opt/dreamfactory/platform/web

Update the Directory settings

<Directory /opt/dreamfactory/platform/web/>
	Options -Indexes +FollowSymLinks -MultiViews
   AllowOverride None
   Require all granted
   
   RewriteEngine on
   RewriteBase /

   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d

   RewriteRule ^.*$ /index.php [L]
</Directory>

Enable the apache2 rewrite engine.

> $ sudo a2enmod rewrite

Restart the apache server

> $ sudo service apache2 restart.

Your DreamFactory Application should now be active, and available by entering the DNS name or IP address of your server into a web browser.