Skip to content

Installation

This page assumes Oro Commerce 3.x is being used.

Prerequisites

  • Nginx
  • PHP FPM 7.1/7.2
  • MySQL 5.7

System Requirements

Setup

There is some specialised configuration that is used, ensure that the your config looks similar to the following. The config below is for a development environment, see the official documentation for production.

server {
    server_name <your_domain_name> www.<your_domain_name>;
    root  /usr/share/nginx/html/oroapp/public;

    index index.php;

    gzip on;
    gzip_proxied any;
    gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
    gzip_vary on;

    location / {
        # try to serve file directly, fallback to index.php
        try_files $uri /index.php$is_args$args;
    }

    location ~ ^/(index|index_dev|config|install)\.php(/|$) {
        fastcgi_pass 127.0.0.1:9000;
        # or
        # fastcgi_pass unix:/var/run/php/php7-fpm.sock;
        fastcgi_split_path_info ^(.+\.php)(/.*)$;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param HTTPS off;
        fastcgi_buffers 64 64k;
        fastcgi_buffer_size 128k;
    }

    location ~* ^[^(\.php)]+\.(jpg|jpeg|gif|png|ico|css|pdf|ppt|txt|bmp|rtf|js)$ {
        access_log off;
        expires 1h;
        add_header Cache-Control public;
    }

    error_log /var/log/nginx/<your_domain_name>_error.log;
    access_log /var/log/nginx/<your_domain_name>_access.log;
}

Ensure that MySQL is configured correctly and create a database to store application data. Only version 5.7 and above are supported.

CREATE DATABASE oro;

Install

Check out the code to the correct location, install dependencies with Composer and run the setup command.

git clone -b 3.0 https://github.com/oroinc/orocommerce-application.git oroapp
composer install --prefer-dist
php ./bin/console oro:install --env=prod --timeout=900

You will be prompted for different configuration options, such as the base URL and if to install sample data or not.

After installation

Job Queue

Once the installation is complete, we need to ensure that the queue is being consumed and processed correctly. We recommend using systemd to handle this as a standalone server.

/etc/systemd/system/oro-consumer.service

[Unit]
Description=Orocrm Job Consumer

[Service]
User=ec
ExecStart=/var/www/vhosts/oro-commerce/bin/console oro:message-queue:consume --env prod
Restart=always

[Install]
WantedBy=multi-user.target

systemctl daemon-reload
systemctl enable oro-consumer
systemctl start oro-consumer

Web sockets

Web sockets are handled using Ratchet, this is configured by Oro for us. Suggested SystemD config

/etc/systemd/system/oro-websocket.service

[Unit]
Description=Orocrm Websocket Server

[Service]
User=ec
ExecStart=/var/www/vhosts/oro-commerce/bin/console gos:websocket:server
Restart=always

[Install]
WantedBy=multi-user.target

systemctl daemon-reload
systemctl enable oro-websocket
systemctl start oro-websocket

Ensure you use the correct configuration is you are using HTTPs mode HTTPS Mode and Websockets

Crontab

*/1 * * * * php /var/www/vhosts/oro-commerce/bin/console oro:cron --env=prod > /dev/null

Resources

System Requirements Official Installation Documentation Setting up web sockets and queue with Supervisord