Trouble with AuthType basic

Problems with the Mac OS X version of XAMPP, questions, comments, and anything related.

Trouble with AuthType basic

Postby moonwalker_repeat » 01. June 2017 06:29

I've got a folder I want set up for administrative purposes, located in Xampp root called "Admins." I'm attempting to set this folder up to require basic credentials handled by .htpasswd in a folder called "user" also in the Xampp root.

I've placed the following code into httpd-xampp.conf

Code: Select all
<Directory "/Applications/XAMPP/xamppfiles/Admins">
    Options +FollowSymLinks +Multiviews +Indexes
    AllowOverride AuthConfig
    AuthType basic
    AuthName "private"
    AuthUserFile “/users/.htpasswd”
    Require valid-user
</Directory>


Now, when the directory "/Admins" is accessed from network computers, the obligatory login popup appears but when I try to execute the login, I get a 500 server error. Here's what I see in the error log:


[Thu Jun 01 00:57:50.927182 2017] [authn_file:error] [pid 3051] (2)No such file or directory: [client fe80::d69a:20ff:fe60:8880:49612] AH01620: Could not open password file: /Applications/XAMPP/xamppfiles/\xe2\x80\x9c/users/.htpasswd\xe2\x80\x9d

Notice the text in read (that I've colored)? I googled those two added strings and found that they have something to do with Python. Somehow the path string is getting messed up. I don't know a thing about Python but if this can be fixed with a simple edit I'm not afraid of it.

Anyone have a clue how to fix this issue?
OS X 10.9.5
XAMPP: 5.6.30-1

I'm setting up a proper server and only need advice to repair an old Xampp installation so I can move my sites safely without breaking them. Thanks for understanding.
User avatar
moonwalker_repeat
 
Posts: 32
Joined: 30. May 2017 05:38
Location: Earth
XAMPP version: 5.6.30
Operating System: OSX, Windows 10

Re: Trouble with AuthType basic

Postby Altrea » 01. June 2017 08:19

Use the correct double quotation marks, not the ones you used.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11935
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: Trouble with AuthType basic

Postby moonwalker_repeat » 01. June 2017 13:27

Never mind. I think I've come up with a better way of handling this. Thanks anyway.
OS X 10.9.5
XAMPP: 5.6.30-1

I'm setting up a proper server and only need advice to repair an old Xampp installation so I can move my sites safely without breaking them. Thanks for understanding.
User avatar
moonwalker_repeat
 
Posts: 32
Joined: 30. May 2017 05:38
Location: Earth
XAMPP version: 5.6.30
Operating System: OSX, Windows 10

Re: Trouble with AuthType basic

Postby Nobbie » 01. June 2017 17:43

moonwalker_repeat wrote: I googled those two added strings and found that they have something to do with Python.


Sorry, but thats bullshit. You simply hit the wrong keys on your keyboard, we had this problem here a few times. I do not have an OSX machine but it seems, that it offers a kind of "backtick-double-qoute" on the keyboard with an extended character code. Its not a queston of any Python software, its a question of these special characters. If you strongly magnify your text, you will see, that these quotes are looking strange. Simply use the correct quotes instead.

moonwalker_repeat wrote:Never mind. I think I've come up with a better way of handling this. Thanks anyway.


Anyway, keep an eye on which keys you are using for double quotes. This error will also apply in PHP Scripts etc. if you use the wrong keys.
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04

Re: Trouble with AuthType basic

Postby moonwalker_repeat » 02. June 2017 03:37

Nobbie wrote:we had this problem here a few times. I do not have an OSX machine but it seems, that it offers a kind of "backtick-double-qoute" on the keyboard with an extended character code. Its not a queston of any Python software, its a question of these special characters. If you strongly magnify your text, you will see, that these quotes are looking strange. Simply use the correct quotes instead.

Anyway, keep an eye on which keys you are using for double quotes. This error will also apply in PHP Scripts etc. if you use the wrong keys.


Turns out with some simple playing around with the editor and keyboard settings on the Mac host, and zooming in as you suggested, it was NOT the wrong keys being hit, but (apparently - haven't tested yet but I will and will get back to this thread afterward) the WRONG KEYBOARD SETTINGS. I tried several times typing a double quote, saw it appear correctly, then it would suddenly CHANGE to a serif style quote (which is what is actually causing the problem). Now that I've changed the default keyboard style to United States - PC it's not doing that anymore so my confidence is fairly high that this my work now.

Nobbie wrote:
moonwalker_repeat wrote: I googled those two added strings and found that they have something to do with Python.


Sorry, but thats bullshit. You simply hit the wrong keys on your keyboard


Wrong on both counts. Copy and paste the red strings into Google and you'll see for yourself that virtually every result is related to Python. When the OSsettings in use mess with the characters in any single code in a multi-code system, that can throw errors in other codes in the same system. That appears to be what probably happened here. "If it walks like a duck and quacks like a duck, it's probably a duck."

I do not have an OSX machine


Perhaps then, this isn't the best forum for you to be trying to help in?

A word of advice? Try to avoid jumping to conclusions, especially when the conclusion is "operator error." In MANY cases, as is true in this case, it may not be that at all. Not only that, it's off putting and honestly not very helpful. You are here to help, right?
OS X 10.9.5
XAMPP: 5.6.30-1

I'm setting up a proper server and only need advice to repair an old Xampp installation so I can move my sites safely without breaking them. Thanks for understanding.
User avatar
moonwalker_repeat
 
Posts: 32
Joined: 30. May 2017 05:38
Location: Earth
XAMPP version: 5.6.30
Operating System: OSX, Windows 10

Re: Trouble with AuthType basic

Postby moonwalker_repeat » 02. June 2017 05:22

As it turns out, the nefarious code WAS caused by the quotes, however it was NOT mistyped keys, NOR was it the OS keyboard settings. It was the editor. Let that be a lesson to me and anybody else out there coding servers on OS X. Use the XCode editor. It doesn't mess with the existing fonts in files. Text Editor does, even if it's set to text only.

Code: Select all
<Directory "/Applications/XAMPP/xamppfiles/admins">
    Options +FollowSymLinks +Multiviews +Indexes
    AllowOverride AuthConfig
    AuthType basic
    AuthName "private"
    AuthUserFile "/Applications/XAMPP/xamppfiles/users/.htpasswd"
    Require valid-user
</Directory>


Had some trouble getting aliases to work so I just got rid of them and replaced with absolute paths. No more 403 pages, but still getting server errors. Error log says can't find the file so I think I need to make some permission adjustments. That's a different issue I can usually figure out so I'm going to mark this solved since the initial problem has been identified and fixed.
OS X 10.9.5
XAMPP: 5.6.30-1

I'm setting up a proper server and only need advice to repair an old Xampp installation so I can move my sites safely without breaking them. Thanks for understanding.
User avatar
moonwalker_repeat
 
Posts: 32
Joined: 30. May 2017 05:38
Location: Earth
XAMPP version: 5.6.30
Operating System: OSX, Windows 10

Re: Trouble with AuthType basic [SOLVED]

Postby moonwalker_repeat » 02. June 2017 08:26

For anyone interested, here's how I solved the permissions issue:

https://community.apachefriends.org/f/viewtopic.php?f=29&t=75775

Script works like a charm now and the best part is, it doesn't use .htaccess which is soon to be deprecated according to Apache 2.4 documentation.
OS X 10.9.5
XAMPP: 5.6.30-1

I'm setting up a proper server and only need advice to repair an old Xampp installation so I can move my sites safely without breaking them. Thanks for understanding.
User avatar
moonwalker_repeat
 
Posts: 32
Joined: 30. May 2017 05:38
Location: Earth
XAMPP version: 5.6.30
Operating System: OSX, Windows 10

Re: Trouble with AuthType basic

Postby JJ_Tagy » 02. June 2017 10:31

moonwalker_repeat wrote:Text Editor does, even if it's set to text only

Text wrangler is a good free editor for OSX that is on par with Notepad++ on Windows.
JJ_Tagy
 
Posts: 788
Joined: 30. January 2012 13:44
XAMPP version: 5.5.15
Operating System: Windows 10 Pro x64

Re: Trouble with AuthType basic

Postby Nobbie » 02. June 2017 19:29

moonwalker_repeat wrote:Perhaps then, this isn't the best forum for you to be trying to help in?


Obviously i still know more about OSX specific problems than YOU and YOU do have an OSX machine. What about that?

moonwalker_repeat wrote:A word of advice?


No. Not from you and for what? As long as my assumptions are even better than from everybody else, why shouldnt i give my ideas about it? Last not OSX is a "unixoid" OS and I am a UNIX guy since many many years.
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04

Re: Trouble with AuthType basic [SOLVED]

Postby Nobbie » 02. June 2017 19:34

moonwalker_repeat wrote:it doesn't use .htaccess which is soon to be deprecated according to Apache 2.4 documentation.


Really? Do you have a link for that? What are they planning to offer instead? Or do they simply want to remove it??
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04

Re: Trouble with AuthType basic

Postby Nobbie » 02. June 2017 19:39

moonwalker_repeat wrote: Try to avoid jumping to conclusions, especially when the conclusion is "operator error." In MANY cases, as is true in this case, it may not be that at all. Not only that, it's off putting and honestly not very helpful. You are here to help, right?


If it is an operator error (as here) it is an operator error. I know that you wont like to read it, but it does not change the truth.

Will you please proof where i was wrong on that? Please offer MANY cases (as you said).
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04

Re: Trouble with AuthType basic

Postby moonwalker_repeat » 02. June 2017 20:54

I'm not going to provide what I've already provided. Your answers have become rude and, non productive, and now are not helping resolve anything at all. All you seem to want to do is argue. Not help.
OS X 10.9.5
XAMPP: 5.6.30-1

I'm setting up a proper server and only need advice to repair an old Xampp installation so I can move my sites safely without breaking them. Thanks for understanding.
User avatar
moonwalker_repeat
 
Posts: 32
Joined: 30. May 2017 05:38
Location: Earth
XAMPP version: 5.6.30
Operating System: OSX, Windows 10


Return to XAMPP for macOS

Who is online

Users browsing this forum: No registered users and 18 guests