[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-users] .htaccess not working on a raq550 ?



----- Original Message ----- 
From: "John D. Gorena" <Support@xxxxxxxxxxxxxxxxxxx>
To: <cobalt-users@xxxxxxxxxxxxxxx>
Sent: Wednesday, June 25, 2003 5:27 AM
Subject: Re: [cobalt-users] .htaccess not working on a raq550 ?


> Robbert,
>
> There are two parts below - HOW TO and the FIX.  I hope that this helps.
>
> John
>
>
>
> RAQ550: HOW TO Password Protect directory with .htaccess
>
> Below, you will find five examples on how to protect a directory with
> login/password.  The first four use system defaults for administrators
> and users and the fifth example is to set a specific login and
> password.  All the examples require you to create a file called
> ".htaccess" with the example information.  I use "pico .htaccess" in the
> directory to create the file.
>
> 1 =============================
> #Allows administrators of a particular domain to access
> #the directory.  In this case Site2.
> #Access file
> order allow,deny
> allow from all
> require group site2
> Authname "Login Name for Access"
> Authtype Basic
> AuthAuthoritative off
> AuthPAM_Enabled off
>
> 2 =============================
> #ALL users on the RAQ550 can access this directory.
> #Access file
> order allow,deny
> allow from all
> require valid-user
> Authname "Login Name for Access"
> Authtype Basic
> AuthAuthoritative off
> AuthPAM_Enabled off
>
> 3 =============================
> #FOR ALL SITE ADMINs for all domains
> #Access file
> order allow,deny
> allow from all
> require group site-adm
> Authname "Login Name for Access"
> Authtype Basic
> AuthAuthoritative off
>
> 4 =============================
> # Only user with userid from the domain
> #Access file
> order allow,deny
> allow from all
> require user userid
> Authname "Login Name for Access"
> Authtype Basic
> AuthAuthoritative off
> AuthPAM_Enabled off
>
>
> 5 =============================
> SPECIFIC LOGIN AND PASSWORD:
> For this example, we will show how to password protect a directory with
> a specific login and password. You can apply this procedure to virtual
> sites also by changing the directories.
>    a.   Telnet in, and login as the User or admin or root
>    b.   Navigate to the directory you want to password protect.
>    c.   Create the .htaccess file in the directory (example: pico
> .htaccess), it should contain the following lines:
>       # Access file
>       order allow,deny
>       allow from all
>       require valid-user
>       Authname "DirectoryName"
>       AuthPAM_Enabled off
>       Authtype Basic
>       AuthUserFile /home/sites/sitename/web/directory/.htpasswd
>
>    Replace "DirectoryName" with anything that you want - if you want.
>    Replace sitename and directory as appropriate.
>
> Now you must create the .htpasswd file using the htpasswd tool.
>    a.   Type the following command to create the file and add a user:
>    b.   /usr/bin/htpasswd -c .htpasswd username
>    c.   You will be prompted for the users' password twice.  If you need
> to add additional users to the file, use the command above without the
> -c.
>
>
> END OF .htaccess  EXAMPLES
>
>
>
> HOW TO FIX PAM MODULE SINCE RAQ550 UPDATE
>
> 1) Login as root
> 2) Use editor to edit httpd.conf file like
>    "pico /etc/httpd/conf/httpd.conf"
>
> The top line of httpd.conf has the following line since the update:
> LoadModule pam_external_auth_module modules/mod_auth_pam_external.so
>
> This line is also remarked out in the httpd.conf file.  Find it in the
> file and remove the # and remove the top copy.
>
> In pico, go to this line with your cursor and cut it out by pressing
> Ctrl-K
>
>
> IF FOR SOME reason you do not see the line in the file then Move down to
> the ClearModuleList section and place it in the section so that it
> looks:
> ClearModuleList
> AddModule mod_so.c
> AddModule mod_perl.c
> LoadModule pam_external_auth_module modules/mod_auth_pam_external.so
> LoadModule userdir_module modules/mod_userdir.so
> LoadModule alias_module modules/mod_alias.so
>
> Press Ctrl-x to exit and save the file.
>
> 3) Type the following on the command line:
> /etc/init.d/httpd reload
>
> And press enter.
>
> You will get something like:
> [root]# /etc/init.d/httpd reload
> Reloading httpd: httpd ok
> [root]#./etc/init.d/httpd restart
>
> It should now be fixed
>


WHOOOOOHOOOOW this did the trick !!!!

Thanks very very very much !!! (I even made a print out from it!)

Still wondering what the difference is between the rule on top of httpd.conf
and in clearmodule list. Cause the rule is the same. I suspect it has
something to do with loading order or something ?

Thanks very much again ! A really good post which i keep fully on top for
the archives.

Robbert