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 on DreamFactory's website [here](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 <a href="http://www.dreamfactory.com">www.dreamfactory.com</a>. 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
            1. CentOS or Red Hat
$ sudo yum install git curl php php-common php-cli php-curl php-json php-mcrypt php-gd

Please note that the php-mcrypt and php-json packages aren't available is some distro repositories. If this is the case, you can add the [RHEL EPEL](http://fedoraproject.org/wiki/EPEL) repository to your sources list. Instructions for doing this are available [here](http://www.rackspace.com/knowledge_center/article/installing-rhel-epel-repo-on-centos-5x-or-6x).

            1. Debian or Ubuntu
$ sudo apt-get install git curl php5 php5-common php5-cli php5-curl php5-json php5-mcrypt php5-gd
          1. Mac OS X
            1. Using MAMP
            1. Native install
          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)
 * [Microsoft SQL Server](Installation/Databases/SQL Server)
 * [SAP SQL Anywhere](Installation/Databases/SQL Anywhere)
        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...

  • [Nginx]()
  • [Apache]()
  • httpd
$ 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.

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

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

```bash DocumentRoot /opt/dreamfactory/platform/web ```

Update the Directory settings

```bash <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.

```bash $ sudo a2enmod rewrite ```

Enable mcrypt

```bash $ sudo php5enmod mcrypt ```

Restart the apache server

```bash $ 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.