This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| faq:web04 [2015/11/13 16:41] – Since htpasswd is not in $PATH by default and "locate" don't find it, i think it is a good idea to use absolut path here. alex | faq:web04 [2015/11/13 16:46] (current) – alex | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | < | ||
| + | [04] CAN I PASSWORD PROTECT MY DIRECTORIES? | ||
| + | Yes you can. You can create usernames and passwords for | ||
| + | | ||
| + | |||
| + | | ||
| + | |||
| + | 1. Create a file called ' | ||
| + | want to protect (NOTE, its not a directory in your | ||
| + | HOME directory, but on the /www file system). Double check with 'pwd -P' | ||
| + | |||
| + | AuthUserFILE / | ||
| + | AuthGroupFILE /dev/null | ||
| + | AuthNAME "my protected files" | ||
| + | AuthTYPE Basic | ||
| + | require valid-user | ||
| + | <limit GET POST PUT> | ||
| + | order allow,deny | ||
| + | allow from all | ||
| + | </ | ||
| + | |||
| + | 2. run the ' | ||
| + | |||
| + | / | ||
| + | |||
| + | You will be prompted to enter a password for the | ||
| + | new user. After this first user is created, you | ||
| + | can then add additional users with: | ||
| + | |||
| + | / | ||
| + | |||
| + | When you run ' | ||
| + | only yourself and the webserver can read, execute and possibly | ||
| + | | ||
| + | | ||
| + | </ | ||
| + | [[faq: | ||