Important

You are browsing the documentation for version 3.1 of OroCommerce, OroCRM and OroPlatform, which is no longer maintained. Read version 5.1 (the latest LTS version) of the Oro documentation to get up-to-date information.

See our Release Process documentation for more information on the currently supported and upcoming releases.

Web Server Configuration

The following sections contain the recommended configuration for supported web server types and versions.

Apache 2.4

 1    <VirtualHost *:80>
 2        ServerName <your-domain-name>
 3        ServerAlias www.<your-domain-name>
 4
 5        DirectoryIndex index.php
 6        DocumentRoot <application-root-folder>/public
 7        <Directory  <application-root-folder>/public>
 8            # enable the .htaccess rewrites
 9            AllowOverride All
10            Require all granted
11        </Directory>
12
13        ErrorLog /var/log/apache2/<your-domain-name>_error.log
14        CustomLog /var/log/apache2/<your-domain-name>_access.log combined
15    </VirtualHost>
  • Replace <application-root-folder> with the absolute path to the Oro application.

  • Replace <your-domain-name> with the configured domain name that is used for the Oro application.

Note

Please make sure mod_rewrite and mod_headers are enabled.

Nginx

 1    server {
 2        server_name <your-domain-name> www.<your-domain-name>;
 3        root <application-root-folder>/public;
 4
 5        location / {
 6            # try to serve file directly, fallback to index.php
 7            try_files $uri /index.php$is_args$args;
 8        }
 9
10        location ~ ^/(index|index_dev|config|install)\.php(/|$) {
11            fastcgi_pass 127.0.0.1:9000;
12            # or
13            # fastcgi_pass unix:/var/run/php/php7-fpm.sock;
14            fastcgi_split_path_info ^(.+\.php)(/.*)$;
15            include fastcgi_params;
16            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
17            fastcgi_param HTTPS off;
18        }
19
20        location ~* ^[^(\.php)]+\.(jpg|jpeg|gif|png|ico|css|pdf|ppt|txt|bmp|rtf|js)$ {
21           access_log off;
22           expires 1h;
23           add_header Cache-Control public;
24        }
25
26        error_log /var/log/nginx/<your-domain-name>_error.log;
27        access_log /var/log/nginx/<your-domain-name>_access.log;
28    }
  • Replace <application-root-folder> with the absolute path to the Oro application.

  • Replace <your-domain-name> with the configured domain name that is used for the Oro application.

Caution

Make sure that the web server user has permissions for the log directory of the application.

More details on the file permissions configuration are available in the official Symfony documentation.