Find the answer to your Linux question:
Results 1 to 8 of 8
As I stated in an earlier posting, I've got htaccess working just fine w/an RH7.3 server. However, I have configured an RH 9 web server (All pertinent updates/fixes are installed ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    May 2003
    Location
    Seattle
    Posts
    37

    htaccess works w Apache/RH7.3 but not Apache/RH9?


    As I stated in an earlier posting, I've got htaccess working just fine w/an RH7.3 server. However, I have configured an RH 9 web server (All pertinent updates/fixes are installed on RH9) with the same htacess configurations and all RH9/Apache does is prompt for the username/password over and over w/out authenticating. My .htacess file looks like this:

    AuthName "Pleae login in to access"
    AuthType Basic
    AuthUserFile /etc/httpd/conf/passwd
    Require user testacct

    The passwd file "passwd" was created using (htpasswd -c /etc/httpd/conf/passwd -testacct) and is located in the /etc/httpd/conf/ directory

    The .htacess file is in the appropriate directory, otherwise, it will not prompt me for a username/password.

    The Override AuthConfig variable is set.

    And,
    The following Modules are loaded:
    LoadModule auth_module modules/mod_auth.so
    AddModule mod_auth.c

    Yes, I even restarted the http daemon after all of this

    Has anyone encountered this on RH9 and know a resolution? If so, would you please share that info? Everything seems to work fine under RH 7.3 but isn't w/RH9 despite same configurations.

  2. #2
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    It seems pretty strange. Have you checked the permissions on /etc/httpd/conf/passwd, so that apache has access to it?

  3. #3
    Just Joined!
    Join Date
    May 2003
    Location
    Seattle
    Posts
    37
    Permissions issued to the passwd file were: chmod 640 passwd and I verified. I can't figure out why/where this is broken. I know it's not a Windows box (I hope that word wasn't considered profanity on this forum ) but, I rebooted just to make sure that everything refreshed itself with the same unpropitious results.

  4. #4
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    What UID and GID does the file have (the owner and group of the file)?

  5. #5
    Just Joined!
    Join Date
    May 2003
    Location
    Seattle
    Posts
    37
    root is assigned to the group and file owner just as root is with the http.conf file and others.

  6. #6
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    That explains. httpd.conf is read by the main apache process, while the passwd file needs to be read by the worker processes. Since the worker processes aren't running as root, but as the "apache" user, they cannot access the file with those permissions. Try "chown root:apache /etc/httpd/conf/passwd" and it should work better.

  7. #7
    Just Joined!
    Join Date
    May 2003
    Location
    Seattle
    Posts
    37

    SUCCESS!

    The change of ownership did the trick. RH7.3 was configured differently with root assigned rather than apache. Nonetheless, I hope this posting helps others who may have had a similar problem w/htaccess between RH/Apache flavors. Thank you.

  8. #8
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    Ah, I see. I guess that might have been an architectural change between Apache 1 and Apache 2, then.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •