Thursday, June 30, 2022

How To Install Craft CMS on Rocky Linux 8

 in This Tutorial you will Learn " How To Install Craft CMS on Rocky Linux 8"
Craft CMS is an open source CMS written in PHP. Craft CMS source code is hosted on GitHub.
_________________________________________________________________________________________
Server - Os:  Rocky Linux 8.5  64Bit      |    IP -192.168.1.20        |     Hostname - www.primaryhost.com
_________________________________________________________________________________________
cat /etc/system-release ; sestatus ; hostname ; hostname -I ; dnf groupinstall "Development Tools" -y
dnf install nginx mariadb-server php php-cli php-fpm php-common php-curl php-gd php-json php-mbstring php-mysqli php-pgsql php-zip php-intl php-xml php-pdo -y

nano /etc/php.ini
memory_limit = 256M

nano /etc/php-fpm.d/www.conf
user = nginx
group = nginx
systemctl start nginx mariadb php-fpm ; systemctl enable nginx mariadb php-fpm

mysql
create database craftdb;
grant all on craftdb.* to craftuser@localhost identified by 'securepassword';
flush privileges;
quit;

mysql_secure_installation

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"

HASH="$(wget -q -O - https://composer.github.io/installer.sig)"
php -r "if (hash_file('SHA384', 'composer-setup.php') === '$HASH') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"

php composer-setup.php --install-dir=/usr/local/bin --filename=composer

cd /var/www/html/ ; composer create-project craftcms/craft craft
chown -R nginx:nginx /var/www/html/craft ; chown -R nginx:nginx /var/lib/php/session
nano /etc/nginx/conf.d/craft.conf
server {

  listen 80;
  server_name craft.example.com;
  root /var/www/html/craft/web;
  index index.php;


  location / {
    try_files $uri/index.html $uri $uri/ /index.php?$query_string;
  }

  location ~ [^/]\.php(/|$) {
    try_files $uri $uri/ /index.php?$query_string;
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_pass unix:/run/php-fpm/www.sock;
    fastcgi_index index.php;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param PATH_INFO $fastcgi_path_info;
    fastcgi_param HTTP_PROXY "";
  }

}
nano /etc/nginx/nginx.conf
server_names_hash_bucket_size 64;
systemctl restart nginx

echo "192.168.1.20 craft.example.com" >> /etc/hosts
firewall-cmd --permanent --add-service={http,https} ; firewall-cmd --reload  
craft.example.com
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Saturday, June 18, 2022

How To Install Laravel PHP Framework on Rocky Linux 8

 in This Tutorial you will Learn " How To Install Laravel PHP Framework on Rocky Linux 8"


Laravel is an open-source PHP framework designed for web application development. It is built on various components of the Symfony framework and makes it easier to program PHP web applications. It provides a meaningful and creative syntax for simplifying common tasks such as authentication, routing, sessions, working with databases, and more. It makes development process simple for developers without compromising program capabilities.
_________________________________________________________________________________________
Server - Os:  Rocky Linux 8.5  64Bit      |    IP -192.168.1.20        |     Hostname - www.primaryhost.com
_________________________________________________________________________________________
cat /etc/system-release ; sestatus ; hostname ; hostname -I ; dnf groupinstall "Development Tools" -y
dnf install nginx mariadb-server php php-fpm php-common php-xml php-mbstring php-json php-zip php-mysqlnd curl unzip -y
systemctl start php-fpm nginx mariadb ; systemctl enable php-fpm nginx mariadb

nano /etc/php-fpm.d/www.conf
listen.owner = nginx
listen.group = nginx

nano /etc/php.ini
date.timezone = UTC
cgi.fix_pathinfo=1

systemctl restart php-fpm
curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer ; chmod +x /usr/local/bin/composer

cd /var/www/html/
composer create-project --prefer-dist laravel/laravel laravelsite
chown -R nginx:nginx /var/www/html/laravelsite/storage/
chown -R nginx:nginx /var/www/html/laravelsite/bootstrap/cache/
chmod -R 0777 /var/www/html/laravelsite/storage/
chmod -R 0775 /var/www/html/laravelsite/bootstrap/cache/

nano /etc/nginx/conf.d/laravel.conf
server {
       listen 80;
       server_name laravel.yourdomain.com;
       root        /var/www/html/laravelsite/public;
       index       index.php;
       charset utf-8;
       gzip on;
    gzip_types text/css application/javascript text/javascript application/x-javascript  image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon;
        location / {
        try_files $uri $uri/ /index.php?$query_string;
        }

        location ~ \.php {
                include fastcgi.conf;
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                fastcgi_pass unix:/run/php-fpm/www.sock;
        }
        location ~ /\.ht {
                deny all;
        }
}

systemctl restart php-fpm nginx ; systemctl status nginx
firewall-cmd --zone=public --permanent --add-service=http
firewall-cmd --zone=public --permanent --add-service=https
firewall-cmd --reload
nano /etc/hosts
192.168.1.20    laravel.yourdomain.com
laravel.yourdomain.com
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


Thursday, June 2, 2022

How To Install Apache Solr on Rocky Linux 8.5

 Apache Solr or Solr is a free and open-source search platform based on the Apache Lucene library. Solr is stands for Searching On Lucene with Replication, it is an enterprise-grade search platform written in Java.
_________________________________________________________________________________________
Server - Os:  Rocky Linux 8.5  64Bit      |    IP -192.168.1.20        |     Hostname - www.primaryhost.com
_________________________________________________________________________________________
cat /etc/system-release ; sestatus ; hostname ; hostname -I ; dnf groupinstall "Development Tools" -y
dnf install java-11-openjdk java-11-openjdk-devel
java --version
Latest- https://downloads.apache.org/lucene/solr/
wget https://downloads.apache.org/lucene/solr/8.11.1/solr-8.11.1.tgz
tar xzf solr-8.11.1.tgz
solr-8.11.1/bin/install_solr_service.sh solr-8.11.1.tgz

nano /etc/security/limits.conf
soft    nofile        65000
hard    nofile        65000
soft    nproc        65000
hard    nproc        65000
su - solr -c "/opt/solr/bin/solr restart"
firewall-cmd --add-port=8983/tcp --permanent ; firewall-cmd --reload
http://192.168.1.20:8983/solr
http://resolvable-hostname:8983/solr
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Friday, May 13, 2022

How To install GFortran ( Fortran Programming Language ) & Write a Hello World Program On Ubuntu 20.04

 ________________________________________________________________________________________
How To install GFortran ( Fortran Programming Language ) & Write a Hello World Program On Ubuntu 20.04
________________________________________________________________________________________

FORTRAN is a powerful programming language that is often over-shadowed by the more popular mainstream programming languages.

apt update ; apt-get install gfortran -y
gfortran --version
whereis gfortran ; which gfortran

Fortran Hello World Example: How To Write and Execute Fortran Program on Linux OS
nano helloworld.f
program hello
print *,"Hello World!"
end program hello


shorter Version  -
nano helloworld.f
PRINT *,"Hello World!"
END

Compile the Fortran program - gfortran -ffree-form helloworld.f
Execute the Fortran program (a.out) - ./a.out
mv a.out helloworld
./helloworld
_______________________________________________________________________________________

Saturday, May 7, 2022

How To install Crystal Programming Language On Ubuntu 20.04

 Crystal is a statically type-checked programming language. It was created with the beauty of Ruby and the performance of C in mind

Method : 1  
curl -fsSL https://crystal-lang.org/install.sh | sudo bash
crystal --version

Method: 2
apt update ; apt install snapd -y
snap install crystal --classic
crystal --version

Friday, May 6, 2022

Setting Up Web Server Load Balancing Using ‘POUND’ With SSL/TLS On Rocky Linux

 in This Tutorial you will Learn " How To Set Up Web Servers Load Balancing Using ‘POUND’ with     
SSL/TLS Connection On Rocky Linux 8.5  
                  
Pound is a reverse-proxy load balancing server. It accepts requests from HTTP/HTTPS clients and distributes them to one or more Web servers.
SSL and TLS are both cryptographic protocols used to increase security by encrypting communication over computer networks.
_________________________________________________________________________________________
Server - Os:  Rocky Linux 8.5  64Bit      |    IP -192.168.1.20        |     Hostname - www.primaryhost.com
Backend server's IP address -  192.168.1.80
_________________________________________________________________________________________
cat /etc/system-release ; sestatus ; hostname -I ; dnf groupinstall "Development Tools" -y
dnf install epel-release -y
dnf -y install Pound
mv /etc/pound.cfg /etc/pound.cfg.org

cd /etc/pki/tls/certs ; openssl req -x509 -nodes -newkey rsa:2048 -keyout /etc/pki/tls/certs/pound.pem -out /etc/pki/tls/certs/pound.pem
chmod 600 pound.pem

nano /etc/pound.cfg
User "pound"
Group "pound"
# log level (max: 5)
LogLevel 3
# specify LogFacility
LogFacility local1
# interval of heartbeat - seconds
Alive 30

# define frontend
ListenHTTP
    Address 0.0.0.0
    Port 80
End
ListenHTTPS
    Address 0.0.0.0
    Port 443
    Cert "/etc/pki/tls/certs/pound.pem"
End
# Define Backend
Service
    BackEnd
        # backend server's IP address
        Address  192.168.1.80
        # backend server's port
        Port     80
        # set priority
        # available value is 1-9, max priority is 9
        Priority 5
    End
End
systemctl enable --now pound
nano /etc/rsyslog.conf
*.info;mail.none;authpriv.none;cron.none;local1.none    /var/log/messages
local1.*                                                /var/log/pound.log
firewall-cmd --add-service=http ; firewall-cmd --runtime-to-permanent
systemctl daemon-reload ; systemctl restart rsyslog
https://localhost/
http://localhost/
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
cat /etc/system-release ; sestatus ; hostname -I ; dnf groupinstall "Development Tools" -y
dnf install httpd -y
nano /etc/httpd/conf/httpd.conf
LogFormat "\"%{X-Forwarded-For}i\" %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
echo "<h1>Web Server Load Balancing Using ‘POUND’ With SSLTLS</h1>" > /var/www/html/index.html
systemctl daemon-reload ; systemctl restart rsyslog httpd
_________________________________________________________________________________________

Friday, April 29, 2022

Setting Up Web Server Load Balancing Using ‘POUND’ On Rocky Linux

 in This Tutorial you will Learn " How To Set Up Web Servers Load Balancing Using ‘POUND’ On Rocky Linux 8.5                           
Pound is a reverse-proxy load balancing server. It accepts requests from HTTP/HTTPS clients and distributes them to one or more Web servers.
_________________________________________________________________________________________
Server - Os:  Rocky Linux 8.5  64Bit      |    IP -192.168.1.20        |     Hostname - www.primaryhost.com
Backend server's IP address -  192.168.1.80
_________________________________________________________________________________________
cat /etc/system-release ; sestatus ; hostname -I ; dnf groupinstall "Development Tools" -y
dnf install epel-release -y
dnf -y install Pound
mv /etc/pound.cfg /etc/pound.cfg.org
nano /etc/pound.cfg
User "pound"
Group "pound"
# log level (max: 5)
LogLevel 3
# specify LogFacility
LogFacility local1
# interval of heartbeat - seconds
Alive 30

# define frontend
ListenHTTP
    Address 0.0.0.0
    Port 80
End

# Define Backend
Service
    BackEnd
        # backend server's IP address
        Address  192.168.1.80
        # backend server's port
        Port     80
        # set priority
        # available value is 1-9, max priority is 9
        Priority 5
    End
End
systemctl enable --now pound
nano /etc/rsyslog.conf
*.info;mail.none;authpriv.none;cron.none;local1.none    /var/log/messages
local1.*                                                /var/log/pound.log
firewall-cmd --add-service=http ; firewall-cmd --runtime-to-permanent
systemctl daemon-reload ; systemctl restart rsyslog
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
cat /etc/system-release ; sestatus ; hostname -I ; dnf groupinstall "Development Tools" -y
dnf install httpd -y
nano /etc/httpd/conf/httpd.conf
LogFormat "\"%{X-Forwarded-For}i\" %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
echo "<h1>This is a Test Page</h1>" > /var/www/html/index.html
systemctl daemon-reload ; systemctl restart rsyslog httpd
_________________________________________________________________________________________