So installieren Sie OroCRM mit Nginx auf Ubuntu 16.04 LTS

 

OroCRM is an open source Customer Relationship Manager (CRM) platform fully targeted at e-commerce and marketing teams with a multichannel perspective. It is fully customizable and an enterprise-ready CRM application providing tons of features. It is built on PHP Symfony framework and uses MySQL to store their data. OroCRM comes in two editions, Community Edition (CE) and Enterprise Edition (EE). You can easily integrate it with other e-commerce platforms like, Magento and other solutions.

In diesem Tutorial, we will learn how to install OroCRM on Ubuntu 16.04.

Voraussetzungen

  • Ein Server mit Ubuntu 16.04.
  • Ein Nicht-Root-Benutzer mit Sudo Privilegien.

Anfangen

Zuerst, you will need to update your system to the latest version. Sie können mit dem folgenden Befehl tun:

sudo apt-get update -y
sudo apt-get upgrade -y

Sobald Ihr System aktualisiert, restart your system to apply all the changes. Nächster, install required packages to your system with the following command:

sudo apt-get install git curl unzip wget -y

Install LEMP Server

Bevor es losgeht, you will need to install LEMP (Nginx, MariaDB and PHP7) to your system.

Zuerst, install Nginx using the following command:

sudo apt-get install nginx -y

Once Nginx is installed, start Nginx service and enable it to start on boot time with the following command:

sudo systemctl nginx starten
sudo systemctl nginx ermöglichen

Standardmäßig, the latest version of the MariaDB and PHP is not available in Ubuntu 16.04. So you will need to add the repository for that.

Zuerst, add the MariaDB repository with the following command:

sudo apt-key adv --recv-Tasten --keyserver hkp: //keyserver.ubuntu.com: 80 0xF1656F24C74CD1D8
sudo add-apt-repository 'deb [arch=amd64,i386,ppc64el] http://kartolo.sby.datautama.net.id/mariadb/repo/10.2/ubuntu xenial main'

Nächster, add PHP repository with the following command:

sudo add-apt-repository ppa: ondrej / php

Nächster, update the repository with the following command:

sudo apt-get update -y

Sobald das Repository aktualisiert, install MariaDB and PHP7 by running the following command:

sudo apt-get install mariadb-server php7.0 php7.0-fpm php7.0-common php7.0-curl php7.0-gd php7.0-intl php7.0-json php7.0-mbstring php7.0-mcrypt php7.0-mysql php7.0-xml php7.0-xml php7.0-zip php7.0-tidy php7.0-soap php7.0-opcache -y

Nächster, you will need to set Timezone and increase memory limit in php.ini file:

sudo nano /etc/php/7.0/cli/php.ini

Ändern Sie die folgende Zeile ein:

date.timezone = Asia / Kolkata

Speichern und schließen Sie die Datei, wenn du fertig bist.

sudo nano /etc/php/7.0/fpm/php.ini

Ändern Sie die folgende Zeile ein:

memory_limit = 1024M

Speichern und schließen Sie die Datei, wenn du fertig bist.

Nächster, start MariaDB and PHP-FPM service and enable them to start on boot with the following command:

sudo systemctl Start mysql
sudo systemctl mysql ermöglichen
sudo systemctl start php7.0-fpm
sudo systemctl enable php7.0-fpm

Confogure MariaDB for OroCRM

Standardmäßig ist MariaDB Installation nicht gesichert, so you will need to secure MariaDB first. You can secure it by running mysql_secure_installation script:

sudo mysql_secure_installation

Beantworten Sie alle Fragen, wie unten dargestellt:

Set root password? [Y/n] Y
New password:
Re-enter new 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

Nächster, login to MariaDB shell and create a database and user for OroCRM:

mysql -u root -p

Enter your root password and press Enter, then create a database and user with the following command:

MariaDB [(none)]> CREATE DATABASE orodb;
MariaDB [(none)]> CREATE USER 'orouser'@'localhost' IDENTIFIED BY 'password';

Nächster, grant privileges to the OroCRM database with the following command:

MariaDB [(none)]> GRANT ALL PRIVILEGES ON orodb.* TO 'orouser'@'localhost';

Nächster, run the FLUSH PRIVILEGES command so that the privileges table will be reloaded by MariaDB:

MariaDB [(none)]> FLUSH PRIVILEGES;

Endlich, exit from the MariaDB shell:

MariaDB [(none)]> EXIT

Once the MariaDB is configured, Sie können mit dem nächsten Schritt fortfahren.

Install Node.js and Composer

You will also need to install Node.js and Composer to your system. Because Node.js will be used by OroCRM to compile the JavaScript and Composer will be used to install PHP dependencies.

Zuerst, add the Node.js repository using the following command:

sudo curl --silent --location https://deb.nodesource.com/setup_8.x | sudo bash -

Nächster, install Node.js and Composer with the following command:

sudo apt-get install NodeJS -y
sudo php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
sudo php composer-setup.php

Nächster, copy Composer to the /usr/bin directory with the following command:

sudo cp composer.phar /usr/bin/composer

Provide necessary permission to the Composer with the following command:

sudo chmod 755 /usr/bin/composer

Install OroCRM

Zuerst, you will need to download the latest version of the OroCRM from Git repository. Sie können mit dem folgenden Befehl tun:

cd / var / www / html
sudo git clone -b 2.4 https://github.com/oroinc/crm-application.git orocrm

Nächster, change the directory to the orocrm and install dependencies required by PHP using the following command:

cd orocrm
sudo composer install --prefer-dist --no-dev

During the installation you will need to provide database details, like database name, database username and password, database host as follows:

Creating the "app/config/parameters.yml" file
Some parameters are missing. Bitte geben sie.
database_driver (pdo_mysql): 
database_host (127.0.0.1): 
database_port (null):
database_name (oro_crm): orodb 
database_user (root): orouser
database_password (null): password
mailer_transport (smtp): 
mailer_host (127.0.0.1): 
mailer_port (null): 
mailer_encryption (null): 
mailer_user (null): 
mailer_password (null): 
websocket_bind_address (0.0.0.0): 
websocket_bind_port (8080): 
websocket_frontend_host ('*'): 
websocket_frontend_port (8080): 
websocket_backend_host ('*'): 
websocket_backend_port (8080): 
web_backend_prefix (''): 
session_handler (session.handler.native_file): 
locale (en): 
secret (ThisTokenIsNotSoSecretChangeIt): 
installed (null): 
assets_version (null): 
assets_version_strategy (time_hash): 
message_queue_transport (dbal): 
message_queue_transport_config (null): 

Nächster, install the application by running the following command:

sudo php app/console oro:install --env=prod

During the installation you will need to provide administrator account details:

Administration setup.
Application URL (http://localhost): 
Organization name (OroCRM): 
Username (admin): 
Email: [email protected]
First name: hitesh
Last name: jethva
Password: 
Load sample data (y/n): y

Oro Application has been successfully installed in prod mode.
Please run oro:api:doc:cache:clear command to warm-up API documentation cache
Make sure that consumer command was running oro:message-queue:consume. More info you can find here: https://www.orocrm.com/documentation/current/book/installation#activating-background-tasks.

Nächster, warm up the API documentation cache using the following command:

sudo php app/console oro:api:doc:cache:clear

Configure Nginx for OroCRM

Nächster, you will need to create an Nginx virtual host file for OroCRM. Sie können mit dem folgenden Befehl tun:

sudo nano /etc/nginx/sites-available/orocrm

Fügen Sie die folgenden Zeilen:

server {
    server_name example.com;
    root  /var/www/html/orocrm/web;

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

    location ~ ^/(app|app_dev|config|install).php(/|$) {
        fastcgi_pass unix:/run/php/php7.0-fpm.sock;
        fastcgi_split_path_info ^(.+.php)(/.*)$;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param HTTPS off;
    }

    # Enable Gzip compression
    gzip on;
    gzip_buffers 16 8k;
    gzip_comp_level 5;
    gzip_disable "msie6";
    gzip_min_length 1000;
    gzip_http_version 1.0;
    gzip_proxied any;
    gzip_types text/plain application/javascript application/x-javascript text/javascript text/xml text/css image/svg+xml;
    gzip_vary on;

    # Enable browser caching
    # One week for javascript and css
     location ~* .(?:css|js) {
       expires 1w;
       access_log off;
       add_header Cache-Control public;
     }

     # Three weeks for media: images, Schriftarten, icons, Video, audio etc.
     Lage ~ * .(?:jpg|jpeg|gif|png|ico|tiff|woff|eot|ttf|svg|svgz|mp4|ogg|ogv|webm|swf|flv)$ {
       expires 3w;
       access_log off;
       add_header Cache-Control public;
     }

    error_log /var/log/nginx/orocrm_error.log;
    access_log /var/log/nginx/orocrm_access.log;
}

Speichern und schließen Sie die Datei, wenn Sie fertig sind, then enable Nginx virtual host with the following command:

sudo ln -s /etc/nginx/sites-available/orocrm /etc/nginx/sites-enabled/orocrm

Nächster, check Nginx for any configuration error with the following command:

sudo nginx -t

Sie sollten die folgende Ausgabe:

nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

Nächster, provide necessary permission to the orocrm directory and restart Nginx:

sudo chown -R www-data:www-data /var/www/html/orocrm
Sudo chmod -R 777 /var/www/html/orocrm
sudo systemctl Neustart nginx

Access OroCRM

OroCRM is now installed, it's time to access OroCRM web interface.

Öffnen Sie Ihren Web-Browser und geben Sie die URL htttp://example.com, you will be redirected to the OroCRM login page as shown below:

OroCRM Login

Provide your admin username and password, Klicken Sie dann auf die Anmeldung Taste, you should see the OroCRM dashboard in following image:

OroCRM Dashboard

Congratulations! OroCRM is now installed on Ubuntu 16.04 Server.

 

Quelle

In Verbindung stehende Pfosten

Hinterlasse eine Antwort

Diese Seite nutzt Akismet Spam zu reduzieren. Erfahren Sie, wie Sie Ihren Kommentar Daten verarbeitet.