Archive for category How To

OSX and Apache .htaccess allow mode rewrite

So today i had to get Apache, PHP and Mysql running again on my macbook after installing a new hardrive.

PHP is installed already so thats fine. Mysql a simple download and install. I stick to the 32 bit for now as it not everything plays nicely w/ the 64 bit. Especially not with Python.

Apache is naturally installed. Just need to turn on/off the internet sharing within the System Preferences Pane.

Then comes the tricky part.

In the http.conf file: ensure that the line including the ModRewrite module is uncommented.

The line will look like this:

LoadModule rewrite_module libexec/apache2/mod_rewrite.so

Then go down to your system directive:

And make it look like this:

<Directory />
Options FollowSymLinks
AllowOverride All
# Order deny,allow
# Deny from all
</Directory>

Also ensure that in the /etc/apache2/users/username.conf file that it looks like:

<Directory "/Users/username/Sites/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
Allow from all
</Directory>

Additionally when defining your Extra Virtual hosts: Make sure to enable all the error logs etc:

ex:

<VirtualHost *:80>
ServerAdmin username@gmail.com
DocumentRoot /Users/username/Sites/my.site.com
ServerName local.site.com
ServerAlias local.site.com
RewriteLog "/Users/username/Sites/logs/my.site.com/rewrite_log"
ErrorLog "/Users/username/Sites/logs/my.site.com/error_log"
CustomLog "/Users/username/Sites/logs/my.site.com/access_log" common
</VirtualHost>

No Comments

How To: Setup Virtual Hosts on OS X

http://mark-kirby.co.uk/2008/setting-up-virtual-hosts-on-os-x-leopard/

No Comments