Posted: March 24th, 2009 | Author: Foamcow | Filed under: Web Design | Tags: anti spam, security, Web Design, web development | Comments Off
I seem to have hit on a simple way to prevent or at least greatly reduce the amount of spam generated by having a mail form or a comment form on your website.
Sure you can use a CAPTCHA but there are inherent problems with them – and I find them a little annoying if I’m honest.
The method I have adopted is to create a field on the form with the label “Leave this blank”.
If the field is filled in (as it will be by a bot that just completes every field) then I tag the mail as spam.
So far I’ve had 100% success with no false positives.
It’s always going to trip up now and again but so far, so good. Simple and effective!
Posted: May 24th, 2007 | Author: Foamcow | Filed under: Vintage | Tags: apache, osx, server, web development | Comments Off
I use an Xserve as a testing/development server in house and it’s set up with a few virtual servers that I configured through the Admin Server tool under OSX Server. However a few of these dev sites require .htaccess files to handle some URL rewriting etc. I had problems getting .htaccess to work.
Searching online yielded some clues but my /etc/httpd/httpd.conf file looked different to all the examples I found.
I’m only slightly familiar with Apache config files too so it was a little confusing.
I discovered that the config was split up. Instead of editing /etc/httpd/httpd.conf I had to do the following:
- Using the OSX Server Admin interface I disabled the module mod_auth_apple and instead enabled mod_auth using the following pathnames:
- /usr/libexec/httpd/mod_auth.so
- mod_auth.c
You can possibly do this in the config file, but I chose the Server Admin tool to stay safe.
- The docs say to edit /etc/httpd/httpd.conf but I couldn’t find the right bits in there. Instead I found them in /etc/httpd/sites/0000_any_80_.conf and changed AllowOverride None to AllowOverride All.
- Then I edited the conf file for the virtual server I was using, in this case it was called 0005_any_80_cms.dev.conf. Once again I set AllowOverride None to AllowOverride All.
I’ve no idea at the moment if this is the right way to do it all, but it does seem to work. I’ll post more should I find any problems or the ‘proper’ way to do it.
Warning: Don’t try this unless you know what you are doing. I’ve noticed a few problems already so at the very least BACKUP ALL YOUR FILES FIRST!