Saturday, October 7, 2023

How To Install Squid To Configure Proxy Server On Rocky Linux 8.5

 in This Tutorial you will Learn " How To Install and configure Squid proxy server On Rocky Linux 8.5"

Squid is a web proxy application with a variety of configurations and uses. Squid has a large number of access controls and supports different protocols, such as HTTP, HTTPS, FTP, and SSL.

Rocky Linux is an open-source enterprise operating system designed to be 100% bug-for-bug compatible with Red Hat Enterprise Linux®.
_________________________________________________________________________________________
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 -y install squid
gedit  /etc/squid/squid.conf &>/dev/null
acl my_localnet src 192.168.1.20/24                                                                        -line 29
http_access deny to_localhost                                                                                - 46
#http_access allow localnet                                                                                     -55
http_access allow my_localnet   # line 57 : add                                                     -57
request_header_access Referer deny all
request_header_access X-Forwarded-For deny all
request_header_access Via deny all
request_header_access Cache-Control deny all
forwarded_for off
systemctl enable --now squid ; systemctl start squid
firewall-cmd --add-service=squid ; firewall-cmd --runtime-to-permanent
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Proxy Client -
cat /etc/system-release ; hostname -I ; dnf groupinstall "Development Tools" -y
192.168.1.20 3128  

curl -x http://192.168.1.20:3128 -I http://google.com
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Friday, July 21, 2023

How To Install and Configure Apache Spark on Oracle Linux 9

in This Tutorial you will Learn " How To Install and Configure Apache Spark on Oracle Linux 9"
Apache Spark is a multi-language engine for executing data engineering, data science, and machine learning on single-node machines or clusters.
__________________________________________________________________________________________________________________________________
Server - Os:  Oracle Linux Server 9.0   64Bit      | IP -192.168.1.50        |Hostname - server.testbox.com
__________________________________________________________________________________________________________________________________
cat /etc/system-release ; hostname ; hostname -I ; dnf groupinstall "Development Tools" -y

sudo dnf update -y ; sudo yum install java-17-openjdk java-17-openjdk-devel -y
sudo dnf -y install wget curl -y
curl -L -b "oraclelicense=a" -O https://download.oracle.com/java/17/latest/jdk-17_linux-x64_bin.rpm
sudo rpm -Uvh jdk-17_linux-x64_bin.rpm
java -version


sudo tee /etc/profile.d/java17.sh <<EOF
export JAVA_HOME=\$(dirname \$(dirname \$(readlink \$(readlink \$(which javac)))))
export PATH=\$PATH:\$JAVA_HOME/bin
export CLASSPATH=.:\$JAVA_HOME/jre/lib:\$JAVA_HOME/lib:\$JAVA_HOME/lib/tools.jar
EOF


source /etc/profile.d/java17.sh
echo $JAVA_HOME
echo $PATH
echo $CLASSPATH

curl -s https://api.github.com/repos/lampepfl/dotty/releases/latest| grep browser_download_url  | egrep '.tar.gz' | cut -d '"' -f 4 | wget -i -
tar -xf scala3-*.tar.gz
mv scala3-*/ /usr/local/share/scala


sudo tee  -a ~/.bashrc <<EOF
export SCALA_HOME=/usr/local/share/scala
export PATH=\$PATH:\$SCALA_HOME/bin
EOF


source ~/.bashrc
scala -version
cd ~/

Offcial web - https://spark.apache.org/downloads.html
curl -O https://dlcdn.apache.org/spark/spark-3.3.2/spark-3.3.2-bin-hadoop3.tgz
tar xvf spark-3.3.2-bin-hadoop3.tgz
mv spark-3.3.2-bin-hadoop3/ /usr/local/spark

sudo nano ~/.bashrc
#add this line
export PATH=$PATH:/usr/local/spark/bin

source ~/.bashrc


spark-shell
sc.version
spark.version
http://<server_ip_address>:4040
firewall-cmd --zone=public --add-port=4040/tcp --permanent ; firewall-cmd --reload
__________________________________________________________________________________________________________________________________

Monday, May 15, 2023

How To Install and Configure Apache Solr on Oracle Linux 9

 in This Tutorial you will Learn " How To Install and Configure Apache Solr on Oracle Linux 9"
Apache Solr is an open source search platform built upon a Java library called Lucene.
__________________________________________________________________________________________________________________________________
Server - Os:  Oracle Linux Server 9.0   64Bit      | IP -192.168.1.50        |Hostname - server.testbox.com
__________________________________________________________________________________________________________________________________
cat /etc/system-release ; hostname ; hostname -I ; dnf groupinstall "Development Tools" -y
sudo dnf update -y ; sudo dnf -y install curl wget

sudo dnf install lsof java-17-openjdk  java-17-openjdk-devel -y
java -version
sudo alternatives --config java
 java -version

sudo nano  /etc/profile
export JAVA_HOME="/usr/lib/jvm/java-17-openjdk"
export PATH=$JAVA_HOME/bin:$PATH

source /etc/profile ; echo $JAVA_HOME

wget  https://www.apache.org/dyn/closer.lua/solr/solr/9.2.0/solr-9.2.0.tgz?action=download -O solr-9.2.0.tgz
tar -zxvf solr-9.2.0.tgz
cd /root/solr-9.2.0/bin
sudo ./install_solr_service.sh ~/solr-9.2.0.tgz

sudo service solr start ; sudo service solr status
sudo firewall-cmd  --permanent --add-port=8983/tcp ; sudo firewall-cmd --reload
localhost:8983
__________________________________________________________________________________________________________________________________


Tuesday, April 11, 2023

Ruby Hello World Example- How To Write and Execute Ruby Program on Ubuntu 20.04

 Ruby is an interpreted, high-level, general-purpose programming language which supports multiple programming paradigms.

apt update ; apt-get install ruby -y
whereis ruby
which ruby

nano helloworld.rb
#!/usr/bin/ruby

# Hello world ruby program

puts "Hello World!";

ruby helloworld.rb
( or )
chmod u+x helloworld.rb
./helloworld.rb

Executing Ruby one liner - ruby -e 'puts "Hello World!\n"'

_____________________________________________________________________________________

Tuesday, April 4, 2023

How To Install Flask with Gunicorn and Nginx on Oracle Linux 9

 in This Tutorial you will Learn " How To Install Flask with Gunicorn and Nginx on Oracle Linux 9"
Flask is a web application framework written in Python.
Gunicorn is a WSGI server.
NGINX is open source software for web serving, reverse proxying, caching, load balancing, media streaming, and more.
__________________________________________________________________________________________________________________________________
Server - Os:  Oracle Linux Server 9.0   64Bit      | IP -192.168.1.50        |Hostname - server.testbox.com
__________________________________________________________________________________________________________________________________
cat /etc/system-release ; hostname ; hostname -I ; dnf groupinstall "Development Tools" -y
sudo dnf update ;  sudo dnf install epel-release -y
sudo dnf install python3-pip python3-devel gcc -y
dnf install nginx -y
nginx -version


dnf install --assumeyes python3-pip
pip3 install virtualenv
sudo update-crypto-policies --set LEGACY
sudo reboot
sudo mkdir /sample_project && cd /sample_project
sudo chmod 777 /sample_project
virtualenv projectenv
source projectenv/bin/activate

pip3 install gunicorn flask
pip install --upgrade pip
nano  /sample_project/helloworld.py
from flask import Flask
app = Flask(__name__)

@app.route('/')
def hello_world():
    return "<h1 style='color:red'>Hello, World!</h1>"

if __name__ == '__main__':
    app.run(host='0.0.0.0')


sudo firewall-cmd --add-port=5000/tcp --permanent ; sudo firewall-cmd --reload

python helloworld.py
http://127.0.0.1:5000


nano /sample_project/wsgi.py
from helloworld import app

if __name__ == "__main__":
    app.run()

firewall-cmd --add-port=8000/tcp --permanent ; firewall-cmd --reload
python helloworld.py
http://0.0.0.0:8000
deactivate
gunicorn --bind 0.0.0.0:8000 wsgi:app
_________________________________________________________________________________________________________________________________

Tuesday, March 28, 2023

How to install KVM on Oracle Linux 9

 in This Tutorial you will Learn " How to install KVM on Oracle Linux 9 "
Kernel-based Virtual Machine (KVM) is an open source virtualization technology built into Linux®. Specifically, KVM lets you turn Linux into a hypervisor that allows a host machine to run multiple, isolated virtual environments called guests or virtual machines (VMs).
__________________________________________________________________________________________________________________________________
Server - Os:  Oracle Linux Server 9   64Bit      | IP -192.168.1.50        |Hostname - server.testbox.com
__________________________________________________________________________________________________________________________________
cat /etc/system-release ; dnf groupinstall "Development Tools" -y

lscpu | grep Virtualization
sudo dnf update ; sudo dnf install qemu-kvm qemu-img libvirt virt-manager virt-install virt-viewer libvirt-client
sudo systemctl start libvirtd ; sudo systemctl enable libvirtd ; sudo systemctl status libvirtd
sudo virt-manager
__________________________________________________________________________________________________________________________________

Thursday, March 23, 2023

How To Install Docker on Oracle Linux Server 9

 
Docker is a container engine that uses the Linux Kernel to create the containers on top of an operating system. Which is used to create, deploy and run the applications.
__________________________________________________________________________________________________________________________________
Server - Os:  Oracle Linux Server 9.0   64Bit      | IP -192.168.1.50        |Hostname - server.testbox.com
__________________________________________________________________________________________________________________________________
cat /etc/system-release ; hostname ; hostname -I ; dnf groupinstall "Development Tools" -y
sudo dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
sudo dnf update
sudo dnf install -y docker-ce docker-ce-cli containerd.io
docker --version
sudo systemctl enable docker ; sudo systemctl start docker ; sudo systemctl status docker
sudo usermod -aG docker yourname
id testbox
docker run hello-world
docker pull ubuntu
docker images
docker run -it ubuntu
__________________________________________________________________________________________________________________________________