设为首页 收藏本站
查看: 989|回复: 0

[经验分享] How to Install OroCRM with Nginx on Ubuntu16.04LTS-Arnold

[复制链接]

尚未签到

发表于 2019-2-19 08:57:31 | 显示全部楼层 |阅读模式
  OroCRM is an open source Customer>  In this tutorial, we will learn how to install OroCRM on Ubuntu 16.04.
Prerequisites

  •   A server running Ubuntu 16.04.
  •   A non-root user with sudo privileges.
Getting Started
  First, you will need to update your system to the latest version. You can do this with the following command:
  sudo apt-get update -y
  sudo apt-get upgrade -y
  Once your system is updated, restart your system to apply all the changes. Next, install required packages to your system with the following command:
  sudo apt-get install git curl unzip wget -y
Install LEMP Server
  Before starting, you will need to install LEMP (Nginx, MariaDB and PHP7) to your system.
  First, 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 start nginx
  sudo systemctl enable nginx
  By default, 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.
  First, add the MariaDB repository with the following command:
  sudo apt-key adv --recv-keys --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'
  Next, add PHP repository with the following command:
  sudo add-apt-repository ppa:ondrej/php
  Next, update the repository with the following command:
  sudo apt-get update -y
  Once the repository is updated, 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
  Next, you will need to set Timezone and increase memory limit in php.ini file:
  sudo nano /etc/php/7.0/cli/php.ini
  Change the following line:
date.timezone = Asia/Kolkata  Save and close the file, when you are finished.
  sudo nano /etc/php/7.0/fpm/php.ini
  Change the following line:
memory_limit = 1024M  Save and close the file, when you are finished.
  Next, start MariaDB and PHP-FPM service and enable them to start on boot with the following command:
  sudo systemctl start mysql
  sudo systemctl enable mysql
  sudo systemctl start php7.0-fpm
  sudo systemctl enable php7.0-fpm
Confogure MariaDB for OroCRM
  By default MariaDB installation is not secured, so you will need to secure MariaDB first. You can secure it by running mysql_secure_installation script:
  sudo mysql_secure_installation
  Answer all the questions as shown below:
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
  Next, 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'>  Next, grant privileges to the OroCRM database with the following command:
  MariaDB [(none)]> GRANT ALL PRIVILEGES ON orodb.* TO 'orouser'@'localhost';

  Next, run the FLUSH PRIVILEGES command so that the privileges table will be>  MariaDB [(none)]> FLUSH PRIVILEGES;
  Finally, exit from the MariaDB shell:
  MariaDB [(none)]> EXIT
  Once the MariaDB is configured, you can proceed to the next step.
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.
  First, add the Node.js repository using the following command:
  sudo curl --silent --location https://deb.nodesource.com/setup_8.x | sudo bash -
  Next, 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
  Next, 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
  First, you will need to download the latest version of the OroCRM from Git repository. You can do this with the following command:
  cd /var/www/html
  sudo git clone -b 2.4 https://github.com/oroinc/crm-application.git orocrm
  Next, 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. Please provide them.
  
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):
  Next, 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: hitjethva@gmail.com
  
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.
  Next, warm up the API documentation cache using the following command:
  sudo php app/console oro:api:doc:cache:clear
Configure Nginx for OroCRM
  Next, you will need to create an Nginx virtual host file for OroCRM. You can do this with the following command:
  sudo nano /etc/nginx/sites-available/orocrm
  Add the following lines:
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, fonts, icons, video, audio etc.
  
     location ~* \.(?: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;
  
}
  Save and close the file when you are finished, then enable Nginx virtual host with the following command:
  sudo ln -s /etc/nginx/sites-available/orocrm /etc/nginx/sites-enabled/orocrm
  Next, check Nginx for any configuration error with the following command:
  sudo nginx -t
  You should see the following output:
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok  
nginx: configuration file /etc/nginx/nginx.conf test is successful
  Next, 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 restart nginx
Access OroCRM
  OroCRM is now installed, it's time to access OroCRM web interface.
  Open your web browser and type the URL htttp://example.com, you will be redirected to the OroCRM login page as shown below:
DSC0000.png

  Provide your admin username and password, then click on the Login button, you should see the OroCRM dashboard in following image:
DSC0001.png

  Congratulations! OroCRM is now installed on Ubuntu 16.04 server.



运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-674162-1-1.html 上篇帖子: ubuntu固定mountd端口号 下篇帖子: How to Install Couch CMS on Ubuntu 16.04 LTS-Arnold
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表