Sunday, March 23, 2008

Enable .htaccess in Leopard

By default, in Leopard Apache, you can't use the .htaccess files.

The solution is to edit your .conf file and modify 2 lines:

-> Open Terminal App
-> Write "sudo pico /private/etc/apache2/httpd.conf"
-> Press ctrl + w
-> Type "AllowOverride" and press enter
-> Replace "AllowOverride none" for "AllowOverride All"
-> Press againg ctrl + w and then enter
-> Replace again "AllowOverride none" for "AllowOverride All"
-> Press ctrl + x
-> Type 'y'
-> Press enter
-> Type "apachectl graceful" and press enter
And it's done, you can close the Terminal and start using .htaccess files

3 comments:

builtbylane said...

I need your help!

I just went through and changed my Apache server settings as described above, but when I performed the last command – 'apachectl graceful' – I got the error message:

CFURLWriteDataAndPropertiesToResource(/System/Library/LaunchDaemons/org.apache.httpd.plist) failed: -10

Alas, .htaccess still doesn't work for me.

Unknown said...

Hi Lane, I had the same error message (failed -10) using the apachectl graceful command.
But just ignore it. And to restart the web server, use instead the System Preferences panel, and the Shared Web Server (Sharing tab).
If you actually change and made no mistake in httpd.conf, it will work !!

Unknown said...

The last command should read:

-> Type "sudo apachectl graceful" and press enter