To add a default gateway to the route table in Red Hat Enterprise Linux (RHEL), CentOS, or Rocky Linux, you can use the ip command or modify the network configuration files. Here are both methods: Method 1: Using the ip Command Open a terminal or connect to the server via SSH. Use the following command to add a default gateway temporarily (until the next reboot): sudo ip route add default via <gateway_ip> Replace <gateway_ip> with the actual IP address of your default gateway. To make the change persistent across reboots, you can add the command to a startup script or create a new route configuration file. For example, create a new file in the /etc/sysconfig/network-scripts/ directory (e.g., route-enp0s3) and add the following line: GATEWAY=<gateway_ip> Save the file. Restart the network service to apply the changes: sudo systemctl restart network Method 2: Modifying Network Configuration Files Open the network configuration file for editing. This file is typically located in the /etc/sysconfig/network-scripts/ directory and named something like ifcfg-enp0s3 (replace enp0s3 with your actual network interface). sudo nano /etc/sysconfig/network-scripts/ifcfg-enp0s3 2. Add or modify the GATEWAY parameter with the IP address of your default gateway: GATEWAY=<gateway_ip> 3. Restart the network service to apply the changes: sudo systemctl restart network After following either of these methods, your default gateway should be set, and the changes will persist across reboots. Note: It’s important to replace <gateway_ip> with the actual IP address of your default gateway. If you’re unsure about the gateway IP, you can check your router or contact your network administrator. Here is the Demo: Add Default Gateway to Route table in Redhat / CentOs / RockyLinux To add default gateway to your routing table in any of the above OS use the following command. [root@Linuxking ~]# route add default gw 10.1.1.100 eth0 Note: Gateway machine’s IP is 10.1.1.100 and your ethernet is eth0 [root@Linuxking ~]# route -n Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 10.1.1.100 0.0.0.0 UG 0 0 0 eth0 However if you restart the network the route will be removed as well. So to make it persistent do the following Create a file [root@Linuxking ~]#vim /etc/sysconfig/network-scripts/route-eth0 and add the following lines 0.0.0.0/0 via 10.1.1.100 dev eth0 :wq (write and quit the vim) Now restart the network the route will be persistent. [root@Linuxking ~]# route -n Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 10.1.1.100 0.0.0.0 UG 0 0 0 eth0
Linux Tips
Dear Reader, Below you will find some important information & tips while working with the Linux OS. 1. Basic Terminal Commands: Linux primarily relies on the command line interface (CLI). For Examples: ls: List files and directories in the current location. cd: Change directory. pwd: Print the current working directory. mkdir: Create a new directory. touch: Create an empty file. rm: Remove files or directories (use with caution). cp: Copy files or directories. mv: Move or rename files or directories. cat: Display the content of a file. nano or vim: Text editors for creating and editing files. 2. File System Hierarchy: Understand the basic Linux file system hierarchy. The root directory is /, and important system directories include /bin, /usr, /etc, /home, and /var. 3. File Permissions: Get comfortable with file permissions using commands like chmod (change permissions) and chown (change owner). Permissions are usually represented as three sets of rwx (read, write, execute) for the owner, group, and others. 4. File Navigation Shortcuts: Use shortcuts like ‘.’ (current directory) and ‘..’ (parent directory) to navigate the file system more efficiently. 5. File and Directory Manipulation: Use cp to copy files, mv to move/rename files, and rm to remove files. Be cautious with rm as it can permanently delete files. 6. File Permissions and Ownership: Understand Linux file permissions (read, write, execute) and use chmod to modify them. Use ‘chown’ to change ownership of files and directories. 7. File Compression and Archiving: Know how to compress and decompress files using tools like tar (for archives) and gzip/gunzip (for compression). 8. File Searching: Use find to search for files and directories, and grep to search within text files. These are powerful tools for locating specific data. 9. File and Disk Space: Use df to check disk space usage and du to check directory space usage. Clean up unneeded files to free up disk space. 10. Package Management: Depending on your Linux distribution, use yum, dnf, apt, pacman or other package managers to install, update, and remove software packages. 11. User Management: Learn how to create, modify, and delete users and groups using commands like useradd, usermod, userdel, passwd, and groupadd. 12. Process Management: Use commands like ps (list processes), top (monitor system processes), kill (terminate processes), and bg/fg (background/foreground processes) to manage running tasks. 13. Backup Regularly: Make regular backups of important data. Linux offers various backup tools like rsync and tar. 14. System Information: Use commands like uname (kernel information), df (disk space usage), and free (memory usage) to check system resources. 15. Update Your System: Keep your system up to date with security patches and updates using your package manager. 16.Security: Practice good security habits, such as creating strong passwords, configuring firewalls, and disabling unnecessary services. 17. Networking: Learn basic networking commands like ifconfig / ip address (configure network interfaces), ping (test network connectivity), and ssh (secure shell for remote access). 18. Permissions and Ownership: Understand the importance of file permissions and ownership in maintaining system security. Avoid running commands as the root user unless necessary. 19. Logs and Troubleshooting: Check system logs in /var/log to diagnose issues. Common logs include syslog, auth, secure, and messages. 20. Managing Services: Learn how to start, stop, and restart services using commands like systemctl or service, depending on your distribution. 21. Text Editing: Become proficient with a text editors like vim, nano or emacs. These are essential for editing configuration files and scripts. 22. Basic Text Processing: Learn tools like grep for searching text, sed for text manipulation, and awk for text processing. 23. Environment Variables: Understand how to set and use environment variables. Common ones include PATH, HOME, and USER. 24. Wildcards/Regular expressions: Learn about wildcards & Regular expression like * (matches any characters) and ? (matches a single character) for pattern matching when working with files. 25. Redirecting and Piping: History: Use the up and down arrow keys to access previous commands. Tab Completion: Press Tab to autocomplete file and directory names. Pipes: Use | to combine the output of one command as the input to another. Redirection: Use > and < to redirect output and input, respectively. 26. Shell Scripting: Explore shell scripting using bash or another shell of your choice. This allows you to automate tasks and create custom scripts. 27. Package Documentation: Use man (manual) pages to access documentation for commands. For example, man ls will provide detailed information about the ls command. 28. Keyboard Shortcuts: Learn useful terminal keyboard shortcuts, such as Ctrl+C (interrupt), Ctrl+Z (suspend), Ctrl+D (end of file), and Tab (auto-complete). 29. Documentation and Community Support: Utilize online resources, forums, and communities for help and documentation. Linux has a vast and supportive user base. Remember Google is your best friend 🙂 30. Practice and Experiment: The best way to learn Linux is through practice. Create a virtual machine or use a spare computer to experiment and gain hands-on experience. Remember that Linux is a versatile and powerful operating system, and mastering it takes time and practice. Start with the basics and gradually delve into more advanced topics as you become more comfortable with the Linux environment. Thanks & Happy Learning 🙂 Tekco Team
Elastic File System (AWS EFS)
Hey guys, below you can find notes about EFS , my recent video on YouTube. I hope you would like it. If you like what i am doing, please share and spread the word. Thanks,Salman EFS1) Stands for Elastic File System2) It’s based on NFS [ Network File System ]3) EFS is a shared file system for Linux only.4) It can be shared between many EC2 Instances5) By default EFS is only for the VPC it’s provisioned into, However with support for inter-region VPCpeering,you can connect EC2 instances in one region to EFS file systems in another. This also helps to copy frequently-accessed data acrossregions to optimize performance, and synchronize data across AWS Regions for disaster recovery.6) EFS can be accessed over VPN or Direct Connect. Now Let’s start our Demo (Available on YouTube)For this purpose i have already two EC-2 instances in N Virginia region with different subnets in AZ us-east-1a and AZ us-east-1b If you are not sure how to create EC-2 instances please check my video about AWSEC-2 Refresher.Make sure that Security group is same for both instances and communication is allowed among both EC-2instances.*Note about Security Group & DNS1) Make sure VPC has DNS hostname & Resolution Enabled [If not you can go to VPC , click Action , then clickedit DNS hostname or resolution and select true.2) EC-2 Instances have the same Security Group3) Enable NFS TCP 2049 sg-06c1d9410caed84ec (itpings-secgrp-1) From local Security group Itpings4) Also Make sure that when creating EFS , click on Customize and make sure the correct security groups arechosen. ============================================================Few things to remember about EFS1) MAX IO is used for scaling and applications which require parallel operations and workloads.It has highthroughput but the drawback is it’s high latency2) General purpose: it is the one we will be using by default and is fine for most of our needs.Setting up EFS:From AWS Console type EFSClick Create File SystemThen give it a name and select your VPC (In our case it will be ITpings VPC)Click on Customzie [ Just to look at few things]Then check the modes. Click next, click Create. Then on the Network tab, check if the mount points areavailable. Wait for few mins.Once available long in to your EC-2 instancesand issue the following command on both EC-2 instances we created ealier.df -h to check if anything is mounted or notNow we need to install amazon-efs-utils , but we are using centos7 we would need to build it. For this purposeletsrun the below script on both ec-2 instances as root vim efs-utils.sh #!/bin/bash yum -y install git git clone https://github.com/aws/efs-utils cd efs-utils yum -y install rpm-build yum -y install make yum -y install rpm-build make rpm yum -y install ./build/amazon-efs-utils*rpm Change the permission chmod +x efs-utils.sh Now source the script as below # source efs-utils.sh Once installed confirm by giving the following command[root@ip-10-1-4-181 efs-utils]# rpm -qa amazon-efs-utilsamazon-efs-utils-1.29.1-1.el7.noarch Create a mount point # mkdir -p /mnt/efs-mp Now to make it permanentvim /etc/fstabfs-c4430b33:/ /mnt/efs-mp efs _netdev,tls 0 0 Note: fs-c4430b33 is filesystem id we created in Amazon EFS_netdev: It’s helps to mount the nfs system when system reloads.tls: transport layer securityNow mountmount /mnt/efs-mpIf you receive the below error[root@ip-10-1-5-54 centos]# mount /mnt/efs-mp/ WARNING: Your client lacks sufficient controls to properly enforce TLS. Please upgrade stunnel, or disable“stunnel_check_cert_hostname” in /etc/amazon/efs/efs-utils.conf.See https://docs.aws.amazon.com/console/efs/troubleshooting-tls for more detail. [root@ip-10-1-5-54 centos]#vim /etc/amazon/efs/efs-utils.confand set from true to falsestunnel_check_cert_hostname = falsesave and exit Repeat the same on other instance mount /mnt/efs-mp It should workCreate file and check on the both system.Done !!! Thanks, Salman Francis Website: https://www.tekco.net Like us on Facebook: https://www.facebook.com/linuxking77 Like us on Instagram: https://www.instagram.com/linuxking77 Twitter: @linuxking77 reddit: u/linuxking77
Automating Users and Passwords
Hey guys in this simple post i will show you how you could easily create passwords of multiple users with a simple script. !/bin/bash file=/user.txt for i in more $file do useradd $i newpass=mkpasswd echo “user $i added successfully” echo “$newpass” | passwd –stdin “$i” echo “password for user $i is $newpass” done Just create a file user.txt in / directory and add users to this file. give executable permissions to the file and run by typing e.g # sh file.sh Thanks, Salman A. Francishttps://youtube.com/linuxkinghttps://facebook.com/linuxking77Insta: Linuxking77Twitter: @Linuxking77
Cyber scams & Prevention
This document will help people understand what kind of famous Cyber scams exist and how to prevent yourself from falling for them. 1) Phishing 2) Vishing or voice mail scam 3) Email from CEO and CFO (Know as ) spear phishing or whaling 4) Smishing or Text message scam 5) Romance Scam 6) Social Media Scam 7) Tech and Email Support Mails 8) Robo Calling: 1) Phishing Scams: In this type of scam, a hacker will send an email to the victim with a clickable link. These emails will appear to come from major companies like facebook, vk, gmail, financial institution or even from the bank you are using for daily transaction. Even though these emails look completely similar to the one sent by legit companies, but in actual the links in these mails are kind of traps which are set by the scammer and hackers to steal the information. once the link is clicked, the victim will be directed to some fake website, which will ask for login and password. Once the user enters his / her details , the credentials are intercepted by the scammer or hacker. Solution: The solution is to delete such mails and avoid clicking the links. Most of the legit companies and financial institutions will never send mails asking to update your account or submitting sensitive information to fix account issues. The best bet would be to visiting the official site to check your information and If still unsure, making a phone call to the bank or company would save you from falling in the trap. Look at the url properly and make sure the website address is correct.Still not sure ? Contact IT Department immediately. 2) Text Message These scams are phone scams and are know as smishing. They are similar to phishing scam. In this type of scam the hacker or scammer will send you a text message , these messages will appear to come from a legit and established source however the links once clicked will ask for your personal information or funds. The personal information could be used to steal money or identity theft. Text message could appear like this: 1) Dear user, we wanted to offer 0% interest on new car. This could be your lucky day. We will also give you free iphone if you register today. Please click the link to accept this offer now ! 2) This is your “Bank” Support Team, Your account has been locked up due to suspicious activity. Please click the link below to confirm your identity and keep yourself safe. **note the 0 instead of o in the above link. 3) Message from postal service, that the parcel is available for pickup and click the link to update the information is correct. 4) Congratulations ! You have won the prize. Click the link to claim the prize now. Solution: Delete the message and block the number. Don’t give your personal details to anyone. Call your bank if you have clicked the link and want to make sure if you are still secure. 3) Vishing or voice mail scam: Vishing, or voicemail phishing, is the act of committing voicemail fraud to try to steal personal information. Similar to phishing. In vishing attack cybercriminals use an urgent or interesting voicemail message to try to get potential victims to call back with their personal information. Fake caller-ID information is often used to make the calls appear to be from a legitimate organization or business. Solution: Hangup the phone and block the number. Do not call back. 4) Spear Phishing or mail from CEO , CFO or Co Workers: Spear Phishing attacks target individuals with access to sensitive information such as people who have the ability to transfer funds( most particularly Finance / Accounts Departments) Spear-phishing emails typically appear to come from someone the target knows, such as a co-worker at their company or another business in their network. Whaling is a spear-phishing attack that specifically targets senior executives at a business. Solution: This kind of attack requires special attention. Let’s take a look at them one by one. 1) check for signs the sender is who they claim to be: 2) Look at the “from” field. Is the person or business’s name spelled correctly 3) does the email address actually match the name of the sender? Or are there a bunch of random characters in the email address instead? 4) does the email address seem close, but a little different? e.g Microsft.net, or Microsoft.co. Instead of microsoft.com 5) Remember not to click any links 6) Does the sender address you by name? “Customer” or “Sir” 7) Is it generally free from spelling errors or odd grammar? 8) What kind of tone the message has. Is it overly urgent or it’s a normal communication? If you think the message passed all the above test but you are still suspicious, the best way to beat such attacks are to call the person or contact IT Department immediately. 5) Tech Support Scam: The scammer will call / text / mail you as a representative of a major tech / IT company such as Microsoft / Oracle / Apple etc and will warn that your computer is being infected with a malware. While in reality there is no problem. Once you reply to the scammer , he might ask for a Remote access to solve the issue. Instead of solving the problem he will lock you out of the computer / encrypt your data and then ask for money, in case you need your data back. Sometimes the scammers will fix the problem but install a malware as a backdoor for future control and hack. Solution: Delete the mail or hangup if you receive such call. These companies will never call the consumer by themselves. Do not browse insecure sites. Do not click links sent by an unknown person. Do not give remote control access to any unknown person. 6) Social Media: You could receive a text
Setup a WordPress Website in 5 mins
Enjoy the Video below, Blog post coming soon ! Link to Download the Script: https://github.com/linuxking77/lampstack **Note: Once you have downloaded the script , rename it from .txt to .sh and give it executable permission with chmod +x lampstack.sh **Note: People who would setup the server on EC-2 need to make sure that the security group is allowing all the ports related to, http and https. Facebook: https://www.facebook.com/linuxking77 Instagram: linuxking77 Twitter: linuxking77 Web: https://www.tekco.net Blog: https://www.tekco.net/?page_id=1446 Don’t forget to Subscribe Thank you !!
Installing Python3 & pip in AWS EC-2 Instance
In this article we will see how to install python 3 and python pip in AWS EC-2 instance. CentOS 7 First step Installing epel repository [root@mail centos]# yum -y install epel-release Installing python3 [root@mail centos]# yum -y install python3 Then download the script from pypa.io [root@mail centos]# curl -O https://bootstrap.pypa.io/get-pip.py % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 1842k 100 1842k 0 0 6600k 0 –:–:– –:–:– –:–:– 6604k To install pip for everyone type the following command [root@mail centos]# python3 get-pip.pyCollecting pipDownloading pip-20.3.3-py2.py3-none-any.whl (1.5 MB)|████████████████████████████████| 1.5 MB 14.9 MB/sCollecting wheelDownloading wheel-0.36.2-py2.py3-none-any.whl (35 kB)Installing collected packages: pip, wheelAttempting uninstall: pipFound existing installation: pip 9.0.3Uninstalling pip-9.0.3:Successfully uninstalled pip-9.0.3WARNING: The scripts pip, pip3 and pip3.6 are installed in ‘/usr/local/bin’ which is not on PATH.Consider adding this directory to PATH or, if you prefer to suppress this warning, use –no-warn-script-location.WARNING: The script wheel is installed in ‘/usr/local/bin’ which is not on PATH.Consider adding this directory to PATH or, if you prefer to suppress this warning, use –no-warn-script-location.Successfully installed pip-20.3.3 wheel-0.36.2 Add the executable path, ~/.local/bin, to your PATH variable [root@mail centos]# export PATH=/usr/local/bin:$PATH Now you should be able to call pip directly [root@mail centos]# pip –versionpip 20.3.3 from /usr/local/lib/python3.6/site-packages/pip (python 3.6) Done Thank you for viewing my article.If you like what i am doing , please subscribe to my youtube channel and comment. Let me know if you would like to see an article of your choice.Please share with your friends and family. Thanks, Salman Francis https://www.youtube.com/linuxkinghttps://www.tekco.nethttps://www.facebook.com/linuxking77Twitter: @linuxking77Instagram: linuxking77
Create an Email Server in 5 mins for Email Marketing
Hey guys hope you are all doing good. Today i am gong to write a very interesting article in which i will show you how to set up your very own fully functional Email server for Email Marketing and of course to use the server as your very own email server for office or personal use. YouTube video can be found here: Also I would like to wish all of you a very happy new year, may the next year be filled with joy and happiness for all of us. So lets start. Before we setup the mail server, there are certain prerequisites. Security Group on EC-2 Once you have all in place lets setup our mail server with the script i already created. You can download the script from here: https://github.com/linuxking77/emailserver/archive/main.zip Once you have downloaded the script change the extension fron .txt to .sh then give it executable permissions. e.g EmailServer# mv emailscript.txt emailscript.sh EmailSever# chmod +x emailscript.sh then run the script as root with the following command EmailServer# sh emailscript.sh Once you start the script it will ask you couple of questions such as domain name, hostname, internal ip address (in case you are setting it on EC-2 instance in AWS and External IP Address in case you are setting it on your self hosted machine) After answering the questions you sit back and relax and let script do all for you. Once all is completed successfully , you can open webbrowser and type http://<yourdomain>?Admin This will bring you to the following screen. The credentials are: username: admin Pass: 12345 First thing what you would do is to change the password from 12345 to something strong. Then Click on Domain in the left panel and add the domain as show below: Click on Test and if all Goes well, you would see IMAP and SMTP in Green Color. Now you need to create a user in your Linux Mail Server , i have created two itpings and superman Once users are created, open the web browser and type http://<yourdomain>.com This time give the credentials of your user as following and you will login to send and receive emails. If you like what i am doing, please consider liking my Youtube Channel Thanks, Salman A. Francishttps://www.tekco.netYoutube: https://www.youtube.com/linuxking
How to Create Linux USB from Command Line
Hey guys in this short tutorial i will show you how simple it is to create a linux usb from command line. We have already have CentOS 7 iso image on our computer( which we downloaded earlier from Centos website). To list your usb issue the command salman@Sal-Linux:~/Downloads$ lsblk sde 8:64 1 28,9G 0 disk ├─sde1 8:65 1 1,8G 0 part /media/salman/Linux Mint 20 Xfce 64-bit ├─sde2 8:66 1 3,9M 0 part └─sde3 8:67 1 27,1G 0 part /media/salman/writable As you can see , my usb is sde and has a Linux Mint image, however i would like CentOS 7. To burn CentOS 7 image on the usb issue the following command: root@Sal-Linux:/home/salman/Downloads# dd if=/home/salman/Downloads/CentOS-7-x86_64-Minimal-1804.iso of=/dev/sde oflag=direct bs=1048576 Where: /dev/sde is my USB driveof = output file to write toif = input file to read frombs = This option enables dd command to read and write bytes per block, default size is 512 Bytes, I am using around 1 MB. oflag = directUse direct I/O for data, avoiding the buffer cache. Note thatthe kernel may impose restrictions on read or write buffersizes. For example, with an ext4 destination file system anda Linux-based kernel, using ‘oflag=direct’ will cause writesto fail with ‘EINVAL’ if the output buffer size is not amultiple of 512. Thanks,Salman A. Francishttps://www.tekco.nethttps://www.youtube.com/linuxking
Setting up NextCloud on Centos 8 with Apache, Redis, PostgreSql, SSL & PhP 7.4
In this How we are going to setup our very own working NextCloud. So without wasting our time , lets start. We need a working CentOs 8 Linux distro. If you don’t know how to install it, Follow my youtube video [ https://youtu.be/I2dS_pCPhKw ] Once we have our working CentOs 8, perform the following task: Install Epel- Repo [root@docserver ~]# yum -y install epel-release Update the Server [root@docserver ~]# yum -y update Install Apache & some important tools & utilities. [root@docserver ~]# yum -y install httpd yum-utils unzip policycoreutils-python-utils mlocate bzip2 tar vim wget [root@docserver ~]# httpd -v Server version: Apache/2.4.37 (centos) Server built: Sep 15 2020 15:41:16 Start and enable Apache [root@docserver ~]# systemctl enable httpd Created symlink /etc/systemd/system/multi-user.target.wants/httpd.service → /usr/lib/systemd/system/httpd.service. [root@docserver ~]# systemctl start httpd Create a Virtual host [root@docserver ~]# vim /etc/httpd/conf.d/nextcloud.conf <VirtualHost *:80> DocumentRoot /var/www/html/nextcloud/ ServerName docserver.itpings.com <Directory> Require all granted AllowOverride All Options FollowSymLinks MultiViews <IfModule mod_dav.c> Dav off </IfModule> </Directory> </VirtualHost> :wq save and quit Install mod_ssl [root@docserver ~]# yum -y install mod_ssl Adding firewall rules for port 80 and 443 [root@docserver ~]# firewall-cmd –add-port=80/tcp –permanent [root@docserver ~]# firewall-cmd –add-port=443/tcp –permanent [root@docserver ~]# firewall-cmd –reload Add User for NextCloud Server [root@docserver ~]# useradd nextcloud [root@docserver ~]# passwd nextcloud ********* ********* [root@docserver ~]# usermod -a nextcloud -G wheel [root@docserver ~]# id nextcloud uid=1001(nextcloud) gid=1001(nextcloud) groups=1001(nextcloud),10(wheel) Download NextCloud in zip or tar format [root@docserver opt]# wget https://download.nextcloud.com/server/releases/nextcloud-20.0.1.zip Create Directory nextcloud inside /var/www/html [root@docserver opt]# mkdir /var/www/html/nextcloud [root@docserver opt]# cd /var/www/html/nextcloud [root@docserver nextcloud]# pwd /var/www/html/nextcloud Here Create data directory [root@docserver nextcloud]# mkdir data Uncompress nextcloud-20.0.1.zip [root@docserver opt]# unzip nextcloud-20.0.1.zip copy the content of nexcloud folder to /var/www/html/nextcloud Now Make sure you set the permission properly [root@docserver var]# chown apache:apache -R www/ [root@docserver var]# chmod 775 -R www/ [root@docserver var]# systmectl restart httpd Installing PHP 7.4 Downoading rpm from Remi Repo [root@docserver ~]# yum -y install https://rpms.remirepo.net/enterprise/remi-release-8.rpm Enable Remi Repo [root@docserver ~]# yum module reset php [root@docserver ~]# yum -y module install php:remi-7.4 Now install required php modules [root@docserver ~]# yum -y install php-mbstring php php-gd php-intl php-pecl-apcu php-opcache php-json php-pecl-zip php-pear php-pecl-imagick php-fpm php-pecl-redis5 php-pgsql php-common php-pdo php-xml php-lz4 php-pecl-crypto php-pecl-rar php-pecl-pq php-pecl-lzf php-cli php-pecl-apcu-bc Installing REDIS [ Opensource Cache ] [root@docserver ~]# yum -y install redis [root@docserver ~]# systemctl enable redis Created symlink /etc/systemd/system/multi-user.target.wants/redis.service → /usr/lib/systemd/system/redis.service. [root@docserver ~]# systemctl start redis Installing PostgreSQl **Note: [ All details of how to install Available on postgresql.org/download/linux/redhat page ] Downloading postgresql rpm from external repo [root@docserver ~]# yum install https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm Now Disable PostgreSQL from CentOS repository [root@docserver ~]# yum module disable postgresql Failed to set locale, defaulting to C.UTF-8 PostgreSQL common RPMs for RHEL/CentOS 8 – x86_ 840 kB/s | 476 kB 00:00 PostgreSQL 13 for RHEL/CentOS 8 – x86_64 446 kB/s | 184 kB 00:00 PostgreSQL 12 for RHEL/CentOS 8 – x86_64 895 kB/s | 408 kB 00:00 PostgreSQL 11 for RHEL/CentOS 8 – x86_64 1.2 MB/s | 598 kB 00:00 PostgreSQL 10 for RHEL/CentOS 8 – x86_64 865 kB/s | 403 kB 00:00 PostgreSQL 9.6 for RHEL/CentOS 8 – x86_64 869 kB/s | 392 kB 00:00 PostgreSQL 9.5 for RHEL/CentOS 8 – x86_64 707 kB/s | 346 kB 00:00 Dependencies resolved. Package Architecture Version Repository Size Disabling modules: postgresql Transaction Summary Is this ok [y/N]: y Complete! Now Installing Postgresql from External Repo [root@docserver ~]# yum install -y postgresql13-server Initialize the database and enabling it [root@docserver ~]# /usr/pgsql-13/bin/postgresql-13-setup initdb Initializing database … OK [root@docserver ~]# systemctl enable postgresql-13 Created symlink /etc/systemd/system/multi-user.target.wants/postgresql-13.service → /usr/lib/systemd/system/postgresql-13.service. [root@docserver ~]# systemctl start postgresql-13 Setup password and switching user [root@docserver ~]# passwd postgres Now switch to postgres user [root@docserver ~]# su -l postgres Entering Database [postgres@docserver ~]$ psql psql (13.1) Type “help” for help. postgres=# Creating Database user and Database for NextCloud postgres=# create user nextclouduser with password ‘abc123’; CREATE ROLE Create a database postgres=# create database nextclouddb; CREATE DATABASEne Give NextCloud user rights to access the database. postgres=# grant all privileges on database nextclouddb to nextclouduser; GRANT Now exit postgres=# \q [postgres@docserver ~]$ exit logout Make sure the following is enabled in PostgreSql Config Now we need to enable connection [root@docserver ~]# vim /var/lib/pgsql/13/data/pg_hba.conf IPv4 local connections: host all all 127.0.0.1/32 scram-sha-256 [ we can check with md5 as well ] [root@docserver ~]# systemctl restart postgresql-13 Now we would install Lets Encrypt for SSL [root@docserver nextcloud]# yum install snapd [root@docserver nextcloud]# snap install core [root@docserver nextcloud]# systemctl start snapd [root@docserver nextcloud]# systemctl enable snapd [root@docserver nextcloud]# ln -s /var/lib/snapd/snap /snap [root@docserver nextcloud]# snap install –classic certbot [root@docserver nextcloud]# certbot –apache Follow the instructions and thats it ! Open your Browser and type the ip address https://<youripaddress.com> of your machine and give details and complete the setup. You will see Screen like this to login Congratulations ! Thank you Salman A. Francis https://www.youtube.com/linuxkinghttps://www.tekco.net