If you've cloned the GitHub repository, you'll need to carry out a few additional steps before launching your DreamFactory instance. The first step involves ensuring your server requirements have been met. Let's tackle those first, followed by an overview of software installation.
- Bitnami Dreamfactory Download
- Bitnami-docker-dreamfactory
- Dreamfactory Bitnami Default Login
- Bitnami Dreamfactory
Bitnami DreamFactory Stack for Microsoft Azure DreamFactory is an API management gateway. It’s capable of generating powerful, documented APIs for almost twenty databases, file storage, caching, e-mail, 3rd party APIs and SOAP services.
DreamFactory is an API management gateway. It's capable of generating powerful, documented APIs for almost twenty databases including Microsoft SQL Server, in addition to file storage, caching, e-mail, 3rd party APIs and SOAP services. # Installing and Configuring DreamFactory from Source If you've cloned the GitHub repository, you'll need to carry out a few additional steps before launching your DreamFactory instance. The first step involves ensuring your server requirements have been met. If you're using DreamFactory's commercial Bitnami edition and would like to configure Oracle, follow these instructions: Configuring Oracle with Bitnami # Cloud Images. Cloud environments are the hosting solution of choice these days, and for good reason. Cloud service providers offer unsurpassed levels of stability, performance, and security.
# Configuring Your Server
WARNING
This guide is under heavy development, and certain parts are incomplete. We suggest reading through the current installation documentation, available here.
Server configuration is going to vary according to your operating system. To ensure the instructions are as specific and straightforward as possible, we've broken them out into subchapters:
If you plan on using PHP in conjunction with one of the following databases, please review the pertinent subchapters presented below:
# Server Hardware Requirements
DreamFactory is surprisingly performant even under minimally provisioned servers, you'll want to install DreamFactory on a 64-bit server with at least 4GB RAM. If you're planning on hosting the system database on the same server as DreamFactory, then we recommend at least 8GB RAM. This server will house not only the operating system and DreamFactory, but also a web server such as Nginx (recommended) or Apache, and PHP-FPM. Keep in mind these are the minimum RAM requirements; many customers can and do run DreamFactory in far larger production environments.
Bitnami Dreamfactory Download
Under heavier loads you'll want to load balance DreamFactory across multiple servers, and take advantage of a shared caching (Redis or Memcached are typically used) and database layer (which houses the system database).
Cloud Environment | Minimum Server |
---|---|
AWS | t2.large |
Azure | D2 v3 |
Oracle Cloud | VM.Standard.E2.1 |
Digital Ocean | Standard 8/160/5 |
Google Cloud | n1-standard-2 |
Although DreamFactory can run on Windows Server and IIS, we recommend instead using a popular Linux distribution such as Ubuntu, Debian, or CentOS in order to take advantage of our automated installers targeting those specific operating systems.
Prior to launching your project, we recommend thoroughly testing your APIs under estimated production loads using a tool such as loader.io.
# Installing DreamFactory
The first step involves installing the required PHP packages using Composer:
The --no-dev
option tells Composer to not install the development-specific dependencies. These development dependencies are used by our OSS community and internal developers alike to assist in software development. You can review the list of both required and developmental dependencies by opening the composer.json
file found in the project's root directory.
If you receive an error regarding Your requirements could not be resolved to an installable set of packages
, and you don't require MongoDB, then you can quickly hurdle the issue by additionally supplying the --ignore-platform-reqs
option when running Composer.
With the packages installed, you'll next need to configure your system database. This database will house various configuration settings associated with your instance. DreamFactory supports four databases for this purpose, including Microsoft SQL Server, MySQL, PostgreSQL, and SQLite. Keep in mind you'll need to first create this database along with an account DreamFactory will use to connect to it.
You'll configure the system database by running a terminal command and answering a few prompts about your database configuration.
To do so, run the following command from inside your project's root directory:
With the system database configured, it's time to create the system tables and seed data and then create your first system administrator account. This is accomplished by running the df:setup
command. Because multiple prompts are involved with this command, I'll break the command output into a few parts. Immediately after running df:setup
, the command will create the database tables and seed data:
Next you'll be prompted to create your first system administration account:
Finally, you'll be prompted to make sure your application's storage
and bootstrap/cache
directories are properly configured. This involves making sure the directory ownership and permissions are properly set using the chown
and chmod
commands:
The {www user}
string is a placeholder for the owner of your web server daemon owner. The {your user group}
string is a placeholder for the web server group daemon owner.
Immediately following this prompt you'll be informed of successful setup:
If you've installed and configured DreamFactory to run on a web server, then you can open your browser and navigate to the IP address or domain name. Otherwise, if you haven't yet installed a web server, you can run php artisan serve
:
This will start a simple PHP server running on 127.0.0.1
port 8000
. Open your browser and navigate to http://127.0.0.1:8000
and you should see the following screen:
# Introducing the .env File
It is often helpful to have different configuration values based on the environment where the application is running. For example, you may wish to use a different cache driver locally than you do on your production server.
To make this a cinch, Laravel utilizes the DotEnv PHP library by Vance Lucas. In a fresh Laravel installation, the root directory of your application will contain a .env.example
file. If you install Laravel via Composer, this file will automatically be renamed to .env
. Otherwise, you should rename the file manually. For more information, please see the official documentation from Laravel.
# Enabling Debugging and Logging
By default, DreamFactory does not enable debugging. Debugging, while a great tool to help monitor your application, can be a large performance sink inside of a production environment. In the example .env
file below you can see where these options live.
When working to get your environment up and running, DreamFactory recommends turning debugging on, as well as increasing the sensitivity of the logging environment. In order to turn the application debugging on, please uncomment and change the following value:
To modify your logging values you will need to uncomment and modify the following snippets of code:
# Enabling Email Registration
When creating new users and admins it is not ideal nor secure to manually set a password for each one. You can instead enable email registration which will allow you to instead send e-mail invitations by checking the Send email invite
option. This will send an email invite to the new user containing a link to your instance and allow them to set a password.
To enable e-mail support, you will need to add the below lines to your .env
file and then you can send new users registration notifications!
Keep in mind smtp
is but one of several available delivery options.
# Increasing Your Session Lifetime
For security reasons DreamFactory sessions are limited to 60 minutes. You can however change the lifetime to any desired duration by opening your .env
file and finding the following variable:
Change DF_JWT_TTL
to any duration you please, defined in minutes. For instance, the following settings will persist your session for a week:
# Updating Your DreamFactory Docker Environment
Our DreamFactory environment is still a work-in-progress, however many users are actively using it thanks to Docker's streamlined configuration and deployment capabilities. Occasionally you'll want to update to a newer version of DreamFactory so we've assembled the following instructions as a guide.
WARNING
You are presumably reading this section with the intention of upgrading a DreamFactory production environment. As with any software, things can and do go wrong with upgrading production environments, and therefore you are urged to possess a readily accessible file and system database backup and recovery plan before attempting an upgrade. You have been warned!
Begin by opening a terminal and entering your DreamFactory instance's root directory. Then execute this command:
A couple of lines of output will be returned, however you should only copy the line beginning with APP_KEY
into a text file. Keep in mind at a minimum you'll need to copy down the APP_KEY
value. If you've overridden other defaults, such as the type, location, and credentials associated with the system database, you'll need to copy those too. It is very important you perform this step otherwise you'll run into all sorts of upgrade-related issues.
Next, run the following command:
This displays all of the tagged versions. Begin by stopping the running DreamFactory container without deleting it. Keep in mind that when you run this command, your DreamFactory instance will go offline until the upgrade process is completed:
Bitnami-docker-dreamfactory
For the purposes of this example we'll presume you're running 2.12 and want to upgrade to 2.14.1. To do so you'll first want to checkout the 2.14.1 tag:
Next, you'll need to add that APP_KEY
to the docker-compose.yml
file. Open docker-compose.yml
in your code editor, scroll down to the web
service, and add the APP_KEY
property and associated value alongside the other environment variables:
WARNING
It is crucial that you encapsulate the APP_KEY
value within single quotes, and additionally escape with a backslash any forward slashes appearing in your key! As an example, compare the APP_KEY
entry found above with the output displayed earlier.
Save these changes, and then rebuild your container using the following command:
Once complete, you can run the following command to confirm the containers are up and running:
If something has gone wrong, and one of the containers indicates it has exited, you can view the logs for that container:
Presuming the containers are up and running, you'll next want to determine whether the DreamFactory system database schema has changed. To do so run this command:
If you see Y
in the tabular output's Ran?
column, then the schema has not changed. If you see N
at any point, then you'll need to run the following command to update your system database schema:
Finally, you'll want to clear your application and configuration caches by executing the following commands:
With that done, open your DreamFactory instance in the browser, and confirm the environment is operational.
Dreamfactory Bitnami Default Login
Hi,
Just recently setup Dreamfactory 2.0 in AWS using Bitnami. I have setup my service for my AWS RDS which works well when access data through Data tab.
Bitnami Dreamfactory
So I wanted to test the API using Advanced Rest Client in Google Chrome. I was able to authenticate fine. I got my Session Token. Now when I try to do an HTTP GET (http://url/api/v2/mydb/_table/my_table) using the API Key and Session Token for headers X-DreamFactory-Application-Name and X-DreamFactory-Session-Token respectively, I am getting the following error:
{“error”:{“context”:null,“message”:“Access Forbidden.”,“code”:403,“trace”:[“0 [internal function]: DreamFactoryHttpMiddlewareAccessCheck->handle(Object(IlluminateHttpRequest), Object(Closure))”,“1 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9545): call_user_func_array(Array, Array)”,“2 [internal function]: IlluminatePipelinePipeline->IlluminatePipeline{closure}(Object(IlluminateHttpRequest))”,“3 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9535): call_user_func(Object(Closure), Object(IlluminateHttpRequest))”,“4 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(8892): IlluminatePipelinePipeline->then(Object(Closure))”,“5 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(8877): IlluminateRoutingControllerDispatcher->callWithinStack(Object(DreamFactoryHttpControllersRestController), Object(IlluminateRoutingRoute), Object(IlluminateHttpRequest), ‘handleGET’)”,“6 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(7831): IlluminateRoutingControllerDispatcher->dispatch(Object(IlluminateRoutingRoute), Object(IlluminateHttpRequest), ‘DreamFactoryHt…’, ‘handleGET’)”,“7 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(7802): IlluminateRoutingRoute->runWithCustomDispatcher(Object(IlluminateHttpRequest))”,“8 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(7455): IlluminateRoutingRoute->run(Object(IlluminateHttpRequest))”,“9 [internal function]: IlluminateRoutingRouter->IlluminateRouting{closure}(Object(IlluminateHttpRequest))”,“10 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9553): call_user_func(Object(Closure), Object(IlluminateHttpRequest))”,“11 [internal function]: IlluminatePipelinePipeline->IlluminatePipeline{closure}(Object(IlluminateHttpRequest))”,“12 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9535): call_user_func(Object(Closure), Object(IlluminateHttpRequest))”,“13 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(7456): IlluminatePipelinePipeline->then(Object(Closure))”,“14 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(7444): IlluminateRoutingRouter->runRouteWithinStack(Object(IlluminateRoutingRoute), Object(IlluminateHttpRequest))”,“15 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(7429): IlluminateRoutingRouter->dispatchToRoute(Object(IlluminateHttpRequest))”,“16 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(2304): IlluminateRoutingRouter->dispatch(Object(IlluminateHttpRequest))”,“17 [internal function]: IlluminateFoundationHttpKernel->IlluminateFoundationHttp{closure}(Object(IlluminateHttpRequest))”,“18 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9553): call_user_func(Object(Closure), Object(IlluminateHttpRequest))”,“19 /opt/bitnami/apps/dreamfactory/htdocs/vendor/barryvdh/laravel-cors/src/HandleCors.php(43): IlluminatePipelinePipeline->IlluminatePipeline{closure}(Object(IlluminateHttpRequest))”,“20 [internal function]: BarryvdhCorsHandleCors->handle(Object(IlluminateHttpRequest), Object(Closure))”,“21 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9545): call_user_func_array(Array, Array)”,“22 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(17932): IlluminatePipelinePipeline->IlluminatePipeline{closure}(Object(IlluminateHttpRequest))”,“23 [internal function]: DreamFactoryHttpMiddlewareFirstUserCheck->handle(Object(IlluminateHttpRequest), Object(Closure))”,“24 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9545): call_user_func_array(Array, Array)”,“25 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(12881): IlluminatePipelinePipeline->IlluminatePipeline{closure}(Object(IlluminateHttpRequest))”,“26 [internal function]: IlluminateViewMiddlewareShareErrorsFromSession->handle(Object(IlluminateHttpRequest), Object(Closure))”,“27 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9545): call_user_func_array(Array, Array)”,“28 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(11504): IlluminatePipelinePipeline->IlluminatePipeline{closure}(Object(IlluminateHttpRequest))”,“29 [internal function]: IlluminateSessionMiddlewareStartSession->handle(Object(IlluminateHttpRequest), Object(Closure))”,“30 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9545): call_user_func_array(Array, Array)”,“31 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(12622): IlluminatePipelinePipeline->IlluminatePipeline{closure}(Object(IlluminateHttpRequest))”,“32 [internal function]: IlluminateCookieMiddlewareAddQueuedCookiesToResponse->handle(Object(IlluminateHttpRequest), Object(Closure))”,“33 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9545): call_user_func_array(Array, Array)”,“34 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(12561): IlluminatePipelinePipeline->IlluminatePipeline{closure}(Object(IlluminateHttpRequest))”,“35 [internal function]: IlluminateCookieMiddlewareEncryptCookies->handle(Object(IlluminateHttpRequest), Object(Closure))”,“36 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9545): call_user_func_array(Array, Array)”,“37 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(2978): IlluminatePipelinePipeline->IlluminatePipeline{closure}(Object(IlluminateHttpRequest))”,“38 [internal function]: IlluminateFoundationHttpMiddlewareCheckForMaintenanceMode->handle(Object(IlluminateHttpRequest), Object(Closure))”,“39 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9545): call_user_func_array(Array, Array)”,“40 [internal function]: IlluminatePipelinePipeline->IlluminatePipeline{closure}(Object(IlluminateHttpRequest))”,“41 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9535): call_user_func(Object(Closure), Object(IlluminateHttpRequest))”,“42 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(2251): IlluminatePipelinePipeline->then(Object(Closure))”,“43 /opt/bitnami/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(2234): IlluminateFoundationHttpKernel->sendRequestThroughRouter(Object(IlluminateHttpRequest))”,“44 /opt/bitnami/apps/dreamfactory/htdocs/public/index.php(53): IlluminateFoundationHttpKernel->handle(Object(IlluminateHttpRequest))”,“45 {main}”]}}
I have my role setup with access to All services and All methods. I have assigned this role to my user and application. However, I still get this error.
Is there anything I missed?
Regards,
Allen