Skip to main content

Posts

Showing posts with the label Linux Basics

How to change document root in Apache configuration

Below are the steps to change document root in Apache(Web server) configurations - [root@rhcsa107 rakesh]# mkdir /web [root@rhcsa107 rakesh]# ls -ld /web/ drwxr-xr-x. 2 root root 22 Apr  3 08:45 /web/ [root@rhcsa107 rakesh]# vim /etc/httpd/conf.d/rakesh.conf DocumentRoot /web <Directory /web> Require all granted </Directory> Save exit from from this file. [root@rhcsa107 rakesh]# systemctl restart httpd.service Check HTTPD status, it must be running as below -  [root@rhcsa107 rakesh]# systemctl status httpd.service ● httpd.service - The Apache HTTP Server    Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)    Active: active (running) since Fri 2020-04-03 09:19:46 EDT; 6min ago      Docs: man:httpd.service(8)  Main PID: 10064 (httpd)    Status: "Total requests: 5; Idle/Busy workers 100/0;Requests/sec: 0.0129; Bytes served/sec:   9 B/sec" ...

Forbidden The requested URL /lw.html was not found on this server.

Forbidden You don't have permission to access /web.html on this server. If you get above error message while configuring 'Apache web server', then you can fix this error using with below configuration changes - Just add Require all granted in Apache configurations as below - [root@rhcsa107 rakesh]# vim /etc/httpd/conf.d/rakesh.conf DocumentRoot /web <Directory /web> Require all granted </Directory> [root@rhcsa107 rakesh]# apachectl -t Syntax OK [root@rhcsa107 rakesh]# [root@rhcsa107 rakesh]# systemctl restart httpd.service [root@rhcsa107 rakesh]# systemctl status httpd.service

Introduction - Day -1

We will start this training on RHEL7.3 Normally there are 3 ways to interact with any OS- 1. GUI(graphical user interface) - In simple words we can say interacting with OS using mouse. This the same way you are interacting with Windows. 2. CLI(Command line interface) - In this way user can't use mouse because there we don't have any graphics(icons/buttons) so that you can double click and open the things and select etc. 3. API(Application programming interface) - Normal user don't this, it is specially for developers Here I'll talk about CLI, whatever things you do in GUI, 99% of them you can do from CLI as well. The beauty of CLI is that we can do the things very fastly and also it requires very limited/less resource(compute unit or we can say RAM/CPU etc..). Let's take an example how CLI is faster than GUI- Use case: Open 100 terminals - This task can be completed in two way (A) - GUI(Right Click on home screen and then select open terminal, same thi...

How to setup your own technical lab?

If you are doing some technical training and for practice depended on institute's lab. Then this post would be very much helpful for you. I've prepared two videos for this and both are available on my  you tube channel , I've explained each and every step in detail. Please check and feel free to comment and revert in case of issue and suggestions. PART -1 -  https://www.youtube.com/watch?v=9j4KvjHyzxc&t=96s PART -2 -  https://www.youtube.com/watch?v=T4ljH9dYfNY&t=68s Download ISO -  https://drive.google.com/uc?id=0B9ZGwX0D1ZA1UmJFWEYyamRMLTQ&export=download

LVM - Logical Volume Manager

This post will help you to know about below, What is the use of LVM? What is LVM? How to create LVM? How to do LVM resize? Why by default root partition is create using LVM? How to diagnosis and troubleshoot LVM issues? Let's suppose you have three hard disk of below size- Hard disk1 - 100GB Hard disk2 - 200GB  Few usage of LVM(use cases)? 1. Total available storage in your system is 300GB, and you have a requirement to store a file of size 250GB without split/cut. However total space is available in the system but you can't store that file because you don't have a single slot of 250GB. 2. Let's suppose you have a 250 GB file and want to store in your system, but 250GB space is not available in the system, so that you need to increase your partition size. 3. Let's suppose you have two partitions in your system /dev/sda1 and /dev/sda2, due to some requirement you want to reduce the size of /dev/sda2 and want to increase the size of /dev/sd...