| How to just: | Categories: Technical | Food | design | Other | All |
|
How to password protect an apache directory Description:You want to password protect a website? directory on a website? This is how. So you want to password protect a directory on a website, do you? You need to create a file called ".htaccess", and you want to create this in the directory that you're protecting. We'll use howtojust.com as an example for this. Say that I have a directory on howtojust called "secrets", which is located at /var/www/howtojust/htdocs/secrets/ This is what I would do.
(vim works better!).htaccess should look like this:
substitute "howtojust" and "secrets" with whatever the values for your website are.You'll also need a file called ".htgroup"
That's it. Just the name of a group, followed by a : followed by the username you want them to haveNow you need a file called .htpasswd do it like this:
It will prompt you for the password, then you'll confirm it...and that is it! Try opening your directory now and you'll be prompted for a password. If you followed exactly what I did, you'd type "gandalf" and then whatever password you put in after htpasswd good luck! Link to this Be sure to check out our other project, Thingist - Things you love Looking for other Technical articles? Here is another random article from this category: How to get into the menu on an Intermec 2435 handheld The menu on the intermec 2435 handheld is where you change the wifi and terminal settings. This shows you how to get into the menu on the intermec 2435. Read More |