You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The document root /var/www/html of all web apps is on NFS share /data on storage server in Stratos Datacenter. We have a requirement where we want to password protect a directory in the Apache web server document root.
We want to password protect http://:<apache_port>/protected
URL as per the following requirements (you can use any website-url for it like localhost since there are no such specific requirements as of now):
a. We want to use basic authentication.
b. We do not want to use htpasswd file base authentication. Instead, we want to use PAM authentication, i.e Basic Auth + PAM so that we can authenticate with a Linux user.
c. We already have a user jim with password Rc5C9EyvbU which you need to provide access to.
d. You can access the website on LBR link. To do so click on the + button on top of your terminal, select Select port to view on Host 1, and after adding port 80 click on Display Port.
Click on ✔ and Do Task Again
Solution:
Do these task in all app servers(stapp01, stapp02, stapp03)
At first install pwauth
sudo yum --enablerepo=epel -y install mod_authnz_external pwauth
### Then Edit the config
sudo vi /etc/httpd/conf.d/authnz_external.conf
sudo mkdir -p /var/www/html/protected
# Open the index.html file.
# you will found protected directory message
sudo vi /var/www/html/protected/index.html
# Restart and check status of httpd
sudo systemctl restart httpd
sudo systemctl status httpd
# Finally check from
# curl command with mentioned username and password
curl -u jim:Rc5C9EyvbU http://localhost:8080/protected/
I get error when starting the httpd service: invalid command AuthName