VHOST=crm.yourdomain.com

mkdir -p /var/www/vhosts/$VHOST

wget from https://suitecrm.com/download

chmod 766 /var/www/vhosts/$VHOST/config_override.php 
chmod 766 -R /var/www/vhosts/$VHOST/custom
chmod 755 -R /var/www/vhosts/$VHOST/cache
chmod -R 755 /var/www/vhosts/$VHOST/cache
chown nginx:nginx -R /var/www/vhosts/$VHOST

yum install php-mbstring php-imap php-gd
systemctl reload php-fpm

nano /etc/crontab 
(...)
# SuiteCRM
* * * * * cd /var/www/vhosts/$VHOST; php -f cron.php > /dev/null 2>&1
(...)
systemctl reload crond

nano /etc/nginx/sites-available/$VHOST.conf
server {
 server_name crm.yourdomain.com;

 listen 443 ssl;
 ssl_certificate /etc/letsencrypt/live/crm.yourdomain.com/cert.pem;
 ssl_certificate_key /etc/letsencrypt/live/crm.yourdomain.com/privkey.pem;
 ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
 ssl_ciphers HIGH:!aNULL:!MD5;

 client_max_body_size 50M;

 index index.php index.html index.htm;
 root /var/www/vhosts/crm.yourdomain.com;

 location / {
 root /var/www/vhosts/crm.yourdomain.com;
 index index.php index.html index.htm;
 }
 error_page 500 502 503 504 /50x.html;
 location = /50x.html {
 root /usr/share/nginx/html;
 }

 ## Images and static content is treated different
 location ~* ^.+\.(jpg|jpeg|gif|css|png|js|ico|xml|svg|wgoff2)$ {
 access_log off;
 expires max;
 root /var/www/vhosts/crm.yourdomain.com;
 }

 location ~ \.php$ {
 try_files $uri =404;
 fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
 fastcgi_index index.php;
 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
 include fastcgi_params;
 }

 location ~ /\.ht {
 deny all;
 }

 error_log /var/log/nginx/crm.yourdomain.com.error.log;
}

Advertisements