For Apache basic authentication the following configuration must be present:

Make sure Apache loads these modules (this should be in your httpd.conf):

    LoadModule auth_basic_module modules/mod_auth_basic.so
    LoadModule authn_file_module modules/mod_authn_file.so
    LoadModule authz_user_module modules/mod_authz_user.so

In your virtualhosts, where ever you need to protect a URL path, you need a configuration like this:

    <Location /protected/url>
        AuthType Basic
        AuthName "Authentication Required"
        AuthUserFile "/path/to/.htpasswd"
        Require valid-user
    </Location>

The .htpasswd file can be created in the directory using a command like this:

    htpasswd -c .htpasswd <username>

You will be asked to provide and confirm a password for user <username>.