apache

localhost webdev: virtual host setup on Mac OS X with MAMP

23 October, 2008 - 11:28

Reminder to self: how to set up a virtual host for localhost webdevelopment on OS X with MAMP

  1. DNS setup: add an entry for the local domain name in /etc/hosts, e.g.
    127.0.0.1     foo.localhost

    and flush DNS cache with

    dscacheutil -flushcache

  2. Apache config (/Applications/MAMP/conf/apache/httpd.conf): add a virtual host entry like
    <VirtualHost *>
      ServerName foo.localhost
      DocumentRoot /Users/eddywally/Sites/foo/localhost-dev/drupal
    </VirtualHost>

    and restart webserver, e.g. with

    /Applications/MAMP/bin/apache2/bin/apachectl restart

  3. Connect to http://foo.localhost:8888 (don't forget the nonstandard port number, unless you configured MAMP to use standard port 80).
Read more...

Blocking referer spam with Apache .htaccess directives

28 April, 2006 - 16:03

The logs of my (drupal powered) website show a lot of referer spam. Some time ago I had this statistics page which contained a listing of the last 10 pages my site's visitors came from (aka referers). Soon spambots found out and spammed this list. I made the list invisible for anonymous visitors, but nevertheless spambots stil target my site (less frequent than when the list was visible, however), polute my stats, use bandwidth, use processing power and kill those cute little puppies. Now I went a bit further to block those dirty spambots ...

Read more...