How to create Apache htpasswd file in Linux OS?

What is htpasswd?

At times during web development, we will need to prevent the whole world from being able to access a particular website. That’s when Apache htpasswd comes into the picture. htpasswd is usually used together with htaccess.

Tutorial

This tutorial will teach you how to create a htpasswd file using command line.

Creating a htpasswd for the first time

Example

Appending new user to existing htpasswd file

Example

Using htpasswd in htaccess

 

That’s it you are done!

Leave a Reply

Your email address will not be published. Required fields are marked *

one × 3 =