Protected Directory Users

Hi there,

I'm a bit baffled about how to add a user to a protected directory. I've had no problem designating a directory as protected via "Services | Protected Directories" under the domain in question.

However, going to "Edit Users | Add a user to this server" takes me to a screen to add a "Virtual domain user mailbox", along with a sub-heading for "Email settings" and "Login permissions" of "Email only" under the sub-heading "Other user permissions". I have disabled everything I can find in Virtualmin regarding email because I host the mail for all domains on a completely discrete non-Virtualmin server, so it's a source of frustration -- and has been since day one that I haven't had time to bring up yet -- that there are still so many reference to email inside Virtualmin, leading to questions from users about adding email under Virtualmin.

Going to "Edit Users | Add a website FTP access user" is no better, as it also relies on a user name based on an email address, and I don't want an Apache HTTP user to have an FTP account and a home directory or, vice versa, I don't want to give an Apache HTTP user access to an FTP account on the server.

That aside, is there no way for me to add a username "bob" and a password "password" for a protected directory? Must the user name be an email address that, in reality, is not actually an email address? Does it have to be an FTP account? Am I doing this wrong?

Thanks in advance.

Craig

Status: 
Active

Comments

Make sure that at System Settings -> Features and Plugins that the "Protected Web Directories" plugin is installed and enabled.

Hi Jamie,

Yes, it's there and enabled.

Craig

Hmm .. in that case, all directories defined at Services -> Protected Directories should show up on the Edit User page under Other Permissions, to be grantable to the user.

What does /etc/webmin/htaccess-htpasswd/directories contain on your system?

Hi Jamie,

Thanks for your reply. Yes, what you describe is there, and the file to which you refer exists and contains lines like these for domains for which there are no additional protected directories:

/home/USERNAME/public_html/stats        /home/USERNAME/.stats-htpasswd  0       0
/home/USERNAME/awstats  /home/USERNAME/.awstats-htpasswd        0       0

Lines for domains which do have additional directories protected besides the default statistics directories have additional lines which look like this:

/home/USERNAME/public_html/DIRECTORY        /home/USERNAME/public_html/DIRECTORY/htusers        0       0

... where "DIRECTORY" is the name of the protected directory.

I have, obviously by the information above, managed to create users for protected directories in the past (although I don't remember exactly how I did it, because it was months ago now), but I am still genuinely confused by what I describe in my original post, that being the seeming addition of "@example.com" to a user name, and the connections made -- when setting up what is supposed to be just an Apache HTTP user -- with email addresses and FTP accounts, especially on a server that doesn't host a single email account on a virtually-hosted domain.

Digging around I came across the post at "no way to edit users for protected directories under virtualmin -> services -> protected directories" which pointed me to "Webmin | Others | Protected Web Directories | Add a new user", which seems to be exactly what I wanted -- i.e., no messing around with adding email and FTP users. Logging into Virtualmin as a regular user I now see that I can access the same interface at "Webmin Modules | Protected Web Directories", so the solution to the original source of my frustration was there all along, I just didn't know it.

I don't know how I ended up at "Virtualmin | Edit Users" to add Apache HTTP users, whether it was documentation somewhere that led me to that or if I just assumed it would be there. Assuming the wiki at http://doxfer.webmin.com is active, I will sign up for an account and add some text to http://doxfer.webmin.com/Webmin/Protected_Directories that directs people to "Webmin | Others | Protected Web Directories" or (as a regular user) to "Webmin Modules | Protected Web Directories".

So you can consider this resolved, and I apologise for the noise. However, two things you can take from this might be the following:

  • Add something to the page at "Virtualmin | Services | Protected Directories" linking to (or telling users about) "Webmin | Others | Protected Web Directories" or (as a regular user) "Webmin Modules | Protected Web Directories" as being the right place to add Apache HTTP users. (I'm using the Authentic theme, if that's relevant.)

  • Eliminate the last vestiges of references to mail, mail accounts, etc., when all features related to email hosting have been disabled. Perhaps, to make a dramatically over-simplified suggestion, a big red "email will be hosted elsewhere" button at "Virtualmin | System Settings | Virtualmin Configuration" that causes all but the minimum required mail features to be disabled and references to be removed from the interface might be an idea. :)

Thanks for your time.

Craig