![]() |
Newb: Desperately need help to password protect a directory SOLVED
EDIT:
(Please read the whole thread but I hope this is the solution...) This is simplicity itself. Only took me just over two weeks ;) I am running Ubuntu server 8.04 LTS, set up with ISPc3. I need to protect a folder /var/www/lockthisfolder . I want to use Digest authentication. I created a directory "lockbydigest" in / to contain the htdigest file. NOTE: Only use the -c flag the first time you create the htdigest file. Otherwise a new one will be created for you and you will lose the details of the existing users you have set up. Code:
root@mybox:/lockbydigest# htdigest -c digest private mynameCode:
AuthType DigestCode:
sudo /etc/init.d/apache2 restartCode:
sudo chown root:www-data digestI think that was all I did! Look through the rest of the thread if something isn't working. S Hi, (Starting this here as it's probably to do with the ISPc3 htaccess file...?) I urgently need to password protect a directory and seem to be getting things wrong, as usual... I'm running Ubuntu 8.04 LTS server with ISPc3 running fine. I need to protect a folder /var/www/lockthisfolder . I want to use Digest authentication. I created a directory "lockbydigest" in / to contain the htdigest file. Then I did: Code:
root@mybox:/lockbydigest# htdigest -c digest private mynameCode:
<Directory /var/www/lockthisfolder>Thanks as always :-) S |
did you check that .htaccess directive are read by Apache webserver ?
i am referring to the "AllowOverride" setting directive inside apache httpd.conf look here: http://httpd.apache.org/docs/2.0/mod...#allowoverride When this directive is set to "None", then .htaccess files are completely ignored. |
Quote:
Thanks for chipping in... ISPc3 relies on Apache directives so I'm sure they must be activated. No? S |
yes,
but pay attention that after regular ispconfig3 installation, if you look inside /etc/httpd/conf/httpd.conf you'll see this setting: "AllowOverride None" and only in /etc/httpd/conf/sites-available/www.yoursite.com.vhost apache config files there is: "AllowOverride All" that "enables" .htaccess "looking" by apache. so that, check if your "/var/www/lockthisfolder" is configured inside a httpd virtual host with that AllowOverride setting. i mean the following: <Directory /var/www/lockthisfolder> AllowOverride All ..... ..... </Directory> |
Quote:
I'm not quite following... Do you mean that the .htacess file inside /var/www/lockthisfolder should look like this?: Code:
<Directory /var/www/lockthisfolder> |
no.
... as told before, i mean you have to check the apache configuration, that is related to the "/var/www/lockthisfolder" folder. is that folder configured inside a virtual host config file ? if yes, check that configuration.. it's that configuration that must have inside the "Directory" directive the "AllowOverride All" statement. i hope to have explained better..(unfortunately i am not english) |
Quote:
Quote:
Quote:
Code:
<Directory /var/www/lockthisfolder>Quote:
S |
uhmm..if you tellin that above..i think your apache httpd.conf is not located
like mine (i use Centos) cause it cannot be empty..in Ubuntu maybe located in /usr/local/apache2 ? you can do the following find command inside terminal: find / -iname 'httpd.conf' mine is located at: /etc/httpd/conf/httpd.conf and it's not empty..but it has the "AllowOverride" directive set to "None" since are the virtual host apache config files that tune the per-site configurations.(as said before) .. if you are telling that your folder is "out of the ispc3 struct" so when you have find the "non-empty" httpd.conf edit it, and find lines with "AllowOverride" directive and try to set them to "All" and after editing do an "apachectl restart" a try to see if it works as expected |
Quote:
Is this an Ubuntu quirk? Is there another file which could do the same job? Does it have another name in Ubuntu perhaps? S |
maybe /etc/apache2/apache2.conf ? (for debian ...)
|
| All times are GMT +2. The time now is 15:54. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.