Home Forums OS X Server and Client Discussion Web htaccess on Mac OS X SERVER (10.2.8)

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #358737
    Anonymous
    Guest

    I have many times successfully enabled htaccess files on mac os x CLIENT, but every time I try to enable htaccess on mac os x server (10.2.8) it fails. I have tried editing the AllowOverride directive in httpd.conf and httpd_macosxserver.conf and everytime apache refuses to restart. Does any one know how to get htaccess working in SERVER?

    I have tried uncommenting out the default AllowOverride directive (in both httpd.conf and httpd_macosxserver.conf): # AllowOverride None
    and changing it to:

    AllowOverride All
    and
    AllowOverride AuthConfig
    (preferred method)

    I have been editing the files using sudo pico. Therefore the permisisons and ownership remain unchanged. Also after I make the edit and it does not restart, I go back and remove the edit (comment it out) and restart the sever using the same process without failure.

    Here is the output when I try to restart apache (with the edit):
    —————————————————————————-
    [www:/etc/httpd] caupwc% sudo apachectl start
    Syntax error on line 515 of /etc/httpd/httpd.conf:
    AllowOverride not allowed here
    /usr/sbin/apachectl start: httpd could not be started
    —————————————————————————-

    Since I am simply removing the hash I know I am not putting the directive in the wrong place.

    I also looked around in the log file but it is not displaying any errors regarding the configuration there.

    Please no responces regarding CLIENT – I already know how to do this in CLIENT.

    #358745
    Anonymous
    Guest

    I am also going to have to use mod_pubcookie on this server and pubcookie works very similar to htaccess files. So just using the apple auth won’t work.

    #358752
    honestpuck
    Participant

    Hi,

    I think you’ll find that the best place to modify this is in the site config file which you’ll find in /etc/httpd/sites – if you only have the default site set up then it will be ‘0000_any_80_.conf’ and in that file you’ll find that the ‘AllowOverride None’ is not commented out – just change the line.

    Tony

    #358757
    Anonymous
    Guest

    I found the problem and the solution to Mac OS X SERVER not running htaccess. The problem is two part. First by DEFAULT mod_auth is not loaded in to Apache by httpd.conf. Apple replaced Mod_Auth with Mod_auth_apple for whatever reasons they have. Here are the changes I made to httpd.conf:

    I Added:

    LoadModule auth_module /usr/libexec/httpd/mod_auth.so
    AddModule mod_auth.c

    In their respective locations.

    I also commented out Mod_Auth_Apple:

    #LoadModule apple_auth_module /usr/libexec/httpd/mod_auth_apple.so
    #AddModule mod_auth_apple.c

    You may be able to keep mod_auth_apple loaded, I did not test it as I want to keep things as simple as possible – avoid potential conflicts between the two mods.

    The second part requires adding the AllowOverride directive into the virtual host definition in httpd_macosxserver.conf. Somewhere within this file you must have the following:


    Options Indexes FollowSymLinks MultiViews
    AllowOverride AuthConfig
    Order allow,deny
    Allow from all

    With these two changes to the apache configuration files OS X SERVER will now recognize properly formatted .htaccess files and verify against .htpasswd files.

    #363665
    Anonymous
    Guest

    That doesn’t work for Mac OS X 10.4 Server (Tiger)!!

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.

Comments are closed