HomeTutorialsContact
Deployments
Installation Guide for Cattr on Ubuntu 22
volcano
volcano
July 19, 2024
1 min
Make sure to subscribe to our newsletter and be the first to know the news.
Installation Guide for Cattr on Ubuntu 22

Here is Detailed Guide for Installation of Tradexpro on Ubuntu 22

Steps 1: Login to SSH Client

Login to Server using ssh either PUTTY OR BITVISE OR ANY Good Client

Step 2: Update System

sudo apt update && sudo apt upgrade -y
apt install net-tools
apt install unzip

Step 3: Install Nginx

sudo apt install curl
sudo apt-get install net-tools
sudo apt install nginx

Then check if nginx is running without error. sudo systemctl status nginx.service

Make sure you have NOT INSTALLED APACHE2 or Stopped it properly sudo systemctl stop apache2

sudo systemctl disable apache2
sudo systemctl restart nginx.service

STEP 3A : Instal CERTBOT and Wildcard SSL Manual

Install CERBOT with SNAPD

sudo apt update
sudo apt install snapd
sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot
sudo certbot --nginx

Using Manual DNS VALIDATION Install Manual HOOK FOR WILDCARD SSL,

cd /tmp
wget https://github.com/joohoi/acme-dns-certbot-joohoi/raw/master/acme-dns-auth.py
chmod +x acme-dns-auth.py
nano acme-dns-auth.py

and add 3 at the end of python

sudo mv acme-dns-auth.py /etc/letsencrypt/
sudo certbot certonly --manual --manual-auth-hook /etc/letsencrypt/acme-dns-auth.py --preferred-challenges dns --debug-challenges -d \*.site.com -d site.com
sudo certbot certonly --manual --manual-auth-hook /etc/letsencrypt/acme-dns-auth.py --preferred-challenges dns --debug-challenges -d \*.looks.pk -d looks.pk
sudo certbot certonly --manual --manual-auth-hook /etc/letsencrypt/acme-dns-auth.py --preferred-challenges dns --debug-challenges -d \*.pakwebstuff.com -d pakwebstuff.com

RESTART NGINX

sudo service nginx restart

STEP 3b: Add Nginx Config for Backend and frontend

Backend Config

cd /etc/nginx/sites-enabled
nano /etc/nginx/sites-enabled/admin.site.com.conf
sudo update-alternatives --config php

===========================================================================

map $http_upgrade $type {
default "web";
websocket "ws";
}
server {
root /var/www/admin.site.com/public;
index index.php index.html index.htm index.nginx-debian.html;
server_name admin.site.com;
location / {
try_files /nonexistent @$type;
}
location @web {
#fastcgi_pass unix:/does/not/exist;
try_files $uri $uri/ /index.php?$query_string;
}
location @ws {
proxy_pass http://127.0.0.1:6006;
proxy_set_header Host $host;
proxy_read_timeout 60;
proxy_connect_timeout 60;
proxy_redirect off;
# Allow the use of websockets
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
}
location ~ /\.ht {
deny all;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/site.com-0001/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/site.com-0001/privkey.pem; # managed by Cert
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = admin.site.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name admin.site.com;
return 404; # managed by Certbot
}

===========================================================================

FRONTEND Config

cd /etc/nginx/sites-enabled
nano /etc/nginx/sites-enabled/site.com.conf

===========================================================================

server {
root /var/www/site.com/;
index index.php index.html index.htm index.nginx-debian.html;
server_name site.com;
location / {
proxy_pass http://127.0.0.1:3040;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/site.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/site.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = site.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
server_name site.com;
listen 80;
return 404; # managed by Certbot
}

=========================================================================

MYSQL Config for Pubic Folder access

cd /etc/nginx/sites-enabled
nano /etc/nginx/sites-enabled/db.site.com.conf

=========================================================================

server {
server_name db.site.com;
access_log /var/log/nginx/admin.access.log;
error_log /var/log/nginx/admin.error.log;
root /var/www/adminx;
index index.php;
location / {
try_files $uri $uri/ =404;
client_max_body_size 1000M;
allow 103.134.2.243;
allow all;
allow 3.73.61.52;
deny all;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
client_max_body_size 1000M;
}
location ~ /\.ht {
deny all;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/site.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/site.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = db.site.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name db.site.com;
return 404; # managed by Certbot
}

=========================================================================

Step 4: Install MYSQL and Secure Password

sudo apt install mysql-server
sudo systemctl start mysql.service
sudo systemctl status mysql.service
mysql
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'hola23444444';
flush privileges;
create database wow;
quit;

Step 5: Install PHP and ALL Desired Extentions

sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt install --no-install-recommends php8.1
sudo apt-get update
sudo apt-get install nginx php8.1-fpm
sudo apt-get install -y php8.1-cli php8.1-common php8.1-mysql php8.1-bcmath php8.1-zip php8.1-gd php8.1-mbstring php8.1-curl php8.1-xml
sudo systemctl restart php8.1-fpm

__
__ Install PHP 8.2

sudo apt install --no-install-recommends php8.2
sudo apt-get update
sudo apt-get install nginx php8.2-fpm
sudo apt-get install -y php8.2-cli php8.2-common php8.2-mysql php8.2-bcmath php8.2-zip php8.2-gd php8.2-mbstring php8.2-curl php8.2-xml
sudo systemctl restart php8.2-fpm

ONLY PHP sudo add-apt-repository ppa:ondrej/php

sudo apt install php8.2-{bcmath,bz2,intl,gd,mbstring,mysql,zip,fpm,curl,xml}

Step 6: Install Composer

New update for composer installation ubuntu

cd ~
curl -sS https://getcomposer.org/installer -o /tmp/composer-setup.php
HASH=`curl -sS https://composer.github.io/installer.sig`
php -r "if (hash_file('SHA384', '/tmp/composer-setup.php') === '$HASH') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
sudo php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composer
composer
sudo systemctl restart php8.2

Step 7: SETUP LARAVEL ADMIN / BACKEND

Create an admin folder for /var/www/admin.site.com

sudo mkdir admin.site.com

and upload the admin panel content

Unzip the Admin files, make sure the database is connecting using .env file

nano .env

add database connection

sudo chgrp -R www-data storage bootstrap/cache
sudo chmod -R ug+rwx storage bootstrap/cache
sudo chmod -R 777 public/uploaded_file/
php artisan key:generate
php artisan migrate --seed
php artisan passport:install
composer update
composer install

__ then update the file of vendor

Step 8: SETUP Supervisor + Config

Install Supervisor for CRON and Schedules jobs bots

sudo apt update && sudo apt install supervisor
sudo systemctl status supervisor
cd /etc/supervisor/conf.d/ && nano cron.conf

Then Update the Content of Supervisor

[program:sockets]
process_name=sockets
directory=/var/www/admin.korbit-kr.com/
command=php artisan websockets:serve --port=6006
autostart=true
autorestart=true
startsecs=0
redirect_stderr=true
stopwaitsecs=3600
stdout_logfile=/root/supervisor_log
[program:scheduler]
process_name=scheduler
directory=/var/www/admin.korbit-kr.com/
command=php artisan schedule:run
autostart=true
autorestart=true
startsecs=0
redirect_stderr=true
stopwaitsecs=3600
stderr_logfile=/var/log/supervisor/test.err.log
stdout_logfile=/var/log/supervisor/test.out.log
[program:horizon]
process_name=horizon
directory=/var/www/admin.korbit-kr.com/
command=php artisan horizon
autostart=true
autorestart=true
startsecs=0
redirect_stderr=true
stopwaitsecs=3600
stdout_logfile=/root/supervisor_log
[program:trade_price]
process_name=trade_price
directory=/var/www/admin.korbit-kr.com/
command=php artisan trading:price-from-api
autostart=true
autorestart=true
startsecs=0
redirect_stderr=true
stopwaitsecs=3600
[program:trade_bot]
process_name=trade_bot
directory=/var/www/admin.korbit-kr.com/
command=php artisan trading:bot
autostart=true
autorestart=true
startsecs=0
redirect_stderr=true
stopwaitsecs=3600

Update the super service

sudo supervisorctl update
sudo supervisorctl reload
sudo supervisorctl reload

Step 9: SETUP REDIS Server + Config

sudo apt install redis-server
sudo systemctl start redis.service
sudo systemctl status redis.service

Step 10: SETUP FRONT NODEJS / FRONTEND Nextjs..

sudo apt-get install -y curl
curl -fsSL https://deb.nodesource.com/setup_20.x -o nodesource_setup.sh
sudo -E bash nodesource_setup.sh
sudo apt-get install -y nodejs
node -v
sudo apt update
npm --version
Node —version
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt install yarn
yarn --version
yarn upgrade
sudo apt remove cmdtest
sudo apt remove yarn
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update
sudo apt-get install yarn -y
yarn
npm uninstall -g yarn pnpm
npm install -g corepack

Step 10: Verify and Star FRONTEND

npm cache clean --force && rm -rf .next && rm -rf node_modules/ && sudo npm install pm2 -g && yarn install && yarn installs
npm cache clean --force
rm -rf .next
rm -rf node_modules/
sudo npm install pm2 -g
yarn install
yarn installs
cd /var/www/kor/site.com && pm2 start yarn --interpreter bash --name FrontEnd -- starts
pm2 start yarn --interpreter bash --name FrontEnd -- starts
yarn start -p 3060
AUTO START SERVICE

Step 11: Autostart Service for Nginx


Share


volcano

volcano

Server Geek

Dr Volcano is Tech Geek, Creative Artist to Convert Ideas into Realities.

Expertise

Tech Analysis
Linux System Admin
Web Developer

Social Media

facebookyoutubewwwtwitter

Related Posts

Installation Guide for TradexPro on Ubuntu 22
Installation Guide for TradexPro on Ubuntu 22
July 19, 2024
1 min
Made with ❤️ by Dr iFFi
© 2026, All Rights Reserved.

Quick Links

About UsOur TeamContact Us

Social Media