...

View Full Version : OS X Server Question



dan_c00per
03-13-2003, 12:33 PM
Hi,

I have recently migrated our server to OS X Server, which seems to be very stable, but I cannot get .htacces files to work, I have added the 'AccessFileName' line in httpd_macosxserver.conf, and written an '.htacces' file and a '.htpasswd' file to protect a folder, but it lets me view the folder regardless.

Any ideas????

krycek
03-13-2003, 01:06 PM
Well, are you using Apache? It does not sound like it.

.htaccess belongs to Apache, you see :)

::] krycek [::

brothercake
03-13-2003, 01:19 PM
OSX server *is* Apache.

I haven't worked specifically with that build; there may be differences with how htaccess works, or it might just be an error in your ht files;

I'm not sure; two things spring to mind -

1 - does .htpasswd contain *encrypted* data - I don't think you can put plain-text passwords in a .htpasswd

2 - is your file called ".htaccess" or ".htacces" - you put the latter, but that might have been a typo


Otherwise, try googling for "htaccess OSX" or some such combination - might be docs out there that tell you what's going on

krycek
03-13-2003, 01:24 PM
OK, fair enough - I didn't know OSX had anything to do with Apache by default. (I tend to stay as far away from Macs as possible :D)

...does it use Apache as in, a proper build, or a modded one?

::] krycek [::

dan_c00per
03-13-2003, 01:33 PM
It uses a 'complete' build of Apache, the spelling was a typo, it is called '.htaccess', I am using a Mac because OS X is the most stable operating system on the market and it includes full UNIX-based operating system and Apache web serving.

The .htpasswd file contains encrypted data created from http://www.euronet.nl/~arnow/htpasswd/

I have tried google, I could not find anything on the subject.

krycek
03-13-2003, 01:44 PM
Originally posted by dan_c00per
It uses a 'complete' build of Apache, the spelling was a typo, it is called '.htaccess',

Yeah... I noticed that ;)


I am using a Mac because OS X is the most stable operating system on the market

:eek: really? :eek: ...I didn't know that :p - I take it you have not tried Linux, then? ;)


and it includes full UNIX-based operating system and Apache web serving.

Yes, but getting OSX to work as a webserver *properly* is apparently notoriously difficult. I don't actually know first-hand because I have had no experience of OSX (thank god!) but I know people who have :)


The .htpasswd file contains encrypted data created from http://www.euronet.nl/~arnow/htpasswd/

I have tried google, I could not find anything on the subject.
I find that a surprise... look at the Apache docs at www.apache.org for a start :)

I also don't really believe you searched google properly - I typed in "htaccess" and I got LOADS of stuff:

http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=htaccess&btnG=Google+Search

Quite a few of those links are good ones and will help you a lot. And that's just on the first page :)

...remember, "google is your friend"! :D

::] krycek [::

dan_c00per
03-13-2003, 01:49 PM
I meant the most stable GUI operating system, and it is very stable, I have not yet managed to crash it, I found a few bits on Google, but they basically all said the same, I have followed them to the letter and still no luck.

I have discovered a command-line util called 'htpasswd' which generates '.htpasswd' files, but still no luck, I think the problem lies in the .htaccess file, here is the file:

AuthUserFile /Library/WebServer/Documents/.htpasswd
AuthGroupFile None
AuthName TestRealm
AuthType Basic


require user test

brothercake
03-13-2003, 02:03 PM
Originally posted by krycek
(I tend to stay as far away from Macs as possible)

I used to be the same; but OSX to OS9 is like WinXP to Win95, as an analogy for quality improvement. OSX is fantastic - my G3 has never crashed (well once, but that was my fault!).

And the GUI is just beautiful; vaguely similar to RedHat in its design aesthetic, but imo much nicer ;)

dan_c00per - sorry, I don't know then. When I get home later, I'll try it out and see if anything is apparent.

dan_c00per
03-13-2003, 02:09 PM
I am getting somewhere now, I had 'AllowOveride None' in my httpd.conf file, which I have now changed and I get a server error, but at least it is now reading the .htaccess file, I just have to find the error in that now.

Cheers.

dan_c00per
03-13-2003, 02:41 PM
Found the problem, it wasn't loading the 'mod_auth' module, it was loading some Apple variation of it which did not contain the 'AuthUserFile' command.

brothercake
03-13-2003, 03:32 PM
so how did you get user authentication to work without that mod, or was it just a case or re-writing the directive to a different command name?

dan_c00per
03-13-2003, 03:39 PM
The build does contain the right module, it was just a case of replacing the Apple one with the Apache one in the config file.


I have got it to the point of asking for a User name and password now, but it tells me the password is wrong everytime, I must still be missing something.

brothercake
03-13-2003, 09:56 PM
I'm trying to test this out ... but OSX won't let me create a file that starts with a dot.

What's the trick?

dan_c00per
03-13-2003, 10:29 PM
Use terminal

Go to the folder you want to create it in and type

'touch <filename>'

and then

'pico <filename>'

to edit it.

The Finder won't show file starting with '.', it sees them as restricted system files, so it still won't show in the finder after you've created it, or when you 'ls' in terminal, you have to do a 'sudo ls' and enter your password to see it

brothercake
03-14-2003, 01:29 AM
I've managed to re-create the problem ...

That was fun in itself - configuring it from scratch, particularly when you've never used a UNIX terminal before :rolleyes: But thanks to your instructions, and O'Reilly Mac Devcenter (http://www.macdevcenter.com/pub/a/mac/2001/12/07/apache.html), I now have a working OSX Server :) (well mostly, apart from the same problem you have!)

But I need to sleep ... I'll try some other stuff tomorrow (unless you've found the answer ...?)

dan_c00per
03-14-2003, 09:08 AM
I found the problem, instead of putting 'require user <username> <username>'
You just put 'require valid-user' and it accepts any Username / password from the selected password file.

Mine works fine after I worked that out.

brothercake
03-14-2003, 01:46 PM
Excellent :thumbsup:

This has ended up like you helped me more than I helped you ;) Unfortunately, mine still doesn't work like that ..



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum