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
__________________________________________________________________________________________________________________________________
Thursday, March 23, 2023
How To Install Docker on Oracle Linux Server 9
Tuesday, March 21, 2023
Configure Storage Server with iSCSI.
in This Tutorial you will Learn " How To Configure Storage Server with iSCSI On Oracle Linux 9
Configure Storage Server with iSCSI.
Storage server with iSCSI on network is called iSCSI Target, Client Host that connects to iSCSI Target is called iSCSI Initiator.
+----------------------+ | +----------------------+
| [ iSCSI Target ] |192.168.1.50 | 192.168.1.40| [ iSCSI Initiator ] |
__________________________________________________________________________________________________________________________________
Server - Os: Oracle Linux Server 9.0 64Bit | IP -192.168.1.50 |Hostname - server.testbox.com
__________________________________________________________________________________________________________________________________
Configure iSCSI Target (Targetcli) -
cat /etc/system-release ; hostname ; hostname -I ; dnf groupinstall "Development Tools" -y
dnf -y install targetcli
mkdir /var/lib/iscsi_disks
targetcli
cd backstores/fileio
create disk01 /var/lib/iscsi_disks/disk01.img 10G
cd /iscsi
create iqn.2023-03.server.testbox:dlp.target01
cd iqn.2023-03.server.testbox:dlp.target01/tpg1/luns
create /backstores/fileio/disk01
cd ../acls
create iqn.2023-03.server.testbox:node01.initiator01
cd iqn.2023-03.server.testbox:node01.initiator01
set auth userid=username
set auth password=password
exit
ss -napt | grep 3260
systemctl enable target
firewall-cmd --add-service=iscsi-target ; firewall-cmd --runtime-to-permanent
__________________________________________________________________________________________________________________________________
Configure iSCSI Initiator -
__________________________________________________________________________________________________________________________________
cat /etc/system-release ; hostname ; hostname -I ; dnf groupinstall "Development Tools" -y
dnf -y install iscsi-initiator-utils
nano /etc/iscsi/initiatorname.iscsi
InitiatorName=iqn.2023-03.server.testbox:node01.initiator01
nano /etc/iscsi/iscsid.conf
node.session.auth.authmethod = CHAP
node.session.auth.username = username
node.session.auth.password = password
iscsiadm -m discovery -t sendtargets -p 192.168.1.50
iscsiadm -m node -o show
systemctl restart iscsid
iscsiadm -m node --login
iscsiadm -m session -o show
cat /proc/partitions
parted --script /dev/sdc "mklabel gpt"
parted --script /dev/sdc "mkpart primary 0% 100%"
mkfs.xfs -i size=1024 -s size=4096 /dev/sdc1
mount /dev/sdc1 /mnt
df -hT
__________________________________________________________________________________________________________________________________
Sunday, March 19, 2023
Create SSL Certificate (Self Signed)
in This Tutorial you will Learn" How To Create SSL Certificate (Self Signed) On Oracle Linux 9"
SSL stands for Secure Sockets Layer, a global standard security technology that enables encrypted communication between a web browser and a web server.
__________________________________________________________________________________________________________________________________
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
cd /etc/pki/tls/certs
openssl genrsa -aes128 2048 > server.key
openssl rsa -in server.key -out server.key
openssl req -utf8 -new -key server.key -out server.csr
openssl x509 -in server.csr -out server.crt -req -signkey server.key -days 3650
chmod 600 server.key
ll server.*
__________________________________________________________________________________________________________________________________
Tuesday, March 14, 2023
Linux NFS Server: How to Set Up Server and Client On Oracle Linux 9
Network File System (NFS) is a networking protocol for distributed file sharing.
Configure NFS Client to mount NFS Share on NFS Client. || This example is based on the environment like follows.
+----------------------+ | +----------------------+
| [ NFS Server ] |192.168.1.40 | 192.168.1.50| [ NFS Client ] |
| server.second.com +----------+----------+ server.testbox.com |
_______________________________________________________________________________________________________________________________
Server - Os: Oracle Linux Server 9
__________________________________________________________________________________________________________________________________
cat /etc/system-release ; hostname ; hostname -I ; dnf groupinstall "Development Tools" -y
192.168.1.40 ||server.second.com
dnf -y install nfs-utils
nano /etc/idmapd.conf
Domain = server.second.com
nano /etc/exports
/home/nfsshare 192.168.1.40/24(rw,no_root_squash)
mkdir /home/nfsshare
systemctl enable --now rpcbind nfs-server
firewall-cmd --add-service=nfs ; firewall-cmd --add-service={nfs3,mountd,rpc-bind} ; firewall-cmd --runtime-to-permanent
__________________________________________________________________________________________________________________________________
Configure NFS Client -Oracle Linux Server 9|||| server.testbox.com|192.168.1.50|
dnf -y install nfs-utils
nano /etc/idmapd.conf
Domain = server.testbox.com
firewall-cmd --add-service=nfs ; firewall-cmd --add-service={nfs3,mountd,rpc-bind} ; firewall-cmd --runtime-to-permanent
mount -t nfs 192.168.1.40:/home/nfsshare /mnt
df -hT
__________________________________________________________________________________________________________________________________
Sunday, March 12, 2023
Configure NTP Server in Oracle Linux 9
_______________________________________________________________________________________
NTP stands for Network Time Protocol.
It is used to synchronize the time on your Linux system with a centralized NTP server.
A local NTP server on the network can be synchronized with an external timing source to keep all the servers in your organization in-sync with an accurate time.
________________________________________________________________________________________
chronyc sources
dnf -y install chrony
nano /etc/chrony.conf
change servers to synchronize (replace to your own timezone NTP server)
# need NTP server itself to sync time with other NTP server
#pool 2.centos.pool.ntp.org iburst
pool ntp.nict.jp iburst
# add network range to allow to receive time synchronization requests from NTP Clients
# specify your local network and so on
# if not specified, only localhost is allowed
allow 192.168.1.50/24
systemctl enable --now chronyd ; systemctl restart chronyd ; systemctl status chronyd
firewall-cmd --add-service=ntp ; firewall-cmd --runtime-to-permanent
chronyc sources
________________________________________________________________________________________
Friday, February 24, 2023
How To Install Squid Proxy Server with Squid Basic Authentication 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 httpd-tools
gedit /etc/squid/squid.conf &>/dev/null
acl my_localnet src 192.168.1.20/24 -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
auth_param basic program /usr/lib64/squid/basic_ncsa_auth /etc/squid/.htpasswd
auth_param basic children 5
auth_param basic realm Squid Basic Authentication
auth_param basic credentialsttl 5 hours
acl password proxy_auth REQUIRED
http_access allow password
systemctl enable --now squid ; systemctl start squid
firewall-cmd --add-service=squid ; firewall-cmd --runtime-to-permanent
htpasswd -c /etc/squid/.htpasswd rocky
systemctl daemon-reload ; systemctl restart squid.service
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
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
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Monday, February 13, 2023
How To Install Node.js npm ( Creating Sample app ) on Oracle Linux 9
Node.js is a JavaScript runtime for server-side programming. It allows developers to create scalable backend functionality using JavaScript, a language many are already familiar with from browser-based web development.
NPM is an acronym for Node Package Manager, which is the default package manager for Node.JS and the richest repository for Node.JS packages.
__________________________________________________________________________________________________________________________________
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
curl -sL https://rpm.nodesource.com/setup_16.x | bash -
dnf install nodejs -y
node --version ; npm --version
Creating Sample app on Node.js
nano myapp.js
const http = require('http');
const hostname = '0.0.0.0';
const port = 3000;
const server = http.createServer((req, res) => {
res.statusCode = 200;
res.setHeader('Content-Type', 'text/plain');
res.end('Hello World, running on NodeJS 1x');
});
server.listen(port, hostname, () => {
console.log(`Server running at http://${hostname}:${port}/`);
});
node myapp.js
http://127.0.0.1:3000
_________________________________________________________________________________________________________________________________