Configure protected directories in Apache - Task Failed

Hello All,

Configure protected directories in Apache - Task Failed
Would like to know reason for failing on this

@Inderpreet - Could you please look into this

A Screenshot would have been more helpful. Anyways i will try to guide you with the steps.

  1. Creating directory is simple
  2. Adding user:
    htpasswd -c /etc/httpd/.htpasswd
  3. Create basic .htaccess file
    cat /var/www/html/itadmin/.htaccess <----------- itadmin is the new directory created
    AuthType Basic
    AuthName “Restricted Content”
    AuthUserFile /etc/httpd/.htpasswd
    Require valid-user
  4. Update the httpd configuration file with this entry
    cat /etc/httpd/conf/httpd.conf
    <Directory “/var/www/html/itadmin”> <--------- itadmin is the new directory name
    AllowOverride AuthConfig
  5. Scp /tmp/index.html file from jumpbox to app server (/var/www/html/itadmin/index.html).
  6. Restart httpd service
  7. Test connectivity
    curl -u yousuf:GyQkFRVNr3 http://stapp01:8080/itadmin/
    where yousuf is the new user created followed by password

Hope this helps.

Hi @ramashish.sharma @Inderpreet ,

I have got same error again
Please find below file details added in .htaccess
task

Hey Nagesh,

Please share your httpd.conf file and also the error screenshot. The screenshot shared will not give any clues. There are multiples things to be checked as i have updated you above.

You need to share all your steps screenshot along with the error you are getting.

Hi @ramashish.sharma,

Task is failed, I will not be able to provided required details

Could you please let us know the link or doc you followed .

@Inderpreet -> Could you please check and let me know what wrong was done

Thank you
Nagesh

Nagesh,

There is no single link or document I referred, I just googled and referred multiple places and tried to put the solution as per questions asked.

Either admin or Inderpreet may check ur work log and see what wrong you did.

Ramashish ,

Thank you for update
@Inderpreet -> If you can help here it will be useful