372 Wiki 372 Wiki

  • Home
  • Forums
  • Categories
    • Billing
    • Bookkeeping
    • Copyright & Legal
    • Clients
    • Designer Guides
    • Developer Guides
    • Getting Started
    • Troubleshooting
    • Workplace
Home / Cimara / New Cimara Client Instance Deployment

New Cimara Client Instance Deployment

27 views 3 min , 30 sec read 0

Creating AWS Live Instance

Instance Type

  1. OS Linux
  2. Blueprint Plesk

 

Name

Create an instance with the following name convention LVS_<number>_Cimara_<client_name>

 

SSH into the Instance as root

SSH into the server with the following command

Ssh -l <user_name> -i <file.pem> <instance_ip>

 

Example

ssh -l ubuntu -I awslight.pem 13.55.98.23

 

Install Plesk

  1. Ssh into the instance
  2. Run command
    1. sudo plesk login
  3. URL will be printed on the terminal. Copy the url into the browser
  4. Plesk installation wizard will open
  5. Plesk admin user creation
    1. Username – admin
    2. Email – your work email
    3. Password – generate
  6. Add domain And create domain user
    1. Enter domain name
    2. Username – <client_name>-prod
    3. Password – generate
  7. Hosting setting
    1. On the domain dashboard click hosting setting
    2. Set preferred domain without www
    3. Set php version to 7.1.*
  8. Set up bash access
    1. Click host access in domain dashboard
    2. Select /bin/bash in Access to the server over ssh
    3. Press ok

 

Add user domain user created above as sudo

  1. Login to instance as root
  2. Run command
    1. sudo usermod -aG sudo <client_name>-prod
    2. example – sudo usermod -aG sudo esa-prod

 

Allow domain user to ssh

  1. Login to instance as root
  2. Open file with command
    1. sudo vim /etc/ssh/sshd_config
  3. Update and save
    1. PasswordAuthentication no to PasswordAuthentication yes
  4. Run command
    1. ssh service: sudo service ssh restart

ssh as domain user

SSH into the server with the following command
sshpass -p <domain_user_password> ssh <domain_user>@<instance_ip>

Example

sshpass -p 9n7@5omYssh esa-prod@13.12.34.234

Install Cimara

Remove folders in httpdocs

  1. Click on Files from plesk side-bar
  2. Delete all the files

Clone Cimara

  1. Go the gitlab
  2. Create new branch from master <client>-master
  3. Clone https link
  4. Ssh with domain user
  5. Navigate to httpsdocs
    1. run command (include the dot in the end)
      1. git clone -b <branch> https://gitlab.com/cimara/cimara.git .

 

Copy env file

  • Run command
    • cp .gitlab-deploy/app-env/.env-app .env

 

Clone SSL sertificates

  • Run Command
    • git clone https://gitlab.com/cimara/cimara-ssl-certi.git

 

Clone laradock

  • Run Command
    • git clone https://github.com/Laradock/laradock.git

 

Copy Config files

  • Run Command
    1. cp .gitlab-deploy/laradock-env/.env-laradock laradock/.env
    2. cp .gitlab-deploy/schedular/laravel-scheduler.conf laradock/php-worker/supervisord.d/laravel-scheduler.conf
    3. rm laradock/docker-compose.yml
    4. cp .gitlab-deploy/composer/prod-docker-compose.yml laradock/docker-compose.yml
    5. cp .gitlab-deploy/apache/default.prod.apache.conf laradock/apache2/sites/default.apache.conf

 

Update apache settings

  1. Navigate to the laradock/apache2/sites
  2. Update default.apache.conf
    • Change ServerName to the client domain(Note: 2x occurrence)

 

Example apache 2 config

<VirtualHost *:80>
RewriteEngine On
ServerName esa.cimara.io
RewriteCond %{HTTP:X-Forwarded-Proto} =http
RewriteRule .* https://%{HTTP:Host}%{REQUEST_URI} [L,R=permanent]
DocumentRoot “/var/www/public”

SSLEngine on
SSLCertificateFile “/var/www/cimara-ssl-certi/STAR_cimara_io.crt”
SSLCertificateKeyFile “/var/www/cimara-ssl-certi/cimara.key”
SSLCertificateChainFile “/var/www/cimara-ssl-certi/STAR_cimara_io.ca-bundle”
</VirtualHost>

<VirtualHost *:443>
ServerName esa.cimara.io
DocumentRoot “/var/www/public”

SSLEngine on
SSLCertificateFile “/var/www/cimara-ssl-certi/STAR_cimara_io.crt”
SSLCertificateKeyFile “/var/www/cimara-ssl-certi/cimara.key”
SSLCertificateChainFile “/var/www/cimara-ssl-certi/STAR_cimara_io.ca-bundle”
</Virtualhost>

<Directory “/var/www/public”>
Options Indexes MultiViews
AllowOverride All
<IfVersion < 2.4 >
Order allow,deny
Allow from all
</IfVersion>
<IfVersion >= 2.4>
Require all granted
</IfVersion>
</Directory>

 

Update .htaccess

Options +FollowSymLinks -Indexes
RewriteEngine On
RewriteCond %{HTTP:Authorization} .
RewriteRule .* – [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

Stop host apache and Nginx

  1. Shh as the root user
  2. Run Command
  3. sudo service nginx stop
  4. sudo service apache2 stop

Install docker-compose

  1. Shh as the root user
  2. Run command
    1. sudo curl -L https://github.com/docker/compose/releases/download/1.20.0/docker-compose-`uname -s`-`uname -m` -o /usr/bin/docker-compose
    2. sudo chmod +x /usr/bin/docker-compose

 

Run docker

  1. navigate to laradock
  2. run command
    1. sudo docker-compose up -d

 

Install Laravel dependencies

  • Run command
    1. Sudo docker exec -it laradock_workspace_1 /bin/bash
    2. composer install –ignore-platform-reqs
    3. chmod 775 node_modules/.bin/webpack
    4. npm install
    5. npm install cross-env
    6. npm run-script prod

 

Fix file permission

  • Run command
    1. Sudo docker exec -it laradock_apache2_1 bin/bash
    2. cd ../ (path should be in var)
    3. chmod 775 www
    4. exit

 

  • Run Command
    1. Sudo Chmod 777 Modules/Kernel/Menu/menu.json
    2. Sudo Chmod -777 -R storage
    3. mkdir storage/temp_thumbnail
    4. sudo chmod 777 -R storage/temp_thumbnail
    5. Sudo Chmod -777 -R bootstrap/cache

 

Check apache 2 config

  1. Login as domain user
  2. Run command
    • Sudo docker exec -it laradock_apache2_1 /bin/bash
  3. Go to /etc/apa che2/sityes-available
  4. Open default.apache.conf. This should be the one we set earlier
  5. Go to /etc/apache2/sites-enabled
  6. 10-docker.conf should exist with the following content

Include /opt/docker/etc/httpd/global.conf
Include /opt/docker/etc/httpd/php.conf

<IfVersion < 2.4>
Include /opt/docker/etc/httpd/conf.d/*.conf
</IfVersion>
<IfVersion >= 2.4>
  IncludeOptional /opt/docker/etc/httpd/conf.d/*.conf
</IfVersion>
Include /opt/docker/etc/httpd/vhost.conf

Run Laravel-scheduler

Run command
Sudo Docker restart -t 10 laradock_php-workder_1

Create DB instance

  1. Create MySQL 5.7.26 DB
  2. Name – LVDB_<number>_Cimara_<client_name>
  3. Connect it to the sequel pro
  4. Create a prod and test database

Edit .env file

Update DB settings
Update mail driver to mail gun
Add ORGANISATION_ID
Add ORGANISATION_NAME
Add MEMBERSHIP_URL
Add MEMBERSHIP_AUTH
Update aws
Update GOOGLE_ANALYTICS_TRACKING_CODE
Update FCM_SERVER_KEY
Update FCM_SENDER_ID

Rebuilt docker-compose

docker-compose up -d –force-recreate –build <container-name>

Run Docker errors

When workspace errors

Try Run command

  1. sudo apt-get install runc=1.0.0~rc7+git20190403.029124da-0ubuntu1~16.04.4
  2. sudo apt-get install docker-ce
  3. Try [Run docker]

Create AWS Database

  1. Go to the database tab
  2. Click create
  3. Choose Mysql 5.7.26
  4. Name – LVDB_1_Cimara_<client_name>
  5. After created, go to the networking tab and enable public mode

Create AWS Load balancer

  1. Create Load balancer
  2. Attach instances

Enable Session Persistence

  1. Go to inbound traffic tab
  2. Click enable session persistence

Enable Https

Create a Certificate

  1. Primary domain – Example – esa.cimara.io
  2. Alternate domain – Example – test-esa.cimara.io

apache stop errors

Failed to start apache2.service: Unit apache2.service not found.

sudo netstat -nlp
kill <PID>

Cimara

About 372-admin

View all posts by 372-admin →

Related Articles

  • DRAFT – Cimara Mobile App User Guide

Article Categories

  • 9Billing
  • 3Bookkeeping
  • 2Cimara
  • 5Client
  • 11Copyright & Legal
  • 2Designer Guide
  • 18Developer Guide
  • 11Getting Started
  • 2Troubleshooting
  • 10Workplace

Most Viewed

  • Using my credit 112
  • What is WordPress? 64
  • Account overview 51
  • Why can’t I download the latest theme version (zip file)? 49
  • How do you customize the navigation? 48

Most Liked

  • Using my credit 5
  • Why can’t I download the latest theme version (zip file)? 3
  • What is WordPress? 2
  • Workplace Communication 1
  • Account overview 1

Article Categories

Billing Bookkeeping Cimara Client Copyright & Legal Designer Guide Developer Guide Getting Started Troubleshooting Workplace

Any questions

For all management related matters please refer to Ben Brillante

For any Cimara functional issues please refer to Rushabh Padalia.

For client based issued please refer to James Apoefis

© Copyright 372 Digital Pty Ltd. All rights reserved.