Link to home
Start Free TrialLog in
Avatar of dryzone
dryzone

asked on

Apache question

If i want to add a directory to my httpd directory containing index.html which would be restricted to users an be acessed through the web by means of a login window, what must I configure in apache.conf or another conf file. I tried the apacheconf programs and comanche which really try to make an even bigger idiot out of me than I already am. I prefer to work with the config files and learn what is necessary.

So, how do I set up a password protected directory in e.g. my /home/httpd directory or /var/www directory.?
Avatar of collinr
collinr

You will want to do this with a .htaccess file or whatever file is specified in the AccessFileName directive (usually in srm.conf).

Info on how to set this up can be found at:

http://httpd.apache.org/docs/howto/auth.html

Avatar of dryzone

ASKER

Yes sure I read the HOWTO and is familiar with that.
There is nothing I could find in the HOWTO how to set access by username/password for specific directories.
Nowhere do I found a directory linked to digest or basic authentication.
From the FAQ:

Put this info in the .htaccess file, found in the directory you want secured.  

    AuthType Basic
    AuthName "By Invitation Only"
    AuthUserFile /usr/local/apache/passwd/passwords
    Require user rbowen sungo

Then create a passwords file using

     htpasswd -c /usr/local/apache/passwd/passwords rbowen

Make sure to set the permissions on the file and directory:

    chown nobody.nogroup /usr/local/apache/passwd/passwords
    chmod 640 /usr/local/apache/passwd/passwords

Avatar of dryzone

ASKER

Yes sure, thanks, let me restayte the problem
/home/httpd/index.html     # homepage
/home/httpd/domo

I want to protect the directory domo with username / password authentication.
I am not sure how to restric the access ONLY to this direc tory.
should I put the password file in this directory.....?
Surely I dont want to protect the whole darn site!.

Put the .htaccess file in this directory, that will put the settings on this directory only.  The location of the username/password file generated by htpasswd is irelevant.
Avatar of dryzone

ASKER

Are you sure the following should not rather point to .htpasswd ?
AuthUserFile /usr/local/apache/passwd/passwords
Avatar of dryzone

ASKER

This is strange!
 when I tried
htpasswd -c /usr/local/apache/passwd/passwords blabla
the dapache directories were reported not to exist.
[root@gateway domo]# rpm -q apache
apache-1.3.19-5
[root@gateway domo]#
So, Apache is installed, but do a "locate apache" nothing is find and neither /usr/local/apache/passwd/ or  /usr/local/apache for that matter exist. I reinstalled apache from scrath (Redhat 7.1 rpm), and it is nowhere on my filesystem, however httpd runs and the webserver is up.
Avatar of dryzone

ASKER

This is strange!
 when I tried
htpasswd -c /usr/local/apache/passwd/passwords blabla
the dapache directories were reported not to exist.
[root@gateway domo]# rpm -q apache
apache-1.3.19-5
[root@gateway domo]#
So, Apache is installed, but do a "locate apache" nothing is find and neither /usr/local/apache/passwd/ or  /usr/local/apache for that matter exist. I reinstalled apache from scrath (Redhat 7.1 rpm), and it is nowhere on my filesystem, however httpd runs and the webserver is up.
Avatar of dryzone

ASKER

This is strange!
 when I tried
htpasswd -c /usr/local/apache/passwd/passwords blabla
the dapache directories were reported not to exist.
[root@gateway domo]# rpm -q apache
apache-1.3.19-5
[root@gateway domo]#
So, Apache is installed, but do a "locate apache" nothing is find and neither /usr/local/apache/passwd/ or  /usr/local/apache for that matter exist. I reinstalled apache from scrath (Redhat 7.1 rpm), and it is nowhere on my filesystem, however httpd runs and the webserver is up.
Just put your password file in another directory.  Apache is probably installed to a dir other than /usr/local/apache on your system.  (/etc/apache maybe)
Avatar of dryzone

ASKER

I reinstalled Apche from source and the relevant directories was created .
I could do all you prescribed, created .htaccess a nd added user with password with
htpasswd -b -c /usr/local/apache/passwd/passwords  blabla eblablapassord
That all worked but I had to add the -b switch.

When I try to access the directory in my document path (where index.html of the webpage is read) I just get a server error when the directory "domo" is attempted to be accessed with a browser.
Why that? Should I not get a username password pop-up?
Avatar of dryzone

ASKER

I reinstalled Apche from source and the relevant directories was created .
I could do all you prescribed, created .htaccess a nd added user with password with
htpasswd -b -c /usr/local/apache/passwd/passwords  blabla eblablapassord
That all worked but I had to add the -b switch.

When I try to access the directory in my document path (where index.html of the webpage is read) I just get a server error when the directory "domo" is attempted to be accessed with a browser.
Why that? Should I not get a username password pop-up?
Are your permissions set correctly on the password file and also on the .htaccess file?
Avatar of dryzone

ASKER

Just for good measure I did a changemod 777 on both the directory domo and the password file...not secure but must work, but problem persists.
Avatar of dryzone

ASKER

Ok I get the index.html file in that directory "domo" with a chmod 777,  but now when I change the permissions to something more restrictive, there is no popup with username/password just an error message again!
Try 755
Check the .htaccess file for typos.

-- Glenn
Avatar of dryzone

ASKER

Tried 755, no typo errors.
The problem is, it either just allows me into the directory or it does not give me a popup for username passwordwhen the permissions are correctly set. This Apache is a load of crap. Maybe there is a perl script that can do this better?
Avatar of dryzone

ASKER

Ok I get the index.html file in that directory "domo" with a chmod 777,  but now when I change the permissions to something more restrictive, there is no popup with username/password just an error message again!
Avatar of dryzone

ASKER

Ok I get the index.html file in that directory "domo" with a chmod 777,  but now when I change the permissions to something more restrictive, there is no popup with username/password just an error message again!
Can you publish the .htaccess file here
There is 99% probability the error is there also check your error_log file for the error that is reported.
Avatar of dryzone

ASKER

I installed form sources and the password file was created as in the directory...mentioned.

Putting .htaccess in "domo" which I want to protect fails miserably.

AuthType Basic
AuthName "By Invitation Only"
AuthUserFile /usr/local/apache/passwd/passwords
Require user Liebrecht

I then reverted to the BSD method of putting both .htaccess and .password (password renamed to .password) in the directory domo.

AuthType Basic
AuthName "By Invitation Only"
AuthUserFile /home/httpd/domo/.passwords
Require user Liebrecht

Still does not work. Apache just breaks authentication which I feel is pretty pathetic given 3 configuration files.

The password (.password respectively) file resident in  /home/httpd/domo and /usr/local.....  in the directory as above contains the correct username and encrypted password.
Liebrecht:L3icI1ksUVmqM


Anybody had any luck with thttpd, maybe they know how to protect directories. At this stage I am pretty demoralised with Apache and dont think I will ever use it fro any business operation anymore. Maybe move away from Linux (After 5 years dedication) to MS IIs.

Anyway, hope this helps.
>  AuthUserFile /home/httpd/domo/.passwords

and

> The password (.password respectively) file resident in  /home/httpd/domo and /usr/local.....  in the

don't match. Is this just a typo in the comment, or is it present "in the real world" too?

please present the output of
ls -l  /home/httpd/domo/.passwords
to us (preferably cut'n'pasted from the .htaccess file).

-- Glenn
Avatar of dryzone

ASKER

As I said, since the /usr/local/apache..... installation from scratch did not work ... I referred back to the BSD HOWTOS which prefers to keep both the password and the htaccess in the directory to be protected. the /usr/local... passwd file does not exist anymore I dont keep them both on the sytem.

ls =l
-rw-r-----    1 nobody   root           24 Jan 10 18:53 /home/httpd/domo/.passwords

What creates the "login pop-up" why is it not activated?
Where you put the file is not relevant, only that the AuthUserFile entry match the actual placement of the file, and that it is readable by the httpd process (which should run as a thoroughly unprivileged user, to prevent excessive webclient accessrights).

In your apache configuration file(s) check that you have a directive "AccessFileName .htaccess".
if you have the "skip .ht" construct, I'd urge you to rename .passwords to .htpasswords (or risk Web clients getting access to the actual passwords (easily crackable)).
Also check that you have AllowOverride set correctly for your DocumentRoot (/home/httpd). You'll need at least AuthConfig (or be lazy and choose All :-).
And... I presume group root isn't your "nobody group". What actual user your web clients will use is settable, and probably is "nobody" and "nogroup" (might be "nobody"). chgrp <to your nobody-group> <your htpassword file> might be a good idea, but probably isn't the error.

What are the verbatim error message(s)? Please report any errors found in the logfile(s) too.

-- Glenn
Avatar of dryzone

ASKER

"AccessFileName .htaccess".  That is correctly done.
The rest documentroot etc is also properly done.
Againm my question... why NO POPUP..am I missing some cgi-script?
Error message is.....
YOU DONT HAVE PERMISSION TO use this file or directory...
Then if I chmod 777 domo I have permission obviously all permission. Authentication obviously is not even used and everything defaults to directory permissions.
I dont have this kind of crap on BSD, which is probably a reason  BSD is superior to linux.
It is as if the popup is not ativated .. what activates the popup? Why doesn httpd read the darn .htaccess and password file.

All that is in the error log is.
l/2.8.1 OpenSSL/0.9.6 DAV/1.0.2 PHP/4.0.4pl1 mod_perl/1.24_01 configured -- resu
ming normal operations
[Fri Jan 11 02:12:20 2002] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin
/suexec)
Avatar of dryzone

ASKER

"AccessFileName .htaccess".  That is correctly done.
The rest documentroot etc is also properly done.
Againm my question... why NO POPUP..am I missing some cgi-script?
Error message is.....
YOU DONT HAVE PERMISSION TO use this file or directory...
Then if I chmod 777 domo I have permission obviously all permission. Authentication obviously is not even used and everything defaults to directory permissions.
I dont have this kind of crap on BSD, which is probably a reason  BSD is superior to linux.
It is as if the popup is not ativated .. what activates the popup? Why doesn httpd read the darn .htaccess and password file.

All that is in the error log is.
l/2.8.1 OpenSSL/0.9.6 DAV/1.0.2 PHP/4.0.4pl1 mod_perl/1.24_01 configured -- resu
ming normal operations
[Fri Jan 11 02:12:20 2002] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin
/suexec)
Avatar of dryzone

ASKER

Here is the message obtained.
What is expected is a username password login popup for domo as htaccess and password files are present in domo...
Forbidden
You don't have permission to access /domo/ on this server.
Apache/1.3.19 Server at 192.168.1.254 Port 80
Hm, strange... You did restart your browser after any changes (Yeah, I know, but it's nearing "Stupid Suggestion Time(tm)")?

It works flawlessly for me on a Mandrake 8.0 with apache 1.3.20.
I wouldn't whine to much about operating systems, when the problem clearly is a misconfiguration of the webserver. The goal here should be to ascertain what's been misconfigured (you might just convince me to unsubscribe here;-).
BTW, what linux distro would that be (sorry if you've already mentioned this, but... I can't see that mentioned).

Did you check that all the modules were installed? mod_auth etc seems to be .... necessary:-)

-- Glenn
OK what I find missing is

<Limit GET POST>
AuthType Basic
AuthName "By Invitation Only"
AuthUserFile /home/httpd/domo/.passwords
Require user Liebrecht
</Limit>              

And in the directory you need def for


<Directory /home/httpd/domo/>
AllowOverride Limit AuthConfig
</Dircectory>

Check that the directory is readable for the user that is running the httpd deamon
usually nobody


And also remember to check the error log
Avatar of dryzone

ASKER

To GNS (Glenn)
mod auth mod perl mod ssl the lot.
Yes I did restart httpd after every httpd.conf edit
Yes I do restart my browser and yes I have 0 cache on disk and memory.
Sorry, I cannot misconfigure 3 files....for such a long time.
Yes I did read the Howtos before posting it here.
I tried apacheconf and comanche and the protected directory settings are seemingly also fuzzy there.
Yes it works on windows without hassle..Yes it works on BSD ..no hassle...no it doesnt on Linux.
If I get it to work on 2 operating systems out of 3 on which is BSD....mmmmm.
Yes I am familiar with Linux, have more than 12 Linux terminals and servers and develop linux software for embedded devices for my own products...........
Problem is apache....is way too finicky for what it should do.
I use RH7.1
If the problem is clearly a misconfiguration, send me three files
httpd.conf and .htaccess, I will generate a password file.
The protected directory is /var/www/html/domo
If I dont get a login popup when acessing that directory then I dont know if you are right.
From the standar RedHat 7.1 Apache config

Change the
  /etc/httpd/conf/httpd.conf file

Change  AllowOverride Limit AuthConfig

from
        AllowOverride none

The .htaccess file in the

/var/www/html/domo

<Limit GET POST>
AuthType Basic
AuthName "By Invitation Only"
AuthUserFile /var/www/httpd/domo/.passwords
Require user Liebrecht
</Limit>              

drwxr-xr-x    2 root     root         4096 Jan 11 19:39 .
drwxr-xr-x    4 root     root         4096 Jan 11 19:36 ..
-rw-r--r--    1 root     root          152 Jan 11 19:38 .htaccess
-rw-r--r--    1 root     root         2890 Jan 11 19:36 index.html
-rw-r--r--    1 root     root           24 Jan 11 19:39 .passwords

This is the domo directory




 
Avatar of dryzone

ASKER

Nope, I am just let into the directory without any access restriction --- open door.
I think I am wasting a lot of people's time whether I am in error or to my opinion (apache ambiguous).
What I propose is someone send me two files
1) httpd.conf  configured to my details
2) .htaccess file
3) The exact permissions you require.
I will create the password file.
DETAILS
webpages served from /var/www/html
protected directory /var/www/html/domo
apache conf file resides in
 /usr/local/apache/conf/httpd.conf
I start apche from                                 /usr/local/apache/bin/apachectl start

I just compiled apache from sources so it will be a clean installation. If does not work after that I am sadly moving to NT/IIS as a webserver with BSD as firewall.
I will hand the points to whoever makes the best attempt:################ So only comments after this message is accepted for points#######################
can you grep Auth from the httpd.conf file?
Special interest in the httpd.conf file
<Directory>
<AuthOverride>
<AuthFileName>

grep -v ^# /usr/local/apache/conf/httpd.conf | grep -v ^$ | grep -v Add | grep -v -i module | grep -v Define | grep -v Browser | grep -v SSL

would be of interest as it is not to large
tails from error_log would also be nice


Avatar of dryzone

ASKER

[root@gateway Apachetoolbox-1.5.50]# grep -v ^# /usr/local/apache/conf/httpd.conf | grep -v ^$ | grep -v Add | grep -v -i module | grep -v Define | grep -v Browser | grep -v SSL
Usage: grep [OPTION]... PATTERN [FILE]...
Try `grep --help' for more information.
Control Hash ?
ServerType standalone
ServerRoot "/etc/httpd"
LockFile /var/lock/httpd.lock
PidFile /var/run/httpd.pid
ScoreBoardFile /var/run/httpd.scoreboard
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15
MinSpareServers 5
MaxSpareServers 20
StartServers 8
MaxClients 150
MaxRequestsPerChild 100
Listen 80
LoadModule vhost_alias_module modules/mod_vhost_alias.so
LoadModule env_module         modules/mod_env.so
LoadModule config_log_module  modules/mod_log_config.so
LoadModule agent_log_module   modules/mod_log_agent.so
LoadModule referer_log_module modules/mod_log_referer.so
LoadModule mime_module        modules/mod_mime.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule status_module      modules/mod_status.so
LoadModule info_module        modules/mod_info.so
LoadModule includes_module    modules/mod_include.so
LoadModule autoindex_module   modules/mod_autoindex.so
LoadModule dir_module         modules/mod_dir.so
LoadModule cgi_module         modules/mod_cgi.so
LoadModule asis_module        modules/mod_asis.so
LoadModule imap_module        modules/mod_imap.so
LoadModule action_module      modules/mod_actions.so
LoadModule userdir_module     modules/mod_userdir.so
LoadModule alias_module       modules/mod_alias.so
LoadModule rewrite_module     modules/mod_rewrite.so
LoadModule access_module      modules/mod_access.so
LoadModule auth_module        modules/mod_auth.so
LoadModule anon_auth_module   modules/mod_auth_anon.so
LoadModule db_auth_module     modules/mod_auth_db.so
LoadModule expires_module     modules/mod_expires.so
LoadModule headers_module     modules/mod_headers.so
LoadModule setenvif_module    modules/mod_setenvif.so
<IfDefine HAVE_PERL>
LoadModule perl_module        modules/libperl.so
</IfDefine>
<IfDefine HAVE_PHP>
LoadModule php_module         modules/mod_php.so
</IfDefine>
<IfDefine HAVE_PHP3>
LoadModule php3_module        modules/libphp3.so
</IfDefine>
<IfDefine HAVE_PHP4>
LoadModule php4_module        modules/libphp4.so
</IfDefine>
<IfDefine HAVE_DAV>
LoadModule dav_module         modules/libdav.so
</IfDefine>
<IfDefine HAVE_ROAMING>
LoadModule roaming_module     modules/mod_roaming.so
</IfDefine>
<IfDefine HAVE_SSL>
LoadModule ssl_module         modules/libssl.so
</IfDefine>
ClearModuleList
AddModule mod_vhost_alias.c
AddModule mod_env.c
AddModule mod_log_config.c
AddModule mod_log_agent.c
AddModule mod_log_referer.c
AddModule mod_mime.c
AddModule mod_negotiation.c
AddModule mod_status.c
AddModule mod_info.c
AddModule mod_include.c
AddModule mod_autoindex.c
AddModule mod_dir.c
AddModule mod_cgi.c
AddModule mod_asis.c
AddModule mod_imap.c
AddModule mod_actions.c
AddModule mod_userdir.c
AddModule mod_alias.c
AddModule mod_rewrite.c
AddModule mod_access.c
AddModule mod_auth.c
AddModule mod_auth_anon.c
AddModule mod_auth_db.c
AddModule mod_expires.c
AddModule mod_headers.c
AddModule mod_so.c
AddModule mod_setenvif.c
<IfDefine HAVE_PERL>
AddModule mod_perl.c
</IfDefine>
<IfDefine HAVE_PHP>
AddModule mod_php.c
</IfDefine>
<IfDefine HAVE_PHP3>
AddModule mod_php3.c
</IfDefine>
<IfDefine HAVE_PHP4>
AddModule mod_php4.c
</IfDefine>
<IfDefine HAVE_DAV>
AddModule mod_dav.c
</IfDefine>
<IfDefine HAVE_ROAMING>
AddModule mod_roaming.c
</IfDefine>
<IfDefine HAVE_SSL>
AddModule mod_ssl.c
</IfDefine>
Port 80
User apache
Group apache
ServerAdmin root@localhost
DocumentRoot "/var/www/html"
<Directory />
Options FollowSymLinks
    AllowOverride None
</Directory>
<Directory "/var/www/html">
Options Indexes Includes FollowSymLinks
    AllowOverride Limit AuthConfig
    Order allow,deny
    Allow from all
</Directory>
UserDir public_html
DirectoryIndex index.html index.htm index.shtml index.php index.php4 index.php3 index.cgi
AccessFileName .htaccess
<Files ~ "^\.ht">
Order allow,deny
    Deny from all
</Files>
UseCanonicalName On
TypesConfig /etc/mime.types
DefaultType text/plain
<IfModule mod_mime_magic.c>
MIMEMagicFile conf/magic
</IfModule>
HostnameLookups Off
ErrorLog /var/log/httpd/error_log
LogLevel warn
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
CustomLog /var/log/httpd/access_log combined
ServerSignature On
Alias /icons/ "/var/www/icons/"
<Directory "/var/www/icons">
Options Indexes MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
<Directory "/var/www/cgi-bin">
AllowOverride None
    Options ExecCGI
    Order allow,deny
    Allow from all
</Directory>
IndexOptions FancyIndexing
AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip
AddIconByType (TXT,/icons/text.gif) text/*
AddIconByType (IMG,/icons/image2.gif) image/*
AddIconByType (SND,/icons/sound2.gif) audio/*
AddIconByType (VID,/icons/movie.gif) video/*
AddIcon /icons/binary.gif .bin .exe
AddIcon /icons/binhex.gif .hqx
AddIcon /icons/tar.gif .tar
AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
AddIcon /icons/a.gif .ps .ai .eps
AddIcon /icons/layout.gif .html .shtml .htm .pdf
AddIcon /icons/text.gif .txt
AddIcon /icons/c.gif .c
AddIcon /icons/p.gif .pl .py
AddIcon /icons/f.gif .for
AddIcon /icons/dvi.gif .dvi
AddIcon /icons/uuencoded.gif .uu
AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
AddIcon /icons/tex.gif .tex
AddIcon /icons/bomb.gif core
AddIcon /icons/back.gif ..
AddIcon /icons/hand.right.gif README
AddIcon /icons/folder.gif ^^DIRECTORY^^
AddIcon /icons/blank.gif ^^BLANKICON^^
DefaultIcon /icons/unknown.gif
ReadmeName README.html
HeaderName HEADER.html
IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t
AddEncoding x-compress Z
AddEncoding x-gzip gz tgz
AddLanguage en .en
AddLanguage fr .fr
AddLanguage de .de
AddLanguage da .da
AddLanguage el .el
AddLanguage it .it
LanguagePriority en fr de
<IfModule mod_php4.c>
AddType application/x-httpd-php .php4 .php3 .phtml .php
  AddType application/x-httpd-php-source .phps
</IfModule>
<IfModule mod_php3.c>
AddType application/x-httpd-php3 .php3
  AddType application/x-httpd-php3-source .phps
</IfModule>
<IfModule mod_php.c>
AddType application/x-httpd-php .phtml
</IfModule>
AddType application/x-tar .tgz
AddType text/html .shtml
AddHandler server-parsed .shtml
AddHandler imap-file map
BrowserMatch "Mozilla/2" nokeepalive
BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
BrowserMatch "RealPlayer 4\.0" force-response-1.0
BrowserMatch "Java/1\.0" force-response-1.0
BrowserMatch "JDK/1\.0" force-response-1.0
<IfModule mod_perl.c>
Alias /perl/ /var/www/perl/
  <Location /perl>
SetHandler perl-script
    PerlHandler Apache::Registry
    Options +ExecCGI
  </Location>
</IfModule>
Alias /doc/ /usr/share/doc/
<Location /doc>
order deny,allow
  deny from all
  allow from localhost .localdomain
  Options Indexes FollowSymLinks
</Location>
<IfDefine HAVE_SSL>
Listen 443
SSLSessionCache shm:/var/cache/ssl_gcache_data(524288)
<VirtualHost _default_:443>
DocumentRoot "/var/www/html"
SSLEngine on
SSLCertificateFile /etc/httpd/conf/ssl.crt/server.crt
SSLCertificateKeyFile /etc/httpd/conf/ssl.key/server.key
<Files ~ "\.(cgi|shtml)$">
SSLOptions +StdEnvVars
</Files>
<Directory "/var/www/cgi-bin">
SSLOptions +StdEnvVars
</Directory>
SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
CustomLog /var/log/httpd/ssl_request_log \
          "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</VirtualHost>
</IfDefine>

Avatar of dryzone

ASKER

[root@gateway Apachetoolbox-1.5.50]# grep -v ^# /usr/local/apache/conf/httpd.conf | grep -v ^$ | grep -v Add | grep -v -i module | grep -v Define | grep -v Browser | grep -v SSL
Usage: grep [OPTION]... PATTERN [FILE]...
Try `grep --help' for more information.
Control Hash ?
This is for the redhat 7.1 rpm with the changes made
then .htaccess file is posted before
as

----------------------
<Limit GET POST>
AuthType Basic
AuthName "By Invitation Only"
AuthUserFile /var/www/httpd/domo/.passwords
Require user Liebrecht
</Limit>              -------------------------------------

and the
/var/www/httpd/domo/.passwords
Liebrecht:u.mRs87slZ6mE


and this is started from the
/etc/rc.d/init.d/httpd start

where the conf file is in /etc/httpd/conf

Where you should have a httpd.conf file
if you have not deleted it

As said before the only changes are the

AuthOverride line






aim halldorg
grep -v ^# /usr/local/apache/conf/httpd.conf | grep -v ^$ | grep
-v Add | grep -v -i module | grep -v Define | grep -v Browser | grep -v SSL

This is one long line

grep -v ^# httpd.conf | grep -v ^$

To get rid of comments and empty lines
<Directory "/var/www/html">
Options Indexes Includes FollowSymLinks
   AllowOverride Limit AuthConfig
   Order allow,deny
   Allow from all
</Directory>

Take a note for this in the config file
Avatar of dryzone

ASKER

I deleted the whole /etc/httpd Rh7.1 default install thing and compiled the /usr/local/... version from sources.
I will have to edit the files or reinstall the redhat rpms.
Avatar of dryzone

ASKER

Reinstalled apache with all mod files auth perl the lot.
copied the httpd.conf file as presented to /etc/httpd/conf
Copied the .htaccess as you described.....
restarted httpd from init.d
Opened new browser.

Still I am just let into domo no restriction no passwords.
So it just doesnt work.

I give up with Apache..Possible alternative routes
1) Is there not an opensource version of the control panels available which hosting companies use??
2) Is there not a perl script that can just do the authentication and trash this crapache authentication?
It does with me as I'm prompted for userid and password after  
only those changes

Can you display the lines from access_log where you where loading

Also press Reload as the pages may be in the browsers cache
Avatar of dryzone

ASKER

I configured browser to have 0 disk and memory cache AND I start a new browser everytime.
The access log contains links on the index.html not working .... thats all.

[root@gateway logs]# tail access_log
192.168.1.254 - - [11/Jan/2002:17:41:21 -0500] "GET /domo/body_index.html HTTP/1.0" 404 284 "-" "Mozilla/4.79 [en] (X11; U; Linux 2.4.2-2 i686)"
192.168.1.254 - - [11/Jan/2002:17:41:21 -0500] "GET /domo/index.html HTTP/1.0" 304 - "-" "Mozilla/4.79 [en] (X11; U; Linux 2.4.2-2 i686)"
192.168.1.254 - - [11/Jan/2002:17:41:22 -0500] "GET /domo/left_index.html HTTP/1.0" 404 284 "-" "Mozilla/4.79 [en] (X11; U; Linux 2.4.2-2 i686)"
192.168.1.254 - - [11/Jan/2002:17:41:22 -0500] "GET /domo/body_index.html HTTP/1.0" 404 284 "-" "Mozilla/4.79 [en] (X11; U; Linux 2.4.2-2 i686)"
192.168.1.254 - - [11/Jan/2002:17:41:22 -0500] "GET /domo/index.html HTTP/1.0" 304 - "-" "Mozilla/4.79 [en] (X11; U; Linux 2.4.2-2 i686)"
192.168.1.254 - - [11/Jan/2002:17:41:22 -0500] "GET /domo/left_index.html HTTP/1.0" 404 284 "-" "Mozilla/4.79 [en] (X11; U; Linux 2.4.2-2 i686)"
192.168.1.254 - - [11/Jan/2002:17:41:22 -0500] "GET /domo/body_index.html HTTP/1.0" 404 284 "-" "Mozilla/4.79 [en] (X11; U; Linux 2.4.2-2 i686)"
192.168.1.254 - - [11/Jan/2002:17:41:41 -0500] "GET /domo/index.html HTTP/1.0" 304 - "-" "Mozilla/4.79 [en] (X11; U; Linux 2.4.2-2 i686)"
192.168.1.254 - - [11/Jan/2002:17:41:41 -0500] "GET /domo/left_index.html HTTP/1.0" 404 284 "-" "Mozilla/4.79 [en] (X11; U; Linux 2.4.2-2 i686)"
192.168.1.254 - - [11/Jan/2002:17:41:41 -0500] "GET /domo/body_index.html HTTP/1.0" 404 284 "-" "Mozilla/4.79 [en] (X11; U; Linux 2.4.2-2 i686)"
What I was looking for in the log was if there was a userid there is not.

Guess I have to give up
It is as the .htaccess file is not read
Try adding an error into it to see if you get error

have you a listing with
ls -al of the domo directory?
Avatar of dryzone

ASKER

I basically already gave up.. I played with permissions so these might not be correct. All I know httpd do not read the files in the directory.
I am currently trying perl scripts.
Anyway, if no-one else comes up with a decent solution, then I will give the points to you regardless as you put in a heck of an effort.
I thank you for your kind help.

[gateway domo]$ ls -al  
total 24
drwxr-xr-x    2 root     root         4096 Jan 11 17:27 .
drwxr-xr-x   15 root     root         4096 Jan 11 17:20 ..
-rwxr-xr-x    1 root     root          259 Jan 11 17:27 .htaccess
-rwxr-xr-x    1 root     root          258 Jan 11 16:12 .htaccess ~
--wxr--r--    1 root     root         1046 Jan 10 13:00 index.html
-rwxr-xr-x    1 root     root           24 Jan 11 11:23 .passwords
[gateway domo]$
There was a speeling error in the
.htaccess file I sent
the place fo the .passwords file should have been
/var/www/html/domo/.passwords

But you still should have been prompted for the auth

Adding to the httpd.conf file below the
<Directory "/var/www/html">
...
</Directory>

<Directory "/var/www/html/domo">
   Options Indexes Includes FollowSymLinks
 
  AllowOverride AuthConfig
  order allow,deny
  allow from all
  AuthName "Somename"
  AuthType Basic
  AuthUserFile /var/www/html/domo/.passwords
  require valid-user
</Directory>

Then you should not need the .htaccess file
only the .passwords file
Avatar of dryzone

ASKER

HalldorG
CONGRATULATIONS:

I now get a login.
So the 250 points will be yours.
I however need to understand why Crapache refused to read .htaccess which surely was the source of the problem.
The same configuration works on BSD (slightly different on windows NT) but NOT LINUX, which I suspect it is a Linux problem (Increasingly these days. After 4 years of working with Linux it is becoming a bit of a Linux95 situation.).
This was surely  not merely a misconfiguration, as it needed an override to fix.

I will give you an extra 100 points if
======================================
1) you can explain to me what the heck the problem is/was in order that I can take it up with apache.org
2) How to secure this login...just VERY good pointers will do. I am quite aware that this login sends passwords and usernames over the net.

You may refuse the extra 100 points and just claim the 250 at any time if you feel you are wasting time.
ASKER CERTIFIED SOLUTION
Avatar of HalldorG
HalldorG
Flag of Iceland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial