Password protecting a web folder with .htaccess

I'm trying to set up .htaccess for a folder on my website. I've created the .htpasswd file (on the volume root folder) and the .htacess file in the folder I'm trying to protect. I've turned on Allow All Overrides in Server Admin Web>Options. But so far I'm not getting a dialog box asking for a password.
The contents of the .htpasswd are:
kcpcu:$........
The contents of the .htaccess file are:
AuthUserFile /.htaccess
AuthType Basic
AuthName "KCPCU"
Require valid-user
I'm at a loss on what to do to get this working. Any ideas?
Thanks!

Make a backup copy of your 'httpd.conf' file. Then find the line that says:
    AllowOverride None
And change it to:
    AllowOverride AuthConfig
If you are using virtual domains you will have to edit the virtualhosts '.conf' file and add these lines:
    <Directory /docroot/www.yourdomain.tld/html>
        Options Indexes FollowSymLinks
        AllowOverride AuthConfig
    </Directory>
check the owner and permissions on the .htaccess file. Set the permissions on the .htaccess file:
chmod 644 /path/to/.htaccess
and
chown www:www /path/to/.htaccess
There's no need to place the password file in a directory of the top level of the volume. It can exist in /etc/httpd or one directory up from the webserver document root directory. Just make sure the permissions are set to '644'.

Similar Messages

  • Password protected iWeb sites - problem with login

    This is an FYI regarding a problem I recently encountered. Neither MobileMe, nor Apple tech support or specialists were able to resolve it, but I finally figured it out.
    I created a company website for my client, including secondary websites that were password protected in order for her clients to download support materials for her classes. The passwords worked fine last night, but this morning we could not login with the setup passwords. Even when we changed them and tried to re-upload the entire site, we could not. I don't know specifically what changed, but we went through a plethora of solutions over many hours, but to no avail.
    In the end, it appears that how we setup the domain was where the problem existed. We have our own domain through Netfirms, which we set up to use in MobileMe as per the instructions. In Netfirms however, when you log into version 8, it does not give you the option to change the CNAME, as MobileMe states needs to be done. Instead I had set up the domain to forward to our "web.me.com/company" site. This was the problem.
    To correct this, I turned off the url forwarding and logged out of Netfirms. Then logged back in, but into version 6 of the control panel. From here I was able to setup the CNAME as web.me.com. And ta-da, once it updated on the server the entire site and all password protected areas are working as needed.
    Phew.

    To password protect a site, folder or page when using a server other than MobileMe you need to either enable this in your control panel or do it using a .htaccess file.
    The server side script is the most secure way to do it. There are javascripts that you can use but they are less secure.....
    http://www.javascriptkit.com/script/cutindex6.shtml
    Doing it via the control panel is easier but, if you want to go the htaccess route, you can generate it online here....
    http://tools.dynamicdrive.com/password/

  • Making specific folders password protected in Public folder

    If I have two subfolders in the Public folder of my iDisk - each containing images for a different person - can I specify a different password for each folder?
    Thanks

    You cannot password protect an ordinary folder. A "disk image" is a special kind of folder that you CAN password protect; on the desktop that 'folder' has the icon of a volume because it actually is a temporary volume. Use Disk Utility to create as many such disk images as you need, each with its own password, and each with a meaningful name ("JonsPics", "stuffforMary", whatever) so that you don't get confused. Put the appropriate files into each disk image and give the appropriate people the password they will need.
    Where you then put those disk images (files with suffix .dmg or .sparseimage), on an iDisk or anywhere else, is immaterial.
    Try an experiment. Use Disk Utility to create a disk image (with encryption) on, say, your desktop. Drag some files into the temporary volume that has appeared (the 'folder'). Now unmount the temporary volume via a Finder window's sidebar 'eject' symbol or by dragging the volume to the trash - (which is equivalent to closing the folder). You will have a xxx.dmg or a xxx.sparseimage file on your desktop: it contains your files, but hidden from prying eyes - double-click it - it will ask for a password... Those .dmg (or .sparseimage) files are what you will upload to your iDisk.
    You can mount a volume from a .dmg or .sparseimage file as often as you like - just as you can open a folder as often as you like -- but with these kind of "folders", once you have closed/unmounted them, you will only be able to remount/reopen them with the correct password.
    Don't lose a password - Disk Utility warns you that without it you will be unable to access your files... which is exactly what you have been asking how to do!
    Do try it -- you will find it a lot simpler than trying to follow my explanation!  
    Andreas

  • Is there a way to password protect a Desktop Folder in Yosemite

    I have an IMAC running Yosemite 10.10.2. I would like to password protect a Desktop Folder. Is there a way to do this?

    You need to find a third-party utility that does that. You should find one at macupdate.com or at the App Store. In order to use OS X you would need to create an encrypted disc image using Disk Utility, then store your folder in the disc image. That way only you can mount the disc image and access the data.
    How to create a password-protected (encrypted) disk image

  • Is there any way to password protect my Contacts folder?

    Is there any way to password protect my Contacts folder on iPad2?

    By itself? No.  You can of course password your iPad as a whole, but not an individual app.

  • How Can I Password Protect a Shared Folder

    Hello.  I have a shared folder on our server (Windows Server 03) that I would like to password protect.  Is there a way to do that?  If I cannot password protect the whole folder, is there a way to password protect a folder inside of that shared folder? 
    Thanks for your help.

    I believe what you want to do is use your active directory users and computers groups to set permissions on this shared folder. Those who are not in a group that has access to this share will get a "access denied" error.  The users that do have permissions will either have access to it if they are a part of the domain or will need to enter username/password to gain access.
    You can go to the shared folder, right click on it, select properties, use the SHARED and SECURITY tabs to set the local and shared permissions on the folder. If you have more folders inside this one, you can also set permissions on those.
    Some things to look up would be:
    active directory users and groups
    setting windows shared permissions
    Take a look at this for starters
    http://technet.microsoft.com/en-us/library/bb727040.aspx
    There may be 3rd party prodcuts that allows you to set a password on that one folder, but this is how you should do it!
    Hope it helps

  • Access protected web folder with jsp code or servlet transparently

    Hi.
    I'm developing a web site. I want to place some of the web pages (*.swf)
    a protected web folder so that no one can DIRECTLY access them through wget or browser.
    However these *.swf files will be called by other jsp or servlets to display their content
    in broswer. What kind of authentication mechanism should I&#12288;&#65365;&#65363;&#65349;&#65311; Should I use filter?
    Please give me some ideas.
    Best regards.

    A Filter is perfectly applicable. But you also have to define the requirements which a request must fullfill to retrieve the contents. For example a login mechanism of which the User is been stored in the session, or an unique key provided as request parameter, or maybe the referrer, etcetera.

  • Can't access password protected .Mac Web Gallery

    Safari is my primary browser. I have been creating web galleries using iLife '08 and my .Mac account and then viewing them with Safari for the past month or so with no trouble. This weekend I tried creating a password protected web gallery and it won't load in Safari. The gear icon just spins forever and has timed out when I have left it alone long enough. My other web galleries continue to load just fine. Clicking on the link from within iPhoto for my password protected gallery doesn't work, typing the url into Safari doesn't work, going to my gallery index and clicking on the icon of the "locked" gallery doesn't work, etc. I can still view all of my other web galleries, but this one that I'm trying to protect just won't load.
    This actually appears to be a Safari problem. I don't get a dialog asking for User Name and Password. The url works just fine using Firefox on my Mac, and it also works on a PC running Windows XP. When using something other than Safari, I get the prompt for User Name and Password that I would expect. Upon entering that information, everything looks normal and works just fine.
    Tsk tsk Apple! Safari shouldn't be having trouble displaying protected .Mac web galleries. Sheesh!

    Just wanted to let you know that I have the EXACT SAME problem, except it is affecting my password protected iWeb site and my Gallery. I can view it from Firefox, so that is the web browser I am using now. I sent a bug report to Apple, and I also send them a request for help using e-mail, but so far I have gotten no response. Hopefully someone is working on the fix?

  • Password protected files not opening with acrobat reader 9

    I receive text file embedded in a PDF which is password protected. I just changed my comp from Vista to Windows 7 64 Bit and got the reader 9 duly updated. Earlier I was using reader 7 and the files used to work and open. Now they do not open and their is a big PIN mark on giving the password. The following message is displayed "Acrobat cannot open the file attachment because your PDF file attachment settings do not allow this file type to be opened" the file type is ZIP.  Please help

    But it did work on windows vista with reader 7. If it is not at all possible then
    my question is can I uninstall reader 9 and install reader 7.
    will it work on windows 7 64 bit

  • Help password protecting a file/folder...

    I am looking for a simple way to password protect or protect in some way just a simple file folder in windows. 
    Help?
    Thanks!

    Hello,
    For those still looking, this should be asked in the
    Windows forum on Microsoft Community.
    Karl
    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
    My Blog: Unlock PowerShell
    My Book: Windows PowerShell 2.0 Bible
    My E-mail: -join ('6F6C646B61726C40686F746D61696C2E636F6D'-split'(?&lt;=\G.{2})'|%{if($_){[char][int]&quot;0x$_&quot;}})

  • Password protecting a single folder

    I have a question about permissions for a single folder. Here is what I want to be able to do: I want to password protect access to a single folder. I want to be able to double click on it... input a password and be granted access to it. Also, when that finder window is closed, I want it to revert back to protected (so that if I need to open it again, I will need to input the password again).
    To save you the time, I already know how to use Apple-i on a folder and use the sharings and permissions to give limited access to a folder. Unfortunately, that is time consuming and tedious to change back and forth every time I am done viewing a folder. I am interested in a "faster" method for keeping a folder and it's contents secure.
    I appreciate any feedback you have on this!
    Grant

    The best "built-in" option is an encrypted disk image, which will do exactly what you want.
    Open up Disk Utility. Go to the help menu and type "confidential" into the search box (without the quotes). Select "Protecting confidential documents in a secure disk image". Follow the instructions, and it will "just work".
    Cheers,
    Rodney

  • Password Protecting An entire folder in documents?

    I need to be able to password protect a folder within my Documents folder, as it contains very sensitive info. Does anyone know how to do this in pages '09? Thanks

    Use Disk Utility to create a password-protected Disk Image - choose a size large enough to store all the documents you expect to put in it. Place this wherever convenient: double-clicking it will ask for a password and open the image (looking like an external hard disk) and you can copy your files into it. When you close it it will require the password to re-open it.
    Don't forget the password

  • With the recent upgrade to FF 6.0 how do we get password protection for the internet with FF back?

    When our Mac was set up we had a password protected startup for FF, so without the password you could not start it.
    With the recent upgrade to 6.0 that password request disappeared. How do we get it back?

    When our Mac was set up we had a password protected startup for FF, so without the password you could not start it.
    With the recent upgrade to 6.0 that password request disappeared. How do we get it back?

  • Creating password-protected or hidden folder

    Dear all,
    I wonder if someone can help me create a password-protected and/or hidden folder where I can put some sensitive files.
    Thanks much,
    R

    Use an encrypted disk image or a third-party method. Placing the password in the keychain will automatically unlock the image when your Mac OS X account is active.
    (52406)

  • Open An Encrypted, Password Protected Saprsebundle Disk Image With iPhone?

    Is it possible to open an encrypted, password protected sparsebundle disk image using an iPhone/iPad/iPod Touch that is stored on a NAS drive connected to an AirPort Extreme Base Station?
    If so, how do I do it?
    If not, would you be able to explain why not?
    Thanks, Alex

    Hi Robert,
    > Once you through a sudo in there, you lose the option
    to have a regular user
       That's not really true. Sudo is one of the most flexible commands around and not only can a regular user use it but they can use it without a password. Mind you I'm not suggesting that you make all users admins; you can specify both of these privileges for this command only. All you have to do is to put a line like the following in your /etc/sudoers file. (with sudo visudo of course)
    ALL ALL = NOPASSWD: /usr/bin/hdiutil create -encryption -certificate*-stdinpass -type SPARSE -fs "HFS+" -volname-size
    I've included wildcards so that the cert file, volume name, size and image are arbitrary but the others must be in the user's command to qualify. I realize that you'll want different options to use FileVault certs but I don't know how to do that so I used your original example as my example.
       Of course it wouldn't be that easy for your lusers to get all of those options correct so the next thing you do is to wrap the command, with it's sudo preface, in a shell script that parses the cert file, volume name, size and image from the options the user passes to the script and puts those into the command with the right syntax. If you want to get really fancy, the script could prompt the user for any arguments that were omitted. Your lusers will think that you created this really cool command and never know that sudo was involved.
    Gary
    ~~~~
       If you give a man enough rope, he'll claim he's tied up
       at the office.

Maybe you are looking for