.htpasswd file above htdocs can't be read by server [SOLVED]

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

.htpasswd file above htdocs can't be read by server [SOLVED]

Postby moonwalker_repeat » 02. June 2017 08:21

So in a previous thread I had some trouble getting a basic auth script working. I'll post a link to that here in a few moments.

You can see the original issue here if you like:

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

Once I solved the issues with bad fonts screwing up the script I was still left with a 500 server error due to the server scripts not being able to read the folder or .htpasswd file that was in it. That, as I suspected, was due to permissions stupidity on the OS X host. I'm one stubborn bugger though, and ALWAYS refuse to believe there is no work around. I suspected that the reason the files couldn't be located or read was because "system" was not a user on either the folder or the .htpasswd file. I was right, but you would not believe how many other people over the years have tried to find out how to add system as user in a folder or file, only to be met with, "Why would you want to do that?" and no answers at all.

Well, I figured out how and it doesn't require messing with the terminal.

HOW TO ADD SYSTEM AS USER TO OS X FOLDERS AND FILES.

Step 1. FIND a folder or a file that already has system as a user. (Check the "get info" window)
Step 2. DUPLICATE the folder or file.
Step 3. DELETE the contents of the folder or file, and replace with your own files or code.
Step 4. RENAME the folder or file and place where desired.

VIOLA! Xampp can now find the folders and files it couldn't find before.

DONE.
Don't let the low number of posts fool you. I've been a Xampp user for many years. I opened a new account because I lost my old credentials for the forum.
User avatar
moonwalker_repeat
 
Posts: 22
Joined: 30. May 2017 05:38
Location: Earth
XAMPP version: 5.6.30
Operating System: OSX, Windows 10

Re: .htpasswd file above htdocs can't be read by server [SOL

Postby Nobbie » 03. June 2017 10:36

"Grauenhaft... da rollen sich mir die Fußnägel auf!" (German)

Open a terminal, and enter "man chmod", as well as "man chown" and finally "man chgrp" and read all of these manuals carefully. You must be system admin in some cases in order to execute, therefore enter "sudo chmod ...." etc. in order to execute the commands. Enter the password of your UserID when asked. Have fun!
Nobbie
 
Posts: 9423
Joined: 09. March 2008 13:04

Re: .htpasswd file above htdocs can't be read by server [SOL

Postby moonwalker_repeat » 04. June 2017 08:18

You may have time for that. Many do not. I find it nice to know it can be done without all that.
Don't let the low number of posts fool you. I've been a Xampp user for many years. I opened a new account because I lost my old credentials for the forum.
User avatar
moonwalker_repeat
 
Posts: 22
Joined: 30. May 2017 05:38
Location: Earth
XAMPP version: 5.6.30
Operating System: OSX, Windows 10

Re: .htpasswd file above htdocs can't be read by server [SOL

Postby Nobbie » 04. June 2017 09:46

i dont believe its a question of time. Anyway, what will you do if the parent folder has wrong permissions and even will not allow you to put any files or folders into it? You are wasting your time by such poor "solutions" and not vice verse. Of course you may do what you want, but to the rest of the world: dont follow that poor advice, its the wrong direction.
Nobbie
 
Posts: 9423
Joined: 09. March 2008 13:04

Re: .htpasswd file above htdocs can't be read by server [SOL

Postby moonwalker_repeat » 09. June 2017 05:49

Time is everything. No matter who you are. Most of us want Xampp to simply WORK for our website environments. The whole reason most of us download and install it is because it's easy and doesn't take as much time as learning how to deal with full blown Linux installations, which I'm sure you know are far more complicated and involve far more command line instructions to implement properly. That, in point of fact, is exactly why Apachefriends developed Xampp to begin with. To avoid all that crap at least as much as possible. I don't, and most of Xampp users do not, have time to mess around with reading multiple manuals. Most of us are about getting Xampp up and running, and CUSTOMIZED to our preferences, so that we can run and develop our websites as quickly and simply as possible. If you think that by not reading everything available on the subject is more of a waste of time, have fun with that. I've been using Xampp in various renditions for nearly ten years now, and know from experience that it CAN be customized AND tweaked as much as anyone wants.

Xampp is an OPEN SOURCE stack of OPEN SOURCE software and web applications. Open Source means it is left UNENCRYPTED for the express purpose of being modified according to every individual user's preference. Therefore, we are ALL free to modify it to suit our individual needs, and YOU have nothing to say about whether what we need is appropriate or not. Your opinion is worth as much as we think it is. If you think what we want to do shouldn't be done, that opinion is worth nothing to anyone but yourself. If you think otherwise, then you do not understand what OPEN SOURCE means at all.

Stop trying to force your own idea of what is "the right way" and what is "the wrong way" to do things with Xampp. They are your own IDEAS, and may be fine for you, but may not suit the needs of others.
Don't let the low number of posts fool you. I've been a Xampp user for many years. I opened a new account because I lost my old credentials for the forum.
User avatar
moonwalker_repeat
 
Posts: 22
Joined: 30. May 2017 05:38
Location: Earth
XAMPP version: 5.6.30
Operating System: OSX, Windows 10

Re: .htpasswd file above htdocs can't be read by server [SOL

Postby Nobbie » 09. June 2017 10:15

BLablablablabla...

You are barking up the wrong tree. Of course you may do everything you want and of course you may run an Online Server and you may modify whatever you want. But dont expect any support, that is NOT included in your open source visions. If you are in any troubles (even if you have a hacked server) go and ask somewhere else, you wont get any support in the Xampp forum. Thats all.

moonwalker_repeat wrote:If you think that by not reading everything available on the subject is more of a waste of time, have fun with that.


Yes, i do believe strongly that its a waste of time to struggle around with folders and files without knowing anything about it and without a global overview, how these things are working. You are wasting youre time by such poor "hacks", i gonna read that manual once and then i know how to do for my whole life. You have to start from scratch with each new problem, i mostly know within seconds what the problem is - because i took the little time to look into the manuals.

moonwalker_repeat wrote:I've been using Xampp in various renditions for nearly ten years now, and know from experience that it CAN be customized AND tweaked as much as anyone wants.


And you are still a NOOB in comparison. I also used Xampp since 10 years, but i also learned how to configure Apache, MySQL and PHP and Perl without Xampp. I learned how to program in HTML, PHP and Perl, i learned about Apache configuration, I learned about server configuration, about TCPIP, about SQL, about File Systems, about Users and rights management, about Linux vs. Windows, about OSX vs. Linux, about this and that and that. And all that i learned by simply reading the manual and practicing due to the manuals. I have become a huge expert in all these things, whereas you remain a poor little Webprogrammer without any knowledge about your OSX system. You still cannot setup a wevserver without Xampp. You still have no Linux skills, the most important OS for webservers. Are you proud of that? I wouldnt. I have never asked in any forum about any problem, i all found it on myself in reading articles and manuals. And that knowledge remains forever.
Nobbie
 
Posts: 9423
Joined: 09. March 2008 13:04

Re: .htpasswd file above htdocs can't be read by server [SOL

Postby moonwalker_repeat » 10. June 2017 22:06

Nobbie wrote:BLablablablabla...



Thanks for the maturity and help. :roll:
Don't let the low number of posts fool you. I've been a Xampp user for many years. I opened a new account because I lost my old credentials for the forum.
User avatar
moonwalker_repeat
 
Posts: 22
Joined: 30. May 2017 05:38
Location: Earth
XAMPP version: 5.6.30
Operating System: OSX, Windows 10

Re: .htpasswd file above htdocs can't be read by server [SOL

Postby moonwalker_repeat » 11. June 2017 20:24

MUCH better solution: Enable root user login and work on Xampp configuration only as that user. It can be risky but overcomes many permissions issues. You can, if necessary, add system (yourself if you are logged in with that account) as user and owner. No terminal necessary.

https://support.apple.com/en-us/HT204012

This alone solved every issue I've had over the past week. I've completely uninstalled Xampp then started from scratch using system account. Took a couple of hours total (including reinstalling two working websites and configuring). Xampp now running exactly as I want it to.

Happy days!
Don't let the low number of posts fool you. I've been a Xampp user for many years. I opened a new account because I lost my old credentials for the forum.
User avatar
moonwalker_repeat
 
Posts: 22
Joined: 30. May 2017 05:38
Location: Earth
XAMPP version: 5.6.30
Operating System: OSX, Windows 10

Re: .htpasswd file above htdocs can't be read by server [SOL

Postby Altrea » 11. June 2017 20:33

@moonwalker_repeat:
You can do what ever you want and whatever works for you on your system.
I cannot agree with any of your alternative solutions and cannot recommend other users to use them.
To lower the security of a system just to avoid using the terminal seems like a bad strategy to me.
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: 8728
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: .htpasswd file above htdocs can't be read by server [SOL

Postby Nobbie » 11. June 2017 21:27

Altrea wrote:I cannot agree with any of your alternative solutions and cannot recommend other users to use them.


Yes, I totally agree. Its horrible!
Nobbie
 
Posts: 9423
Joined: 09. March 2008 13:04

Re: .htpasswd file above htdocs can't be read by server [SOL

Postby moonwalker_repeat » 12. June 2017 04:40

Altrea wrote:@moonwalker_repeat:
You can do what ever you want and whatever works for you on your system.
I cannot agree with any of your alternative solutions and cannot recommend other users to use them.
To lower the security of a system just to avoid using the terminal seems like a bad strategy to me.


Fine. You don't have to. It's a free world for the most part. Look, all I want is a development platform up and running as suits my particular needs as quickly as possible.

Please note: I am NOT advocating anyone put their systems at risk by making them publicly available. In point of fact, that isn't what I'm doing either.

Rather than simply stating you don't agree, how about explaining WHY? What, in what I've done, creates a security risk exactly? Simply stating bluntly there is no reason to do what I've done (which is simply NOT true ~ what on earth do you know about my environment? Nothing. That's what.

You people need to learn to be more helpful than critical by ASKING more about why someone may want to do something instead of simply shooting down every question you don't agree should be asked. That's just childish.

By the way, solutions are solutions, and ALL of them are alternatives to something. If mine are so all fired "horrible" then delete all my posts. In fact, go ahead and delete my entire profile. I really don't care. This forum was no help to me to begin with.
Don't let the low number of posts fool you. I've been a Xampp user for many years. I opened a new account because I lost my old credentials for the forum.
User avatar
moonwalker_repeat
 
Posts: 22
Joined: 30. May 2017 05:38
Location: Earth
XAMPP version: 5.6.30
Operating System: OSX, Windows 10


Return to XAMPP for Mac OS X

Who is online

Users browsing this forum: No registered users and 3 guests