Women in Technology

Hear us Roar



Article:
  Apache Web-Serving with Mac OS X, Part 4
Subject:   Internal Server Error
Date:   2002-02-18 05:25:52
From:   hammer09
I have been working on part four of your tutorial where I am trying to get the password authentication to work. After going through all of the steps, I go to my site and get a page that says "Internal Server Error." When I go to the error log, there is an entry that says: [Mon Feb 18 08:08:37 2002] [alert] [client 192.168.0.40] /Library/WebServer/Documents/.htaccess: AuthName takes one argument, The authentication realm (e.g. "Members Only"). I replaced the default realm with one that says "My Company's Authentication" but other than that, I beleive everything is correct. Any help would be greatly appreciated.
Full Threads Oldest First

Showing messages 1 through 4 of 4.

  • Morbus Iff photo Internal Server Error
    2002-02-18 08:18:12  Morbus Iff | O'Reilly Author [View]

    Two things to verify:

    - Make sure that "My Company's Authentication" is QUOTED after AuthName. If there are no quotes around it, then it would be considered multiple arguments, and thus you'd get the error.

    - Make sure that the line encoding of your .htaccess file is set for Unix newlines. If it's Mac or Windows newlines, then that could give the "single argument" warning.
    • Internal Server Error
      2002-03-12 21:11:07  kak [View]

      I know I'm coming late to the party but I'm having the identical problem described previously. I've setup the .htpasswd file and it seems fine. I have setup a .htaccess file in the directory I want to protect.

      Trying to access this directory gives me the 500 internal server error and then the 'AuthName takes one argument' warning in the error log.

      I have created the file using sudo pico and then typing it straight in (so I assume the line endings are OK). Is this a correct assumption?

      I definitely have quote around the Authname.

      The full .htaccess file is:

      AuthName "test"
      AuthType Basic
      AuthUserFile /Library/WebServer/.htpasswd
      require user david kim

      Anything else I can try - this is killing me!

      Oh, and one more thing - is it wise/unwise to use the httpd.conf file to change the name of the .ht files to something that can be more easily written to the system - like apple.htaccess or whatever?

      thanks
    • Internal Server Error
      2002-02-18 09:04:40  hammer09 [View]

      Thanks morbus, You were absolutely correct. The .htaccess file that I saved had Macintosh line breaks. As soon as I resaved it as Unix, it worked like a charm. Is there a way to make that the standard way that bbedit saves the files? A preference or something? Thanks again for your help and please keep these articles coming or write your own book about serving apache on OSX. I'd be your first customer!
      • Morbus Iff photo Internal Server Error
        2002-02-20 12:28:39  Morbus Iff | O'Reilly Author [View]

        Yup, you can set BBEdit to automatically save files in Unix linefeeds - I've my 6.5 installation set that way. Take a look-see in your BBEdit Preferences, and I'm sure you'll find it.