Here is Detailed Guide for Installation of Tradexpro on Ubuntu 22
Login to Server using ssh either PUTTY OR BITVISE OR ANY Good Client
sudo apt update && sudo apt upgrade -yapt install net-toolsapt install unzip
sudo apt install curlsudo apt-get install net-toolssudo 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 apache2sudo systemctl restart nginx.service
Install CERBOT with SNAPD
sudo apt updatesudo apt install snapdsudo snap install --classic certbotsudo ln -s /snap/bin/certbot /usr/bin/certbotsudo certbot --nginx
Using Manual DNS VALIDATION Install Manual HOOK FOR WILDCARD SSL,
cd /tmpwget https://github.com/joohoi/acme-dns-certbot-joohoi/raw/master/acme-dns-auth.pychmod +x acme-dns-auth.pynano 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.comsudo certbot certonly --manual --manual-auth-hook /etc/letsencrypt/acme-dns-auth.py --preferred-challenges dns --debug-challenges -d \*.looks.pk -d looks.pk
RESTART NGINX
sudo service nginx restart
cd /etc/nginx/sites-enablednano /etc/nginx/sites-enabled/admin.site.com.confsudo 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 websocketsproxy_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 Certbotssl_certificate /etc/letsencrypt/live/site.com-0001/fullchain.pem; # managed by Certbotssl_certificate_key /etc/letsencrypt/live/site.com-0001/privkey.pem; # managed by Certinclude /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbotssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot}server {if ($host = admin.site.com) {return 301 https://$host$request_uri;} # managed by Certbotlisten 80;server_name admin.site.com;return 404; # managed by Certbot}
===========================================================================
cd /etc/nginx/sites-enablednano /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 Certbotssl_certificate /etc/letsencrypt/live/site.com/fullchain.pem; # managed by Certbotssl_certificate_key /etc/letsencrypt/live/site.com/privkey.pem; # managed by Certbotinclude /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbotssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot}server {if ($host = site.com) {return 301 https://$host$request_uri;} # managed by Certbotserver_name site.com;listen 80;return 404; # managed by Certbot}
=========================================================================
cd /etc/nginx/sites-enablednano /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 Certbotssl_certificate /etc/letsencrypt/live/site.com/fullchain.pem; # managed by Certbotssl_certificate_key /etc/letsencrypt/live/site.com/privkey.pem; # managed by Certbotinclude /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbotssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot}server {if ($host = db.site.com) {return 301 https://$host$request_uri;} # managed by Certbotlisten 80;server_name db.site.com;return 404; # managed by Certbot}
=========================================================================
sudo apt install mysql-serversudo systemctl start mysql.servicesudo systemctl status mysql.servicemysqlALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'hola23444444';flush privileges;create database wow;quit;
sudo apt install software-properties-commonsudo add-apt-repository ppa:ondrej/phpsudo apt updatesudo apt install --no-install-recommends php8.1sudo apt-get updatesudo apt-get install nginx php8.1-fpmsudo 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-xmlsudo systemctl restart php8.1-fpm
__
__ Install PHP 8.2
sudo apt install --no-install-recommends php8.2sudo apt-get updatesudo apt-get install nginx php8.2-fpmsudo 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-xmlsudo systemctl restart php8.2-fpm
New update for composer installation ubuntu
cd ~curl -sS https://getcomposer.org/installer -o /tmp/composer-setup.phpHASH=`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=composercomposersudo systemctl restart php8.1-fpm
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/cachesudo chmod -R ug+rwx storage bootstrap/cachesudo chmod -R 777 public/uploaded_file/php artisan key:generatephp artisan migrate --seedphp artisan passport:installcomposer updatecomposer install
__ then update the file of vendor
Install Supervisor for CRON and Schedules jobs bots
sudo apt update && sudo apt install supervisorsudo systemctl status supervisorcd /etc/supervisor/conf.d/ && nano cron.conf
Then Update the Content of Supervisor
[program:sockets]process_name=socketsdirectory=/var/www/admin.site.com/command=php artisan websockets:serve --port=6006autostart=trueautorestart=truestartsecs=0redirect_stderr=truestopwaitsecs=3600stdout_logfile=/root/supervisor_log[program:scheduler]process_name=schedulerdirectory=/var/www/admin.site.com/command=php artisan schedule:runautostart=trueautorestart=truestartsecs=0redirect_stderr=truestopwaitsecs=3600stderr_logfile=/var/log/supervisor/test.err.logstdout_logfile=/var/log/supervisor/test.out.log[program:horizon]process_name=horizondirectory=/var/www/admin.site.com/command=php artisan horizonautostart=trueautorestart=truestartsecs=0redirect_stderr=truestopwaitsecs=3600stdout_logfile=/root/supervisor_log[program:trade_price]process_name=trade_pricedirectory=/var/www/admin.site.com/command=php artisan trading:price-from-apiautostart=trueautorestart=truestartsecs=0redirect_stderr=truestopwaitsecs=3600[program:trade_bot]process_name=trade_botdirectory=/var/www/admin.site.com/command=php artisan trading:botautostart=trueautorestart=truestartsecs=0redirect_stderr=truestopwaitsecs=3600
Update the super service
sudo supervisorctl updatesudo supervisorctl reloadsudo supervisorctl reload
sudo apt install redis-serversudo systemctl start redis.servicesudo systemctl status redis.service
sudo apt-get install -y curlcurl -fsSL https://deb.nodesource.com/setup_20.x -o nodesource_setup.shsudo -E bash nodesource_setup.shsudo apt-get install -y nodejsnode -vsudo apt updatenpm --versionNode —versioncurl -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.listsudo apt install yarnyarn --versionyarn upgradesudo apt remove cmdtestsudo apt remove yarncurl -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.listsudo apt-get updatesudo apt-get install yarn -yyarn install
npm cache clean --force && rm -rf .next && rm -rf node_modules/ && sudo npm install pm2 -g && yarn install && yarn installsnpm cache clean --forcerm -rf .nextrm -rf node_modules/sudo npm install pm2 -gyarn installyarn installscd /var/www/kor/site.com && pm2 start yarn --interpreter bash --name FrontEnd -- startspm2 start yarn --interpreter bash --name FrontEnd -- startsyarn start -p 3060
Quick Links
Legal Stuff
