Yum

From DreamFactory
Jump to: navigation, search
(Nginx)
(PHP)
Line 1: Line 1:
 
==PHP==
 
==PHP==
 
+
Dreamfactory requires PHP 5.5+ to be installed. In CentOS and Red Hat Enterprise Linux environments this means PHP will need to be installed.
<pre>
+
Please note that the '''php-json''' package isn't available is some distro repositories. If this is the case, you can add the [http://fedoraproject.org/wiki/EPEL  RHEL EPEL] repository to your sources list.  Instructions for doing this are available [http://www.rackspace.com/knowledge_center/article/installing-rhel-epel-repo-on-centos-5x-or-6x here].
$ sudo yum install git curl php php-common php-cli php-curl php-json php-gd
+
<source lang="bash">sudo yum install git curl php php-common php-cli php-curl php-json php-gd</source>
</pre>
+
 
+
Please note that the <b>php-json</b> package isn't available is some distro repositories. If this is the case, you can add the [http://fedoraproject.org/wiki/EPEL  RHEL EPEL] repository to your sources list.  Instructions for doing this are available [http://www.rackspace.com/knowledge_center/article/installing-rhel-epel-repo-on-centos-5x-or-6x here].
+
  
 
==Database==
 
==Database==

Revision as of 13:46, 28 July 2016

PHP

Dreamfactory requires PHP 5.5+ to be installed. In CentOS and Red Hat Enterprise Linux environments this means PHP will need to be installed. Please note that the php-json package isn't available is some distro repositories. If this is the case, you can add the RHEL EPEL repository to your sources list. Instructions for doing this are available here.

sudo yum install git curl php php-common php-cli php-curl php-json php-gd

Database

Web Server

Nginx

Instructions for installing Nginx on CentOS 7 are here.

 $ sudo yum install nginx 

Here's a sample nginx default.conf file.

server {
    listen 80 default_server;
    listen [::]:80 default_server ipv6only=on;

    root /path/to/dreamfactory/public;
    index index.php index.html index.htm;

    server_name server_domain_name_or_IP;

    location / {
        try_files $uri $uri/ /index.php?$args;
    }

    error_page 404 /404.html;
    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
        root /usr/share/nginx/html;
    }

    location ~ \.php$ {
        try_files $uri =404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }
}

Apache

$ sudo yum install httpd
  • Open the Firewall for http
$ setenforce 0
$ firewall-cmd --permanent --add-service=http
$ firewall-cmd --reload
  • Enable Site

Finally, we need to configure Apache to connect to the DreamFactory application. Below are the instructions to change the default site on Apache. For instructions on setting up virtual hosts, review the Apache documentation.

In this example, we'll edit the Apache default configuration file.

 $ sudo nano /etc/httpd/conf/httpd.conf 
  • Change the DocumentRoot and the Directory settings
DocumentRoot "/opt/dreamfactory/public"

<Directory "/opt/dreamfactory/public">
    Options -Indexes +FollowSymLinks -MultiViews
    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>
  • Restart the web 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.