Install DreamFactory in Digital Ocean droplet
14.257 views
From the DreamFactory web page:
The DreamFactory Services Platform (DSP) has all of the services and capabilities you need to build cutting edge applications for the desktop, tablet, or phone. All of your services are accessed through a REST interface that supports both JSON and XML documents. This style of document exchange interface is perfect for HTML5 applications or native client technologies like iOS.
Intro
We can use an existent Digital Ocean Droplet or create a new droplet using this guide: How To Create Your First DigitalOcean Droplet Virtual Server This guide is based in an Ubuntu (13.10 x64) droplet.
Prerequisites
We’ll prepare our new virtual server. Connect via ssh to our virtual server and install the needed software.
LAMP
sudo tasksel
Select LAMP Server
and Ok
:
Create a new MySQL password («mypassword») and write down for future use.
Install git
sudo apt-get install git
Install Other Software
sudo apt-get install curl libcurl3 libcurl3-dev php5-curl
sudo apt-get install php5-json
Activate Apache mod_rewrite
sudo a2enmod rewrite
Configure PHP Timezone
Edit our php.ini
for specify timezone:
sudo nano /etc/php5/apache2/php.ini
In [Date]
section, add your timezone (PHP Timezones here)
[Date]
date.timezone = Europe/Madrid
Install and configure PHP mcrypt extension
Install mcrypt for php:
sudo apt-get install php5-mcrypt
Edit php.ini
:
sudo nano /etc/php5/apache2/php.ini
Add line for activate mcrypt extension:
extension = mcrypt.so
Prepare MySQL
We must create a database and user for DreamFactory in our MySQL. Connect MySQL with the password previously annoted:
mysql -u root -pmypassword
In the MySQL console:
mysql> CREATE DATABASE dreamfactory;
mysql> GRANT ALL PRIVILEGES ON dreamfactory.* TO 'dsp_user'@'localhost' IDENTIFIED BY 'dsp_user' WITH GRANT OPTION;
mysql> exit;
Install DreamFactory
Clone DreamFactory in our web server:
cd /var/www
git clone https://github.com/dreamfactorysoftware/dsp-core.git
Install DreamFactory:
cd dsp-core
sudo ./scripts/installer.sh -v
Configure apache
sudo nano /etc/apache2/sites-available/dreamfactory.conf
Copy this configuration in the file dreamfactory.conf
:
<VirtualHost *:80>
ServerName MYHOSTNAME_OR_IP
# ServerAlias your_dsp.domain.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/dsp-core/web
<Directory /var/www/dsp-core/web>
Options -Indexes +FollowSymLinks -MultiViews
AllowOverride None
###
### Using an .htaccess file slows down your DSP. So the settings are here.
### If this is not accessible to you, just copy the docs/apache/htaccess.dist
### file to your web/.htaccess. edit accordingly. Be sure to comment out the
### section below if you do this.
###
### BEGIN: .htaccess inline
RewriteEngine on
RewriteBase /
# Force login to be SSL
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^(.+)\.MYHOSTNAME_OR_IP$ [NC]
RewriteRule ^/?web/login/?(.*) https://MYHOSTNAME_OR_IP/web/login/$1 [R,L]
# if ack directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward it to index.php
RewriteRule ^.*$ /index.php [L]
### END: .htaccess inline ###
<LimitExcept GET HEAD PUT DELETE PATCH POST>
Allow from all
</LimitExcept>
</Directory>
ErrorLog ${APACHE_LOG_DIR}/dsp.error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/dsp.access.log combined
</VirtualHost>
Activate the DreamFactory web and deactivate default virtual host for apache:
cd /etc/apache2/sites-enabled/
root@ubu-df:/etc/apache2/sites-enabled# sudo rm 000-default.conf
root@ubu-df:/etc/apache2/sites-enabled# ln -s ../sites-available/dreamfactory.conf
Restart apache:
sudo service apache2 restart
Test installation and start using DreamFactory
Now, we can access http://MYHOSTNAME_OR_IP and see the welcome screen for DreamFactory:
Click «Skip». In the next screen, if you don’t see the «Create» button, you can zoom out the page (scroll doesn’t work…). Fill in all data and click «Create».
In the Register screen, click «Skip».
Finally, we can view DreamFactory dashboard in our Digital Ocean Virtual Server.
Written with StackEdit.