Make apache ask for username and pswd when accessing directo

Issues related to applications and software problems
Post Reply
altiris
Posts: 334
Joined: 2013/05/31 01:27:50

Make apache ask for username and pswd when accessing directo

Post by altiris » 2015/05/30 22:03:07

Looking for a quick newb solution, I have a main page when accessing the Web server that is full of hyperlinks, they essentially just send them to other folders/files located in /var/www/html I would like to restrict access to some of these links by having a username and password prompt, how can I go about doing this? I used to be able to do this on a windows 2000 server.

aks
Posts: 3073
Joined: 2014/09/20 11:22:14

Re: Make apache ask for username and pswd when accessing dir

Post by aks » 2015/05/31 07:38:19

Quick solution? Well you can use .htaccess - see http://www.javascriptkit.com/howto/htaccess.shtml
That assumes Apache though. If you're using IIS then you're posting in the wrong forum.

altiris
Posts: 334
Joined: 2013/05/31 01:27:50

Re: Make apache ask for username and pswd when accessing dir

Post by altiris » 2015/06/02 00:30:08

aks wrote:Quick solution? Well you can use .htaccess - see http://www.javascriptkit.com/howto/htaccess.shtml
That assumes Apache though. If you're using IIS then you're posting in the wrong forum.
I was about to come here and answer this post and then realized I was the one that made the question. I actually did it a different way and I thought id share it incase anyone else wanted to do the same.

I followed this, http://www.server-world.info/en/note?os ... httpd&f=12
and changed the /var/www/html/auth-pam directory to where the page I wanted to ask password was, so for example if its something like "FTP" it would be /var/www/html/ftp and that was it.

I haven't had luck with getting .htaccess to work on centos, maybe I didnt fix the permissions or something.

Post Reply