Create password file for basic Apache authentication
Answer:
To create password file for basic Apache authentication, you need to use the htpasswd command.
# htpasswd -c /var/www/.htpasswd john
After entering the password, the htpasswd command will create the password file (.htpasswd) in the folder /var/www for user john.