Would you like to learn how to install Apache and configure the basic authentication feature on a computer running Ubuntu Linux? In this tutorial, we are going to configure the Basic authentication feature on the Apache server.
• Ubuntu 18
• Ubuntu 19
• Ubuntu 20
• Apache 2.4.41
Copyright © 2018-2021 by Techexpert.tips.
All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means without the prior written permission of the publisher.
Equipment list
The following section presents the list of equipment used to create this tutorial.
As an Amazon Associate, I earn from qualifying purchases.
Apache – Related Tutorial:
On this page, we offer quick access to a list of tutorials related to Apache.
Tutorial Apache – Basic authentication
Install the Apache server and the required packages.
Create the Apache password file and add the first user account.
The system will request you to enter the password to the new user account.
Here is the file content.
To create additional user accounts, use the following command.
Edit the Apache configuration file for the default website.
Insert the following line in the area named: VirtualHost.
Here is the file content.
Restart the Apache service.
Open your browser and enter the IP address of your web server.
In our example, the following URL was entered in the Browser:
• http://172.31.8.195
The Apache server will require you to perform the user authentication.
In our example, the configuration will require user authentication to access any part of the website.
In the next example, we will require authentication only to users trying to access a subdirectory named: SECURE.
Congratulations! You are now able to use the Apache basic authentication.