Results 1 to 2 of 2

Thread: .htaccess doesn't work.

  1. #1

    .htaccess doesn't work.

    Hi, Does anyone know why this wouldn't work? I don't use .htaccess but my friend does and he asked me, so where else would I bring the question but here.

    .htaccess file in /Users/admin1/Sites

    [Neo:~/Sites] admin1% more .htaccess

    AuthUserFile /Users/admin1/.htpasswd
    AuthName "Neo on Vegas"
    AuthType Basic

    / /EOF

    Does he need to do anything in httpd.conf in addition to this? Thanks everyone.

  2. #2

    Re:.htaccess doesn't work.

    Got it to work. Here is the solution.

    Both files should be in the directory which contains the documents to restrict access to. Once you get it to work you can experiment with moving the .htpasswd file.

    #creates .htpasswd file. Write over old one. It will prompt you for a passwd.

    htpasswd -c .htpasswd netman

    #.htaccess file stuff.

    AuthUserFile /var/www/html/public_html/mike/.htpasswd
    AuthName "Realm of Darkness"
    AuthType Basic
    <Limit GET>
    require user netman

    #You must edit the httpd.conf file to allow override authconfig so apache doesn't ignore it.

    <Directory "/var/www/html">
    Options Indexes Includes FollowSymLinks

    AllowOverride AuthConfig
    Allow from from all

    Order Deny,Allow

    You might have to mess with the permissions of .htaccess and .htpasswd. I got it to work running them as 644 but I think it would be better to run it with 600. One last thing is the group and ownership. I changed them to apache. I have not checked to see it it will run under other owner and groups. Don't forget to restart Apache. /etc/rc.d/init.d/httpd restart

Similar Threads

  1. ch 30, automount example doesn't work for me
    By clearscreen in forum Linux - General Topics
    Replies: 1
    Last Post: 01-27-2009, 10:33 PM
  2. Mplayerplug-in Firefox - Doesn't work
    By shebang in forum Linux - Software, Applications & Programming
    Replies: 1
    Last Post: 12-19-2004, 10:59 PM
  3. I Have An Acl That Doesn't Work :(
    By infinite_root in forum Linux - Hardware, Networking & Security
    Replies: 1
    Last Post: 09-08-2004, 11:18 PM
  4. Printer doesn't work anymore (Mdk problem)
    By x in forum Linux - Hardware, Networking & Security
    Replies: 4
    Last Post: 10-02-2002, 04:46 AM
  5. relaying doesn't work
    By elovkoff in forum Linux - Hardware, Networking & Security
    Replies: 1
    Last Post: 08-20-2002, 01:55 PM


Posting Permissions

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