Installation

From DreamFactory
Jump to: navigation, search
DreamFactoryInstallation
(Manual (Github) Installs)
 
(86 intermediate revisions by 8 users not shown)
Line 1: Line 1:
DreamFactory is free open source software available under the [http://www.apache.org/licenses/LICENSE-2.0.html Apache License 2.0].  
+
DreamFactory is supported on Linux, Windows, and Mac OS X.
  
DreamFactory runs on Linux, Windows, and Mac OS X.  
+
Get started with DreamFactory by following the installation instructions below. To get started select an install method and platform below.
  
There are many ways to try out and use DreamFactory. Follow the installation instructions below.
+
== GitHub ==
  
== Minimum Requirements ==
+
You can install DreamFactory [https://github.com/dreamfactorysoftware/dreamfactory directly from GitHub].  
=== Manual (Github) Installs ===
+
We have provided platform specific instructions. If your desired platform is not available, you may need to modify the instructions presented herein.
For installing the latest version of DreamFactory from source (see Github below), you will need:
+
* PHP 5.6 or PHP 7
+
* The following php modules are also required for basic installation:
+
** curl
+
** mbstring
+
** zip
+
** sqlite
+
** mongodb
+
** Other modules/drivers will be required depending on which databases you intend to use.
+
* A web server application
+
** Nginx
+
** Apache
+
** IIS
+
* A database for managing the system.
+
** SQLite (requires no service installation, only the above PHP module)
+
** MySQL (MySQL/MariaDB/Percona)
+
** PostgreSQL
+
** Microsoft SQL Server
+
  
=== Bitnami Installs ===
+
=== Automated Installers ===
Bitnami lists the requirements for a native installer as such:
+
* Intel x86 or compatible processor
+
* Minimum of 512 MB RAM
+
* Minimum of 150 MB hard drive space
+
* TCP/IP protocol support
+
* One of the following compatible operating systems:
+
** A Linux operating system.
+
** A Windows operating system such as Windows Server 2008, Windows Server 2012, Vista, Windows 7, Windows 8 or Windows 10.
+
** An OS X operating system.
+
  
These requirements are subject to change, so be sure to check the [https://docs.bitnami.com/installer/windows-faq/#what-are-the-system-requirements-for-native-installers Bitnami Documentation] for the most up to date information.
+
Automated installers for CentOS, Debian, Fedora, and Ubuntu are included in the GitHub repository. You can learn more about these installers [https://github.com/dreamfactorysoftware/dreamfactory/tree/master/installers here]. These installers support both DreamFactory OSS and commercial versions.
  
== Free Hosted Developer Environment ==
+
=== Required Software and Extensions ===
  
Sign up for a free DreamFactory-hosted developer account at [http://www.dreamfactory.com 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.  
+
At a minimum, you will need the following software and extensions installed and enabled on your system in order to successfully clone and install DreamFactory.
  
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.
+
* PHP 7.4+ - check and install the requirements below for your particular environment.
 +
** [http://php.net/manual/en/migration71.php  PHP Migration guide ]
 +
** PHP required extensions: Curl, MBString, MongoDB, SQLite, and Zip. You may need to install other extensions depending upon DreamFactory usage requirements. If you don't plan on using MongoDB, please remove the <code>df-mongodb</code> requirement from <code>composer.json</code>, or include the <code>--ignore-platform-reqs</code> option when running composer install.
 +
* Git - see https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
 +
* A web server such as NGINX, Apache, or IIS. You may use PHP's built-in server for development purposes.
 +
* One of four databases for storing configuration data: MS SQL Server, MySQL (MariaDB or Percona are also supported), PostgreSQL, or SQLite.
 +
* Composer - see https://getcomposer.org/download/, may require cURL to be installed from particular environment below.
  
== Bitnami Desktop/Server Installers ==
 
  
=== Installation ===
+
Operating system-specific instructions are available which may be useful if you need assistance satisfying these requirements:
  
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
 +
** [[DreamFactory/APT|Mint, Debian or Ubuntu]]
 +
** [[DreamFactory/Yum|CentOS and RedHat]]
 +
* Mac
 +
** [[DreamFactory/OSX|Mac OS X 10.11+]]
 +
* Windows
 +
** [[DreamFactory/Installation/Windows|Server 2012, Server 2016, Windows 10]]
  
* [https://bitnami.com/stack/dreamfactory/installer#linux Linux] (CentOS, Red Hat, Mint, Debian, and Ubuntu desktop and server).
+
=== Installing and Configuring DreamFactory ===
* [https://bitnami.com/stack/dreamfactory/installer#osx Mac OS X].
+
* [https://bitnami.com/stack/dreamfactory/installer#windows 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 ==
+
We strongly recommend using our automated installers. You can learn more about the installer [https://github.com/dreamfactorysoftware/dreamfactory/tree/master/installers here]. If you'd like to install DreamFactory manually, use the instructions provided in this section. Keep in mind these instructions only pertain to installation of the DreamFactory software, and not to the installation of the many additional dependencies. Refer to the operating system-specific instructions found in this wiki for dependency-related details.
  
You can download DreamFactory as a [https://bitnami.com/stack/dreamfactory/virtual-machine virtual machine] for VMware, VirtualBox, or other hypervisor environments.
+
The commands shown below are primarily for a Linux/Unix-based operating system, but should also work on Windows (directory structure notwithstanding) provided all the required software and extensions are installed.
+
== Docker Image ==
+
  
You can build your own Docker [https://github.com/dreamfactorysoftware/df-docker/ image] or pull the latest [https://hub.docker.com/r/dreamfactorysoftware/df-docker/ Docker image from Docker Hub].
+
* Clone this repository to a directory on your system. For testing, using a directory under your home directory is easiest (and demonstrated here), otherwise choices like <code>/var/www/</code> or <code>/opt</code> may be preferred.
 +
<source lang=bash>$ git clone https://github.com/dreamfactorysoftware/dreamfactory.git ~/df2</source>
  
== IaaS Clouds ==
+
* Change your working path to that directory.
  
You can easily install DreamFactory on IaaS cloud platforms with Bitnami. Follow the instructions below:
+
<source lang=bash>$ cd ~/df2</source>
  
* [https://bitnami.com/stack/dreamfactory/cloud/amazon Amazon Web Services (AWS)] 
+
* Install dependencies using Composer. If you're installing DreamFactory for use in a production environment, include the <code>--no-dev</code> option to avoid installing development-specific packages.
* [https://bitnami.com/stack/dreamfactory/cloud/azure Microsoft Azure]
+
* [https://bitnami.com/stack/dreamfactory/cloud/google Google Cloud Platform]
+
* [https://bitnami.com/stack/dreamfactory/cloud/oracle Oracle Cloud Platform]
+
* [https://bitnami.com/stack/dreamfactory/cloud/centurylink CenturyLink]
+
* [https://bitnami.com/stack/dreamfactory/cloud/1and1 1&1 Cloud Platform]
+
* [https://www.dreamfactory.com/ibmcloudlanding IBM SoftLayer]
+
* [https://www.dreamfactory.com/rackspacelanding Rackspace]
+
  
== PaaS Clouds ==
+
<source lang=bash>$ composer install --no-dev</source>
  
You can install DreamFactory on PaaS cloud platforms (Platform as a Service). Follow the instructions below.
+
* Next, you'll want to run the following two setup-related commands:
  
* [[DreamFactory/Installation/OpenShift|Red Hat OpenShift]]
+
<source lang=bash>
* [https://www.dreamfactory.com/solutions/pivotal-web-services Pivotal Web Services]
+
$ php artisan df:env
* [https://www.dreamfactory.com/bluemixlanding IBM Bluemix]
+
$ php artisan df:setup
 +
</source>
  
== GitHub ==
+
* '''Note:''' In earlier versions of DreamFactory this command was named <code>dreamfactory:setup</code> or <code>df:setup</code>. As of DF 2.7.0 the command is changed to <code>df:env</code>
  
You can also install DreamFactory [https://github.com/dreamfactorysoftware/dreamfactory directly from GitHub]. Follow the general instructions after taking care of the requirements for your particular environment.
+
* Make sure your web server can read/write from/to the DreamFactory application's <code>storage</code> and <code>bootstrap/cache</code> directories. Unix/Linux and OSX users can use the <code>chown</code> and <code>chmod</code> commands to set these permissions:
  
''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.''
+
<source lang=bash>
 +
$ sudo chown -R {www user}:{your user group} storage/ bootstrap/cache/
 +
$ sudo chmod -R 2775 storage/ bootstrap/cache/
 +
</source>
  
=== Required Software and Extensions ===
+
=== Set Up a Web Server ===
  
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.
+
If you're just trying out DreamFactory, consider using PHP's built-in web server:
  
* PHP 5.5+ - check and install the requirements below for your particular environment.
+
<source lang=bash>$ php artisan serve</source>
** 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.
+
* [[DreamFactory/Installation/Databases/MongoDB|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 ====
+
Alternatively, you'll want to provision a web server by following these instructions:
  
* [[DreamFactory/Installation/Linux/Yum|CentOS or RedHat]]
+
==== Nginx ====
* [[DreamFactory/Installation/Linux/Apt|Mint, Debian or Ubuntu]]
+
  
==== Mac OS X ====
+
* [[DreamFactory/Installation/Linux/Apt#Web_Server|Debian/Mint/Ubuntu]]
 +
* [[DreamFactory/Installation/Linux/Yum#Web_Server|CentOS/RedHat]]
  
* Install v8js library
+
==== Apache ====
* 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 ====
+
* [[DreamFactory/Installation/Linux/Apt#Web_Server|Debian/Mint/Ubuntu]]
 +
* [[DreamFactory/Installation/Linux/Yum#Web_Server|CentOS/RedHat]]
  
==Installing Dreamfactory on Windows Server 2008 with IIS7==
+
=== Set Up a Database ===
<br>
+
'''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 [https://msdn.microsoft.com/en-us/library/ff648653.aspx hardening the web server and other security controls] which are outside the scope of these instructions.
+
<br>
+
===Install PHP for IIS===
+
<br>
+
Before beginning the installation download the '''Web Platform Installer''' for IIS [https://www.microsoft.com/web/downloads/platform.aspx here].
+
<br>
+
*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'''.
+
  
[[File:Screen_Shot_2016-07-01_at_2.40.44_PM.png|1000px]]
+
Additional drivers may be required if you plan on REST-enabling a database:
  
*Click '''Add''', then '''Install''' at the bottom. Follow the on screen prompts to accept the EULA to install PHP for IIS.
+
* [[DreamFactory/Installation/Databases/SQLite_Installation|SQLite]]
<br>
+
* [[DreamFactory/Installation/Databases/MySQL_Installation|MySQL, MariaDB, or Percona]]
 +
* [[DreamFactory/Installation/Databases/PostgreSQL_Installation|PostgreSQL]]
 +
* [[DreamFactory/Installation/Databases/SQLServer_as_a_System_Database|Microsoft SQL Server]]
 +
* [[DreamFactory/Installation/Databases/SQLAnywhere_Installation|SAP SQL Anywhere]]
  
===Setup PHP Module Mapping in IIS===
+
==== Switching Your System Database ====
<br>
+
Once PHP has been successfully installed, it must be set up in IIS7.
+
<br>
+
* 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'''.<br>
+
<br>
+
<nowiki> If the default handler mapping for PHP FastCGI isn't listed you will need to add it now:</nowiki>
+
*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:'''
+
| <nowiki>*.php</nowiki>
+
|-
+
| '''Module:'''
+
| FastCgiModule
+
|-
+
|'''Executable:'''
+
|<nowiki>"C:\Program Files(x86)\PHP\v5.6\php-cgi.exe"</nowiki>
+
|-
+
|'''Name:'''
+
|PHPviaFastCGI
+
|}
+
  
[[File:ModuleMappingPHPwin.png|500px]]
+
Your DreamFactory application manages many configuration details within an underlying database (four of which are supported: MySQL, MS SQL Server, PostgreSQL, and SQLite). If you want to change from one system database to another after you've already run setup/installation:
  
*Click '''OK''', then click '''Yes''' to confirm.
+
*Stop your web server
*Using Internet Information Services (IIS) Manager click on the server you are working with and click '''Restart''' from the actions pane.
+
*Edit the <code>.env</code> file found in the DreamFactory application's root directory to define the correct driver, host, and port number. For example:
<br>
+
===Test PHP for IIS===
+
<br>
+
To test PHP, we are going to create a php info file within the web root directory. Typically, this directory is located in:
+
<br><pre>C:\inetpub\wwwroot</pre>
+
*In the webroot directory, create an empty PHP file. At the top of file the type the following:
+
<syntaxhighlight lang="php"> <?php phpinfo();</syntaxhighlight>
+
*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:
+
  
[[File:Screen_Shot_2016-07-01_at_2.57.20_PM.png|500px]]
+
<source lang=bash>
 +
DB_CONNECTION=mysql
 +
DB_HOST=localhost
 +
DB_DATABASE=dreamfactory
 +
DB_USERNAME=dreamfactory
 +
DB_PASSWORD=dreamfactory
 +
DB_PORT=3306
 +
</source>
  
<br>
+
*In your shell navigate to the DreamFactory application's root directory.
*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.
+
*Run these commands:
 +
<source lang=bash>
 +
$ php artisan config:clear
 +
$ php artisan cache:clear
 +
$ php artisan df:setup
 +
</source>
 +
*Restart the web server
  
[[File:Winphpinfo.png|800px]]
+
== Docker Image ==
  
*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.
+
Two DreamFactory Docker images are available. The official image is maintained by our team and is available from [https://github.com/dreamfactorysoftware/df-docker/ df-docker repo on GitHub]. A second image is maintained by Bitnami, and is available on [https://hub.docker.com/r/dreamfactorysoftware/df-docker/ DockerHub].
*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.
+
<br>
+
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.
+
<br>
+
<br>
+
===Install Dreamfactory on IIS 7===
+
<br>
+
You will need to follow the [http://wiki.dreamfactory.com/DreamFactory/Installation#GitHub 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.
+
<br>
+
<br>
+
'''Note:'''If you plan on running [http://wiki.dreamfactory.com/DreamFactory/Installation/Databases/SQLServer 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.
+
<br>
+
*Next, open a command prompt, [https://msdn.microsoft.com/en-us/powershell/mt173057.aspx Power Shell], or [https://git-scm.com/download/win Windows Git Client]
+
*From the prompt, navigate to the directory you want to install Dreamfactory. Typically, this will be: <pre>C:\inetpub\wwwroot\</pre>
+
<br> However you can choose any location you want. We will add this as a site later in IIS. In this example, we're choosing: <pre>C:\inetpub\wwwroot\dreamfactory</pre>
+
<br>
+
*Perform a Git clone into this directory for Dreamfactory:
+
<syntaxhighlight lang="bash">git clone https://github.com/dreamfactorysoftware/dreamfactory</syntaxhighlight>
+
  
[[File:Wingitclone.png|500px]]  
+
If you don't want to use Bitnami, you can still build your own docker image using our [https://github.com/dreamfactorysoftware/df-docker/ df-docker repo on GitHub].
  
<br>
+
== PaaS Clouds ==
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:
+
<syntaxhighlight lang="bash">composer update—ignore-platform-reqs —no-dev</syntaxhighlight>
+
Otherwise run the following command to install the dependencies:
+
<syntaxhighlight lang="bash">composer install --no-dev</syntaxhighlight>
+
*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.
+
<syntaxhighlight lang="bash">php artisan dreamfactory:setup</syntaxhighlight>
+
<br>
+
Follow the on-screen prompts to complete the setup.
+
<br>
+
<br>
+
===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.
+
  
[[File:Screen Shot 2016-07-06 at 3.17.20 PM.png|500px]]
+
You can install DreamFactory on PaaS cloud platforms (Platform as a Service). Follow the instructions below.
  
<br>
+
* [[DreamFactory/Installation/OpenShift|Red Hat OpenShift]]
*Enter your Host name as well for your instance.
+
* [[DreamFactory/Installation/DreamFactory_Deployments_with_CloudFoundry|Pivotal using CloudFoundry]]
*Click '''OK''' to start the service.
+
* [[DreamFactory/Installation/DreamFactory_Deployments_with_CloudFoundry|IBM Bluemix using CloudFoundry]]
<br>
+
  
===Add URL Rewrite Rules to IIS===
+
== Raspberry Pi ==
<br>
+
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  <span style="color: red">X</span> icon. Click on that rule and it will be highlighted in the '''Rewrite Rules''' dialog box.
+
<br>
+
  
[[File:Redxruleremove.png|500px]]
+
You can install and configure DreamFactory on Raspberry Pi 2 as an open source IoT gateway. Follow the general instructions [[DreamFactory/Installation/RaspberryPi2|here]].
  
<br>
+
== Additional Drivers and Modules ==
*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.
+
<br>
+
===Ensure Dreamfactory Cache and Log Directories are Writable===
+
<br>
+
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/
+
<br>
+
Please ensure that the [https://support.microsoft.com/en-us/kb/313075 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==
+
* [[DreamFactory/Installation/Databases/Apache Cassandra_Installation|Apache Cassandra]]
 
+
* [[DreamFactory/Installation/Databases/IBM DB2_Features|IBM Db2]]
Install your native database and any additional drivers required for your database.
+
* [[DreamFactory/Installation/Databases/SQLite|SQLite]]
+
* [[DreamFactory/Installation/Databases/MySQL|MySQL, MariaDB, or Percona]]
+
* [[DreamFactory/Installation/Databases/PostgreSQL|PostgreSQL]]
+
 
* [[DreamFactory/Installation/Databases/SQLServer|Microsoft SQL Server]]
 
* [[DreamFactory/Installation/Databases/SQLServer|Microsoft SQL Server]]
* [[DreamFactory/Installation/Databases/SQLAnywhere|SAP SQL Anywhere]]
+
* [[DreamFactory/Installation/Databases/MySQL_Installation|MySQL, MariaDB, or Percona]]
 +
* [[DreamFactory/Installation/Databases/MongoDB_Installation|MongoDB]]
 +
* [[DreamFactory/Installation/Modules/Node.js|Node.js]]
 +
* [[DreamFactory/Installation/Databases/Oracle DB_Installation|Oracle Database]]
 +
* [[DreamFactory/Installation/Databases/PostgreSQL_Installation|PostgreSQL]]
 +
* [[DreamFactory/Installation/Databases/SQLAnywhere_Installation|SAP SQL Anywhere]]
 +
* [[DreamFactory/Installation/Databases/SQLite_Installation|SQLite]]
 +
* [[DreamFactory/Installation/Modules/v8js_Installation|v8js]]
 +
 
 +
== Installing DreamFactory Behind a Proxy ==
 +
 
 +
The DreamFactory installers rely upon several package managers to install not only the core platform software but also an array of dependencies critical to both the platform itself and the underlying operating system. In addition to using the Linux operating system's native installer (e.g. apt, yum, etc), examples of required third-party package managers and installation helpers include:
 +
 
 +
* [https://curl.se/ curl]
 +
* [https://pypi.org/project/pip/ pip]
 +
* [https://pear.php.net/manual/en/installation.getting.php pear]
 +
 
 +
The installer scripts also reach out to GitHub to clone the DreamFactory OSS version (which can be upgraded to a commercial version as part of the installation process). Therefore, if you're running the server behind a proxy, you'll need to take some additional steps to account for the network restrictions, notably informing each package manager and installation helper of the proxy requirement.
 +
 
 +
=== Configuring curl ===
 +
 
 +
Create a file named <code>.curlrc</code> and add the following line to it:
  
==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:
 
 
<source lang=bash>
 
<source lang=bash>
DB_DRIVER=mysql
+
proxy = 123.456.789:port
DB_HOST=localhost
+
DB_DATABASE=dreamfactory
+
DB_USERNAME=dreamfactory
+
DB_PASSWORD=dreamfactory
+
DB_PORT=3306
+
 
</source>
 
</source>
*In your shell navigate to the dreamfactory root folder (htdocs in Bitnami installs)
 
*Run these commands:
 
<source lang=bash>
 
$ php artisan config:clear
 
$ php artisan cache:clear
 
$ php artisan dreamfactory:setup
 
//Answer the on screen prompts
 
</source>
 
*Restart Apache
 
  
=== General Instructions ===
+
=== PECL/PEAR ===
  
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.
+
Modify the installation script to include this line *after* PEAR and PECL have been 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.
+
<source lang=bash>
<source lang=bash>$ git clone https://github.com/dreamfactorysoftware/dreamfactory.git ~/df2</source>
+
pear config-set http_proxy http://123.456.789:port
 +
</source>
  
* Change your working path to that directory.
+
=== PIP ===
<source lang=bash>$ cd ~/df2</source>
+
  
* Install dependencies using composer. For production environment, use --no-dev, otherwise discard that option for a development environment.
+
Create the file <code>~/.config/pip/pip.conf</code> and add this to it:
<source lang=bash>$ composer install --no-dev</source>
+
  
* 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.
+
<source lang=bash>
<source lang=bash>$ php artisan dreamfactory:setup</source>
+
[global]
 +
proxy = http://123.456.789:port
 +
</source>
  
* Make sure your web server can read/write from/to storage/ (sub directories) and bootstrap/cache/ directories.
+
=== GitHub ===
+
 
Example:
+
Add the following code to your <code>~/.git/config</code> file:
  
 
<source lang=bash>
 
<source lang=bash>
$ sudo chown -R {www user}:{your user group} storage/ bootstrap/cache/
+
[http]
$ sudo chmod -R 2775 storage/ bootstrap/cache/
+
proxy = http://123.456.789:port
 
</source>
 
</source>
  
=== Set Up a Web Server ===
+
=== RPM ===
  
Use PHP's built in web server (**Note**: Testing only, not for production use!)
+
If your operating system uses the RPM package manager, you'll need to modify <code>rpm</code> statements to include the <code>--httpproxy</code> flag. For example:
<source lang=bash>$ php artisan serve</source>
+
  
Or provision a web server to run your DreamFactory instance by following these instructions:
+
<source lang=bash>
 +
sudo rpm --httpproxy http://123.456.789:port -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
 +
</source>
  
==== Nginx ====
+
== Troubleshooting ==
  
* [[DreamFactory/Installation/Linux/Apt#Web_Server|Debian/Mint/Ubuntu]]
+
If you receive the below error please follow these instructions.
* [[DreamFactory/Installation/Linux/Yum#Web_Server|CentOS/RedHat]]
+
  
==== Apache ====
+
<source lang=bash>
 +
GitHub API limit (60 calls/hr) is exhausted, could not fetch https://api.github.com/repos/dreamfactorysoftware/df-adldap. Create a GitHub OAuth token to go over the API rate limit. You can also wait until XXXX-XX-XX XX:XX:XX for the rate limit to reset.
  
* [[DreamFactory/Installation/Linux/Apt#Web_Server|Debian/Mint/Ubuntu]]
+
Head to https://github.com/settings/tokens/new?scopes=repo&description=Composer to retrieve a token. It will be stored in "/root/.composer/auth.json" for future use by Composer.
* [[DreamFactory/Installation/Linux/Yum#Web_Server|CentOS/RedHat]]
+
</source>
  
== Raspberry Pi 2 ==
+
First you will want to create a GitHub access token like so: https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line
  
You can install and configure DreamFactory on Raspberry Pi 2 as an open source IoT gateway. Follow the general instructions [[DreamFactory/Installation/RaspberryPi2|here]].
+
After creating the access token and applying it via the command line, configure Composer to use your personal access token: https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line
 
+
== Additional Drivers and Modules ==
+
* [[DreamFactory/Installation/Databases/SQLite|SQLite]]
+
* [[DreamFactory/Installation/Databases/MySQL|MySQL, MariaDB, or Percona]]
+
* [[DreamFactory/Installation/Databases/PostgreSQL|PostgreSQL]]
+
* [[DreamFactory/Installation/Databases/SQLServer|Microsoft SQL Server]]
+
* [[DreamFactory/Installation/Databases/Oracle_DB|Oracle Database]]
+
* [[DreamFactory/Installation/Databases/IBM_DB2|IBM DB2]]
+
* [[DreamFactory/Installation/Databases/SQLAnywhere|SAP SQL Anywhere]]
+
* [[DreamFactory/Installation/Databases/MongoDB|MongoDB]]
+
* [[DreamFactory/Installation/Databases/Apache_Cassandra|Apache Cassandra]]
+
* [[DreamFactory/Installation/Modules/v8js|v8js]]
+
* [[DreamFactory/Installation/Modules/Node.js|Node.js]]
+

Latest revision as of 07:55, 7 May 2024

DreamFactory is supported on Linux, Windows, and Mac OS X.

Get started with DreamFactory by following the installation instructions below. To get started select an install method and platform below.

GitHub

You can install DreamFactory directly from GitHub. We have provided platform specific instructions. If your desired platform is not available, you may need to modify the instructions presented herein.

Automated Installers

Automated installers for CentOS, Debian, Fedora, and Ubuntu are included in the GitHub repository. You can learn more about these installers here. These installers support both DreamFactory OSS and commercial versions.

Required Software and Extensions

At a minimum, you will need the following software and extensions installed and enabled on your system in order to successfully clone and install DreamFactory.

  • PHP 7.4+ - check and install the requirements below for your particular environment.
    • PHP Migration guide
    • PHP required extensions: Curl, MBString, MongoDB, SQLite, and Zip. You may need to install other extensions depending upon DreamFactory usage requirements. If you don't plan on using MongoDB, please remove the df-mongodb requirement from composer.json, or include the --ignore-platform-reqs option when running composer install.
  • Git - see https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
  • A web server such as NGINX, Apache, or IIS. You may use PHP's built-in server for development purposes.
  • One of four databases for storing configuration data: MS SQL Server, MySQL (MariaDB or Percona are also supported), PostgreSQL, or SQLite.
  • Composer - see https://getcomposer.org/download/, may require cURL to be installed from particular environment below.


Operating system-specific instructions are available which may be useful if you need assistance satisfying these requirements:

Installing and Configuring DreamFactory

We strongly recommend using our automated installers. You can learn more about the installer here. If you'd like to install DreamFactory manually, use the instructions provided in this section. Keep in mind these instructions only pertain to installation of the DreamFactory software, and not to the installation of the many additional dependencies. Refer to the operating system-specific instructions found in this wiki for dependency-related details.

The commands shown below are primarily for a Linux/Unix-based operating system, but should also work on Windows (directory structure notwithstanding) provided all the required software and extensions are installed.

  • Clone this repository to a directory on your system. For testing, using a directory under your home directory is easiest (and demonstrated here), 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. If you're installing DreamFactory for use in a production environment, include the --no-dev option to avoid installing development-specific packages.
$ composer install --no-dev
  • Next, you'll want to run the following two setup-related commands:
$ php artisan df:env
$ php artisan df:setup
  • Note: In earlier versions of DreamFactory this command was named dreamfactory:setup or df:setup. As of DF 2.7.0 the command is changed to df:env
  • Make sure your web server can read/write from/to the DreamFactory application's storage and bootstrap/cache directories. Unix/Linux and OSX users can use the chown and chmod commands to set these permissions:
$ sudo chown -R {www user}:{your user group} storage/ bootstrap/cache/
$ sudo chmod -R 2775 storage/ bootstrap/cache/

Set Up a Web Server

If you're just trying out DreamFactory, consider using PHP's built-in web server:

$ php artisan serve

Alternatively, you'll want to provision a web server by following these instructions:

Nginx

Apache

Set Up a Database

Additional drivers may be required if you plan on REST-enabling a database:

Switching Your System Database

Your DreamFactory application manages many configuration details within an underlying database (four of which are supported: MySQL, MS SQL Server, PostgreSQL, and SQLite). If you want to change from one system database to another after you've already run setup/installation:

  • Stop your web server
  • Edit the .env file found in the DreamFactory application's root directory to define the correct driver, host, and port number. For example:
DB_CONNECTION=mysql
DB_HOST=localhost
DB_DATABASE=dreamfactory
DB_USERNAME=dreamfactory
DB_PASSWORD=dreamfactory
DB_PORT=3306
  • In your shell navigate to the DreamFactory application's root directory.
  • Run these commands:
$ php artisan config:clear
$ php artisan cache:clear
$ php artisan df:setup
  • Restart the web server

Docker Image

Two DreamFactory Docker images are available. The official image is maintained by our team and is available from df-docker repo on GitHub. A second image is maintained by Bitnami, and is available on DockerHub.

If you don't want to use Bitnami, you can still build your own docker image using our df-docker repo on GitHub.

PaaS Clouds

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

Raspberry Pi

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

Installing DreamFactory Behind a Proxy

The DreamFactory installers rely upon several package managers to install not only the core platform software but also an array of dependencies critical to both the platform itself and the underlying operating system. In addition to using the Linux operating system's native installer (e.g. apt, yum, etc), examples of required third-party package managers and installation helpers include:

The installer scripts also reach out to GitHub to clone the DreamFactory OSS version (which can be upgraded to a commercial version as part of the installation process). Therefore, if you're running the server behind a proxy, you'll need to take some additional steps to account for the network restrictions, notably informing each package manager and installation helper of the proxy requirement.

Configuring curl

Create a file named .curlrc and add the following line to it:

proxy = 123.456.789:port

PECL/PEAR

Modify the installation script to include this line *after* PEAR and PECL have been installed:

pear config-set http_proxy http://123.456.789:port

PIP

Create the file ~/.config/pip/pip.conf and add this to it:

[global]
proxy = http://123.456.789:port

GitHub

Add the following code to your ~/.git/config file:

[http]
proxy = http://123.456.789:port

RPM

If your operating system uses the RPM package manager, you'll need to modify rpm statements to include the --httpproxy flag. For example:

sudo rpm --httpproxy http://123.456.789:port -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

Troubleshooting

If you receive the below error please follow these instructions.

GitHub API limit (60 calls/hr) is exhausted, could not fetch https://api.github.com/repos/dreamfactorysoftware/df-adldap. Create a GitHub OAuth token to go over the API rate limit. You can also wait until XXXX-XX-XX XX:XX:XX for the rate limit to reset.
 
Head to https://github.com/settings/tokens/new?scopes=repo&description=Composer to retrieve a token. It will be stored in "/root/.composer/auth.json" for future use by Composer.

First you will want to create a GitHub access token like so: https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line

After creating the access token and applying it via the command line, configure Composer to use your personal access token: https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line