Yum

From DreamFactory
Jump to: navigation, search

PHP

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

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.

Database

Web Server

Nginx

Instructions for installing Nginx on CentOS 7 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.