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

Re: [cobalt-developers] ++++++ htaccess on raq550 ??????



"Andres C." wrote:
> 
> have installed on my 550 the AWStats for statistics info.
> I cant do it work fine 'cause .htaccess file not allow users to enter stats,
> receiveing the following error:
> **The server encountered an internal error or misconfiguration and was
> unable to complete your request. Your administrator may not have enabled CGI
> access for this directory. **
> The .htaccess file looks like:
> 
> #Access file
> order allow,deny
> allow from all
> Require valid-user
> Authname WebStats
> Authtype Basic
> AuthAuthoritative off
> 
> But never siteadmin users could get into stats.
> If I replace  existing .htaccess for another like the following users could
> access stats, but if he changes their passwords, this .htaccess keep the old
> password, and never change.
> 
> #Access file
> order allow,deny
> allow from all
> Require valid-user
> Authname WebStats
> Authtype Basic
> AuthUserFile /home/sites/www.sitename.com/web/awstats/.users
> AuthAuthoritative off
> 
> I create the password file with the follow sentence:
> /usr/bin/htpasswd -c .users username
> 
> This ways works fine, but is not sensitive for passwords changes.
> Someone have a better global solution?
> 
> Regards
> Andrew S. C.
> 
> _______________________________________________
> cobalt-developers mailing list
> cobalt-developers@xxxxxxxxxxxxxxx
> http://list.cobalt.com/mailman/listinfo/cobalt-developers




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. 


RAQ550: HOW TO Password Protect directory with .htaccess

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

In pico, go to this line with your cursor and cut it out by pressing Ctrl-K

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]#

It should now be fixed

John - A Cobalt Raq550 Crash Test Dummy.  You can learn a lot from a dummy! (Yes, the phrase is
borrowed from the Department of Transportation's safety belt awareness program).