Wednesday, August 26, 2020

How To install ArangoDB server With Docker and Docker Compose On Ubuntu 20.04

 Video Tutorial -

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 ArangoDB is a NoSQL database system and supports key/value,documents,graphs data models with AQL (ArangoDB Query Language) query language.
Offcial Website -https://www.arangodb.com/
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Testing Environment:
Ubuntu 20.04 LTS                     Hostname - www.yourdomain.com  - ip Address - 192.168.1.20
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
apt update ; apt install -y build-essential net-tools curl git software-properties-common neofetch apt-transport-https ca-certificates curl gnupg-agent docker.io docker-compose

systemctl enable --now docker ; usermod -aG docker $USER ; newgrp docker
mkdir arangodb ; cd arangodb ; nano docker-compose.yml
version: '3.7'
services:
  arangodb_db_container:
    image: arangodb:latest
    environment:
      ARANGO_ROOT_PASSWORD: rootpassword
    ports:
      - 8529:8529
    volumes:
      - arangodb_data_container:/var/lib/arangodb3
      - arangodb_apps_data_container:/var/lib/arangodb3-apps

volumes:
  arangodb_data_container:
  arangodb_apps_data_container:
docker-compose up -d
docker volume ls
docker ps ; netstat -tlpn
docker ps -aq
http://192.168.1.20:8529
docker-compose stop
docker-compose down

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Thursday, August 13, 2020

How To install Bmon – Bandwidth monitoring Tool On Ubuntu 20.04

 Video Tutorial -

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

bmon is a monitoring and debugging tool to capture networking related statistics and prepare them visually in a human friendly way. It features various output methods including an interactive curses user interface and a programmable text output for scripting.

Github  -https://github.com/tgraf/bmon.git
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Testing Environment: Windows 10 64Bit
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
apt update ; apt install -y build-essential net-tools curl git software-properties-common neofetch make libconfuse-dev libnl-3-dev libnl-route-3-dev libncurses-dev pkg-config dh-autoreconf
git clone https://github.com/tgraf/bmon.git
cd bmon
./autogen.sh
./configure
make && make install
bmon
bmon -p ens33
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Tuesday, August 11, 2020

How To Install Ralph Asset Management System Using Docker on Ubuntu 20.04

 Video Tutorial - https://youtu.be/GdcwMksAqvE

 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 Ralph is a free, open-source, simple and powerful Asset Management, DCIM and CMDB system for data center and back office. It is built on top of Django, Python3 and used to keep track of assets purchases and their life cycle. It comes with a user-friendly web interface and allows you to generate flexible and accurate cost reports.
Offcial Website -https://ralph-ng.readthedocs.io/en/stable/
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Testing Environment:
Ubuntu 20.04 LTS                     Hostname - www.example.com  - ip Address - 192.168.1.40
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
apt update ; apt install -y build-essential net-tools curl git software-properties-common neofetch apt-transport-https ca-certificates curl gnupg-agent docker.io docker-compose
systemctl enable --now docker ; usermod -aG docker $USER ; newgrp docker
git clone https://github.com/allegro/ralph.git
cd ralph/docker ; docker-compose run web init
docker-compose up -d
docker ps
docker-compose ps
http://www.example.com  
ralph/ralph
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Monday, August 3, 2020

How To install LAMP Server With Virtual Hosts On Ubuntu 20.04 LTS

Video Tutorial -

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

LAMP is a well-known abbreviation for Linux, Apache, MySQL, and PHP.

Apache Virtual Hosts allow you to host more than one website on a single server or machine.

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Testing Environment: Ubuntu 20.04 LTS        Hostname - www.yourdomain.com         ip Address - 192.168.1.10

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

apt update ; apt install build-essential net-tools curl git software-properties-common neofetch  apache2 apache2-utils libapache2-mod-php mysql-server mysql-client php-fpm php-cli php-curl php-mysql php-curl php-gd php-mbstring php-pear php-cgi php-imap php-intl php-snmp php-tidy php-zip php-mbstring php-json php-pgsql php-opcache php-mysql php-ldap php-bz2 php-xml phpmyadmin -y


mysql_secure_installation

systemctl enable apache2 php7.4-fpm ; systemctl start apache2 mysql php7.4-fpm

a2enconf php7.4-cgi ; a2enmod rewrite headers


sed -i "s/;date.timezone.*/date.timezone = Asia\/\Kolkata/" /etc/php/*/apache2/php.ini

echo ServerName 127.0.0.1 >> /etc/apache2/apache2.conf


nano /etc/apache2/conf-enabled/security.conf

ServerTokens Prod

nano /etc/apache2/mods-enabled/dir.conf

index.php


nano /etc/apache2/sites-enabled/000-default.conf

<VirtualHost *:80>

    ServerName yourdomain.com

    ServerAlias www.yourdomain.com

    ServerAdmin webmaster@localhost

    DocumentRoot /var/www/html/

    ErrorLog ${APACHE_LOG_DIR}/error.log

    CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>


apachectl configtest


echo '<?php phpinfo(); ?>' > /var/www/html/info.php ; echo "This is Test Page on www.yourdomain.com" > /var/www/html/index.html

chown -R $USER:$USER /var/www/html/ ; chmod -R 755 /var/www/html/


mysql -u root -p

create user Test@'localhost' identified by 'StrongPassword';

grant all privileges on *.* to Test@'localhost';

flush privileges;

exit


systemctl restart apache2 php7.4-fpm mysql

http://www.yourdomain.com | http://www.yourdomain.com/info.php  | http://www.yourdomain.com/phpmyadmin/

______________________________________________________________________________________________________________

Set Up Apache VirtualHosts -

______________________________________________________________________________________________________________

mkdir -p /var/www/virtualhost.com/public_html

echo '<?php phpinfo(); ?>' > /var/www/virtualhost.com/public_html/info.php ; echo "This is Test Page on www.virtualhost.com" > /var/www/virtualhost.com/public_html/index.html


chown -R $USER:$USER /var/www/virtualhost.com/public_html ; chmod -R 755 /var/www

nano /etc/apache2/sites-available/virtualhost.com.conf

<VirtualHost *:80>

    ServerAdmin admin@virtualhost.com

    ServerName virtualhost.com

    ServerAlias www.virtualhost.com

    DocumentRoot /var/www/virtualhost.com/public_html

    ErrorLog ${APACHE_LOG_DIR}/error.log

    CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>


apachectl configtest ; a2ensite virtualhost.com.conf

echo "192.168.1.10 www.virtualhost.com www" >> /etc/hosts

systemctl restart apache2 mysql php7.4-fpm

http://www.virtualhost.com | http://www.virtualhost.com/info.php


Optional Step -  Download Free Website Templates & Test -

https://freewebsitetemplates.com/templates/page-2

rm -rf /var/www/virtualhost.com/public_html/index.html

rm -rf /var/www/virtualhost.com/public_html/info.php

cp -r /home/ubuntu/Downloads/ecologicalwebsitetemplate/* /var/www/virtualhost.com/public_html/

systemctl restart apache2 mysql php7.4-fpm


http://www.virtualhost.com

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

How To install LEMP Stack With Server Blocks ( Virtual Host ) On Ubuntu 20.04

Video Tutorial -

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

LEMP software stack is a group of open-source software that is installed together to enable a server to host websites and apps. It is an acronym for Linux, ENginx server, MySQL, and PHP.


Nginx Server Blocks allows you to run more than one website on a single machine. With Server Blocks, you can specify the site document root (the directory which contains the website files), create a separate security policy for each site, use different SSL certificates for each site, and much more.

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Testing Environment: Ubuntu 20.04 LTS          Hostname - www.yourdomain.com  - ip Address - 192.168.1.10

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

apt update ; apt install -y build-essential net-tools curl git software-properties-common neofetch


apt update ; apt install nginx mysql-server mysql-client php-fpm php-cli php-curl php-mysql php-curl php-gd php-mbstring php-pear php-cgi php-imap php-intl php-snmp php-tidy php-zip php-mbstring php-json php-pgsql php-opcache php-mysql php-ldap php-bz2 php-xml phpmyadmin -y


mysql_secure_installation

systemctl enable nginx mysql php7.4-fpm ; systemctl start nginx mysql php7.4-fpm


timedatectl

sed -i "s/;date.timezone.*/date.timezone = Asia\/\Kolkata/" /etc/php/*/fpm/php.ini

sed -i "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/" /etc/php/*/fpm/php.ini


nano /etc/nginx/sites-enabled/default

server {

  listen 80;

  listen [::]:80;

  server_name www.yourdomain.com;

  root /var/www/html;

  index index.php index.html index.htm index.nginx-debian.html;


  location / {

    try_files $uri $uri/ /index.php;

  }


  location ~ \.php$ {

    fastcgi_pass unix:/run/php/php7.4-fpm.sock;

    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

    include fastcgi_params;

    include snippets/fastcgi-php.conf;

  }


 # A long browser cache lifetime can speed up repeat visits to your page

  location ~* \.(jpg|jpeg|gif|png|webp|svg|woff|woff2|ttf|css|js|ico|xml)$ {

       access_log        off;

       log_not_found     off;

       expires           360d;

  }


  # Disable Access To Hidden Files

  location ~ /\.ht {

      access_log off;

      log_not_found off;

      deny all;

  }

}


nginx -t

ln -s  /usr/share/phpmyadmin /var/www/html/phpmyadmin

chmod 775 -R /usr/share/phpmyadmin/ ; chown www-data:www-data -R /usr/share/phpmyadmin/


rm -rf /var/www/html/index.nginx-debian.html

echo '<?php phpinfo(); ?>' > /var/www/html/info.php ; echo "This is Test Page on www.yourdomain.com" > /var/www/html/index.html


mysql -u root -p

create user Test@'localhost' identified by 'StrongPassword';

grant all privileges on *.* to Test@'localhost';

flush privileges;

exit


echo "192.168.1.10 www.yourdomain.com www" >> /etc/hosts

systemctl reload nginx  php7.4-fpm


http://www.yourdomain.com/ | http://www.yourdomain.com/info.php | http://www.yourdomain.com/phpmyadmin

______________________________________________________________________________________________________________

Set Up Nginx Server Blocks (Virtual Hosts) -

______________________________________________________________________________________________________________

nano /etc/nginx/nginx.conf

server_names_hash_bucket_size 64;


mkdir -p /var/www/serverblock.com/html ; chmod -R 755 /var/www ; chown -R $USER:$USER /var/www/serverblock.com/html


echo '<?php phpinfo(); ?>' > /var/www/serverblock.com/html/info.php ; echo "This is Test Page on www.serverblock.com" > /var/www/serverblock.com/html/index.html


nano /etc/nginx/sites-available/serverblock.com

server {

  listen 80;

  listen [::]:80;

  server_name www.serverblock.com;

  root /var/www/serverblock.com/html;

  index index.php index.html index.htm index.nginx-debian.html;


  location / {

    try_files $uri $uri/ /index.php;

  }


  location ~ \.php$ {

    fastcgi_pass unix:/run/php/php7.4-fpm.sock;

    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

    include fastcgi_params;

    include snippets/fastcgi-php.conf;

  }


 # A long browser cache lifetime can speed up repeat visits to your page

  location ~* \.(jpg|jpeg|gif|png|webp|svg|woff|woff2|ttf|css|js|ico|xml)$ {

       access_log        off;

       log_not_found     off;

       expires           360d;

  }


  # Disable Access To Hidden Files

  location ~ /\.ht {

      access_log off;

      log_not_found off;

      deny all;

  }

}

nginx -t

ln -s /etc/nginx/sites-available/serverblock.com /etc/nginx/sites-enabled/

echo "192.168.1.10 www.serverblock.com www" >> /etc/hosts

systemctl reload nginx php7.4-fpm

http://www.serverblock.com/ | http://www.serverblock.com/info.php


Optional Step -  Download Free Website Templates & Test -

https://freewebsitetemplates.com/templates/page-2

rm -rf /var/www/serverblock.com/html/index.html info.php

cp -r /home/ubuntu/Downloads/ecologicalwebsitetemplate/* /var/www/serverblock.com/html/

systemctl reload nginx php7.4-fpm

http://www.serverblock.com/

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Saturday, August 1, 2020

Create And Restore A Backup In Gitlab On Ubuntu 18

Video Tutorial -
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
in This Tutorial you will learn Create And Restore A Backup In Gitlab On Ubuntu 18"

GitLab is an open source GIT repository manager based on Rails and developed by GitLab Inc. It is a web-based GIT repository manager that allows your team to work on code, perform feature requests, track bugs, and test and implement applications. GitLab provides features such as a wiki, issue tracking, code reviews, activity feeds, and merge management. It is able to host multiple projects.
Offcial Website -https://docs.gitlab.com/
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Testing Environment:
Ubuntu 18.04.LTS Bionic              Hostname - www.yourdomain.com  - ip Address - 192.168.1.40
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
sudo gedit /etc/gitlab/gitlab.rb &>/dev/null   [ gitlab_rails['backup_path']

cd /mnt/new-backups ; pwd ; ls -la
gitlab-rake gitlab:backup:create

gitlab-ctl start
gitlab-ctl stop unicorn
gitlab-ctl stop sidekiq

gitlab-rake gitlab:backup:restore BACKUP=1589373739_2020_05_13_12.10.3
gitlab-ctl restart
gitlab-rake gitlab:check SANITIZE=true
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------