let us see the demo for .htaccess file, so we will go to our master system, in master system.
We are going to go into our /var/www/html/example1 directory.
We will clear this with pwd.
You can verify that we are in directory only one file is there.
Now we are going to create .htaccess file, we can create it with your cat command.
Also, the name of the file should be always should be .htaccess.
Then we are going to specify that parameter, AuthType is.
Basic, then you have got AuthName.
we going to specify
Restricted
you can write anything.
Restricted
access.
Then we are going to specify the name of the file AuthUserFile, then name of the file, that name
of the file is /etc/httpd/webpass.
This is the file name then we are going to specify Require user.
in our case anntika and second user is your nanu.
we are going to save this file with a ls command.
It will not be visible.
So we have to write ls -a because it shows you the hidden files also.
Then we can verify that also how we are going to verify we can again open that is showing you all the
4 lines.
Then we have to edit the /etc/httpd/conf/httpd.conf file.
so we will go to the end, so we are going to remove these lines because we do not need so
instead of that what we are going to type, we are going to write one parameter.
That means we will remove these things.
So what we are going to we are going to make one entry.
What is that entry AllowOver.
ride.
Spelling you have to AllowOverride then we are going to specify AuthConfig this is the setting
that we are going to make in our file, again always a double verify whether your spelling are.
OK, then please do not make changes.
One another module is there, your route module is there.
Let me show you, there is one setting this.
Please do not make changes here because this will make your system vulnerable.
So we will close this file, then we will view the last four lines.
So we can check whether entries are okay or not.
So these are our entries then what we are going to do, we are going to test with which command.
this syntax is okay, then we are going to reload the restart this systemctl restart httpd.
So now we have configured our system according to what are needed for that .htaccess