hello all, I'm a little new to this, but it's not too hard. I'm reading this: https://cwiki.apache.org/confluence/display/HTTPD/PasswordBasicAuth the question I have, since it is not completely clear about what it's telling me to do is, can anyone here point me to some web resources where I can find an example of someone that has already done this? by "this" I mean set up authentication for users and passwords in a domain's .htaccess file and assigned different users' permissions to different directories on the server? thanks! Adam
It is well explained in the Apache documentation you sent. First you have to create a password file using the `htpasswd` utility: htpasswd -c /etc/.htpasswd user Code (markup): where `/etc/.htpasswd` can be any path on your server, and `user` will be the username used to access the protected directory. This will prompt you to enter a new password for `user` twice: New password: Re-type new password: Adding password for user Code (markup): Go to the directory that you want to be password protected and create a `.htaccess` file with the following content: AuthType Basic AuthName AuthUserFile /etc/.htpasswd Require user Code (markup): Make sure that the `AuthUserFile ` and `Require` variables are set properly. That's all!
hey thanks so much! but one other question for you if you don't mind....all of this stuff is supposed to be done through the server's command line, correct? because this same goal can be accomplished using PHP scripting. I can also do *most* of it through a hosting company's cPanel.
Yes, this has to be done through the command line. If you have cPanel installed on the server, you can do it through the control panel, as described in cPanel's documentation.
Rose, the instructions for cPanel that you provided to me does *not* do what I need. the reason being is because of what it says: I already tried that approach and that can't work. I have many subdirs that are at the same level of the tree and each subdir has to be protected with different passwords. thus, the concept of "protecting each subdir automatically"won't work. so I think I'll go with the command line approach. thanks!