How VPS - How to use/setup VPS
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
How VPS - How to use/setup VPS
No Result
View All Result
Home Operating System CentOS

How to Install DreamFactory Open Source on CentOS 7

How VPS by How VPS
October 1, 2019
in CentOS
0
0
SHARES
13
VIEWS
Share on FacebookShare on Twitter

Contents

  1. Prerequisites
  2. Step 1: Update the system
  3. Step 2: Install Apache
  4. Step 3: Install MariaDB
    1. 3.1 Setup the MariaDB 10.1 YUM repo
    2. 3.2 Install MariaDB 10.1 using YUM
    3. 3.3 Start and enable the MariaDB service
    4. 3.4 Secure the installation of MariaDB
    5. 3.5 Create a MariaDB database for DreamFactory
  5. Step 4: Install PHP 7.x and Composer
    1. 4.1 Install PHP 7.1 and necessary extensions
    2. 4.2 Install Composer
    3. 4.3 Make Composer globally available
  6. Step 5: Install Git and DreamFactory
    1. 5.1 Install Git
    2. 5.2 Install DreamFactory
    3. 5.3 Prepare for web access
  7. Step 6: Access DreamFactory
  8. Want to contribute?


DreamFactory is an open source program which can turn any database into a RESTful API platform.

DreamFactory can be deployed on various platforms. In this article, we will be installing DreamFactory Open Source Edition on a CentOS 7 server.

Prerequisites

  • A CentOS 7 x64 server instance.
  • A sudo user.

Step 1: Update the system

Log into your system as a sudo user from an SSH terminal, and then update the system as follows:

sudo yum install epel-release -y
sudo yum update -y
sudo shutdown -r now

Step 2: Install Apache

As required by DreamFactory, you need to install the Apache web server using YUM:

sudo yum install httpd -y

Remove the default Apache welcome page:

sudo sed -i 's/^/#&/g' /etc/httpd/conf.d/welcome.conf

Disable Apache’s public directory and file listing:

sudo sed -i "s/Options Indexes FollowSymLinks/Options FollowSymLinks/" /etc/httpd/conf/httpd.conf

Start the Apache service and enable it on system boot:

sudo systemctl start httpd.service
sudo systemctl enable httpd.service

Step 3: Install MariaDB

For this tutorial, we will be using MariaDB 10.1 as the database server DreamFactory will be using.

3.1 Setup the MariaDB 10.1 YUM repo

Use the following code segment to create the MariaDB 10.1 YUM repo:

cat <<EOF | sudo tee -a /etc/yum.repos.d/MariaDB.repo
# MariaDB 10.1 CentOS repository list - created 2017-01-14 03:11 UTC
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.1/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
EOF

3.2 Install MariaDB 10.1 using YUM

sudo yum install MariaDB-server MariaDB-client -y

3.3 Start and enable the MariaDB service

sudo systemctl start mariadb.service
sudo systemctl enable mariadb.service

3.4 Secure the installation of MariaDB

sudo /usr/bin/mysql_secure_installation

Answer questions as follows, and be sure to enter your own MariaDB root password.

  • Enter current password for root (enter for none): Just press the Enter button
  • Set root password? [Y/n]: Y
  • New password: <your-password>
  • Re-enter new password: <your-password>
  • Remove anonymous users? [Y/n]: Y
  • Disallow root login remotely? [Y/n]: Y
  • Remove test database and access to it? [Y/n]: Y
  • Reload privilege tables now? [Y/n]: Y

3.5 Create a MariaDB database for DreamFactory

Log into the MySQL shell as root:

mysql -u root -p

Enter the MariaDB root password you set in step 3.4 in order to log in.

In the MySQL shell, create a database dreamfactory, a database user dreamfactoryuser, and its password yourpassword as follows.

Note: For security purposes, you MUST replace the three sample parameters mentioned above with your own ones.

CREATE DATABASE dreamfactory;
CREATE USER 'dreamfactoryuser'@'localhost' IDENTIFIED BY 'yourpassword';
GRANT ALL PRIVILEGES ON dreamfactory.* TO 'dreamfactoryuser'@'localhost' IDENTIFIED BY 'yourpassword' WITH GRANT OPTION;
FLUSH PRIVILEGES;
EXIT;

Step 4: Install PHP 7.x and Composer

4.1 Install PHP 7.1 and necessary extensions

On CentOS 7, you can install PHP 7.1 and necessary PHP extensions using the Webtatic YUM repo:

sudo rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
sudo yum install mod_php71w php71w-common php71w-cli php71w-gd php71w-mbstring php71w-mcrypt php71w-xml php71w-mysqlnd php71w-pecl-mongodb -y

4.2 Install Composer

Install the latest release of Composer, which is 1.3.1 at the time of writing, as below.

Note: The instructions above may change in should Composer update their installation instructions. As such, you should always check out the official Composer download page in order to get the most up-to-date installation instructions.

cd
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('SHA384', 'composer-setup.php') === '55d6ead61b29c7bdee5cccfb50076874187bd9f21f65d8991d46ec5cc90518f447387fb9f76ebae1fbbacf329e583e30') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"

4.3 Make Composer globally available

sudo mv composer.phar /usr/local/bin/composer

Step 5: Install Git and DreamFactory

5.1 Install Git

sudo yum install git -y

5.2 Install DreamFactory

Download the latest stable release of DreamFactory, which is 2.4.2 at the time this article was written, then install DreamFactory and dependencies as follows:

cd
wget https://github.com/dreamfactorysoftware/dreamfactory/archive/2.4.2.tar.gz
tar -zxvf 2.4.2.tar.gz
cd dreamfactory-2.4.2
composer install --no-dev
sudo mv ~/dreamfactory-2.4.2 /opt
sudo chown -R root:root /opt/dreamfactory-2.4.2
sudo chown -R apache:apache /opt/dreamfactory-2.4.2/storage/ /opt/dreamfactory-2.4.2/bootstrap/cache/
sudo chmod -R 2775 /opt/dreamfactory-2.4.2/storage/ /opt/dreamfactory-2.4.2/bootstrap/cache/
cd /opt/dreamfactory-2.4.2

Use the following command to create a .env file to store DreamFactory configurations:

sudo php artisan dreamfactory:setup

When prompted, input database settings as follows:

  Which database would you like to use for system tables? [sqlite]:
  [0] sqlite
  [1] mysql
  [2] pgsql
  [3] sqlsrv
 > 1

 Enter your mysql Host:
 > localhost

 Enter your database name:
 > dreamfactory

 Enter your database username:
 > dreamfactoryuser

 Enter your database password:
 > yourpassword

 Re-enter your database password:
 > yourpassword

 Enter your Database Port [3306]:
 > 3306

Run the same command again in order to setup the first admin user:

sudo php artisan dreamfactory:setup

When prompted, input credentials as follows:

Creating the first admin user...

 Enter your first name:
 > John

 Enter your last name:
 > Doe

 Enter display name:
 > John Doe

 Enter your email address?:
 > [email protected]

 Choose a password:
 > <your-admin-password>

 Re-enter password:
  > <your-admin-password>

5.3 Prepare for web access

Set up a virtual host for DreamFactory. Use the following code segment to setup a virtual host. Remember to replace the values of ServerAdmin, ServerName, ServerAlias, Errorlog, and CustomLog with your own ones.

cat <<EOF | sudo tee -a /etc/httpd/conf.d/dreamfactory.conf
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /opt/dreamfactory-2.4.2/public/
ServerName dreamfactory.example.com
ServerAlias www.dreamfactory.example.com
<Directory /opt/dreamfactory-2.4.2/public/>
Options FollowSymLinks
AllowOverride All
AllowOverride None
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>
ErrorLog /var/log/httpd/dreamfactory.example.com-error_log
CustomLog /var/log/httpd/dreamfactory.example.com-access_log common
</VirtualHost>
EOF

Put your modifications into effect by restarting the Apache service:

sudo systemctl restart httpd.service

Modify firewall rules in order to allow web access:

sudo firewall-cmd --zone=public --permanent --add-service=http
sudo firewall-cmd --reload

Step 6: Access DreamFactory

Point your web browser to http://203.0.113.1 to access DreamFactory, and then use the admin email address and password you set earlier to log in.

This concludes our tutorial. Thanks for reading.

Want to contribute?

You could earn up to $300 by adding new articles

Submit your article
Suggest an update
Request an article
How VPS

How VPS

Related Posts

Failed to download metadata for repo 'appstream' on Centos 8
CentOS

How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

February 25, 2022
How to Install BoltWire CMS on CentOS 7
CentOS

How to Install BoltWire CMS on CentOS 7

February 14, 2020
Showterm.io – A Terminal/Shell Recording, Upload and Share Tool for Linux
CentOS

Setup HTTP Authentication With Nginx on CentOS 7

February 14, 2020
Next Post

Installing Revive Adserver on CentOS 7

Using StrongSwan for IPSec VPN on CentOS 7

How to Install Gitea on CentOS 7

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Follow Us

  • 121 Followers
  • 87.2k Followers

Recommended

How to Install CFEngine on Ubuntu 16.04

3 years ago

Install Gnome Desktop with TightVNC on Debian 7

3 years ago

How To Configure Snort On Debian

3 years ago

Display Command Output or File Contents in Column Format

4 years ago

Instagram

    Please install/update and activate JNews Instagram plugin.

Categories

  • Arch
  • Authentication
  • Backups
  • BSD
  • Centmin Mod
  • CentOS
  • Control Panels
  • CoreOS
  • CWP
  • Debian
  • Directadmin
  • Encryption
  • Fedora
  • Firewalls
  • Hocvps Script
  • Hosting providers
  • Kloxo-MR
  • Linux
  • Mitigations
  • Operating System
  • Plesk
  • Reviews
  • Securing VPS/Servers
  • Security Patches
  • SSL Certificates
  • Uncategorized
  • Upgrading
  • VPS/Servers management guides
  • Vulnerability Detection
  • Web servers software
  • Webhosting Control Panel

Topics

Apache Web Server Bluehost Review 2019 Bluehost Review 2020 Bluehost Review 2021 Centmin Mod CentminMod centos install htop fsck htop install HTTP DoS attack Install Snort on an Ubuntu install Zabbix on CentOS install Zabbix on CentOS 7 Linux Commands linux guide linux install htop linux vps setup guide MariaDB MariaDB Error Mysql mysqld error optimize MariaDB optimize Mysql snort Ubuntu
No Result
View All Result

Highlights

Top Free Web Hosting Control Panels To Manage VPS/Dedicated Servers

Webmin Reviews

Virtualmin Reviews

CentOS Web Panel Reviews

Ajenti Reviews

ISPConfig Reviews

Trending

Failed to download metadata for repo 'appstream' on Centos 8
CentOS

How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

by How VPS
February 25, 2022
0

I tried to update some extensions by use yum on centOs which I specified in Dockerfile. After...

How to Fix MySQL Error "Plugin 'InnoDB' registration as a STORAGE ENGINE failed"?

How to Fix MySQL Error “Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed”?

November 17, 2020
How to optimize Mysql or MariaDB

How to optimize Mysql or MariaDB

November 3, 2020
Top Free Web Hosting Control Panels To Manage VPS/Dedicated Servers

Top Free Web Hosting Control Panels To Manage VPS/Dedicated Servers

February 17, 2020
Webmin Reviews

Webmin Reviews

February 17, 2020
How VPS – How to use/setup VPS

We bring you the best Premium WordPress Themes that perfect for news, magazine, personal blog, etc. Visit our landing page to see all features & demos.
LEARN MORE »

Recent News

  • How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8 February 25, 2022
  • How to Fix MySQL Error “Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed”? November 17, 2020
  • How to optimize Mysql or MariaDB November 3, 2020

Categories

  • Arch
  • Authentication
  • Backups
  • BSD
  • Centmin Mod
  • CentOS
  • Control Panels
  • CoreOS
  • CWP
  • Debian
  • Directadmin
  • Encryption
  • Fedora
  • Firewalls
  • Hocvps Script
  • Hosting providers
  • Kloxo-MR
  • Linux
  • Mitigations
  • Operating System
  • Plesk
  • Reviews
  • Securing VPS/Servers
  • Security Patches
  • SSL Certificates
  • Uncategorized
  • Upgrading
  • VPS/Servers management guides
  • Vulnerability Detection
  • Web servers software
  • Webhosting Control Panel

[mc4wp_form]

© 2018 JNews - City News Magazine WordPress theme. All rights belong to their respective owners.
JNews is a top selling 2018 WordPress News, Blog, Newspaper & Magazine Theme.

No Result
View All Result
  • Home

© 2023 JNews - Premium WordPress news & magazine theme by Jegtheme.