Apache

Rotating logs with apache under windows

Mike had a question about rotating the apache logs under windows (with Uniform Server as he was struggling to get it to work. Looking at google and various other locations it seems to be a common problem but very few people had the solution (or the whole solution).
What I found that is if you edit the httpd.conf stored in the usr\local\Apache2\conf directory and add the 2 lines

#rotate logs set here
CustomLog “|w:/usr/local/apache2/bin/rotatelogs.exe w:/usr/local/apache2/logs/access_log 86400” common

just before the <directory /> section then the logs will get rotated every day. Change the 86400 to 61 for once a minute (61 secs to be precise) to test it first.
The .exe on the end of rotatelogs is important (and that seems to be the bit missing from every other page) and naturally the logs directory and the path to rotatelogs.exe needs to exist. The files will start access_log and will have the date and time stamp at the end of the filename.
I include the line starting with a # as a comment but this line is not strictly needed. You will need to stop and start apache for this change to take effect. If any of the paths are incorrect, you will probably find that the welcome page for the web server appears but no other pages on the website will work. If that is the case, then check your path statements to the exe file and to the log directory.
One disadvantage of this is that the rotatelogs.exe file fires up in a dos box (on my machine) but this can be minimised out of harms way but it would be nice to not have this on the machine. I think running apache as a service might solve this problem, but the advantage of uniform server is that the whole thing can be run from a removable disk with no installation required.

Mac troubles.

I went round a friends house on Tuesday night to teach them how to manage the church’s website which runs under Mambo (which I’m starting to regret installing!). Unfortunately this person only has mac’s in the house and doesn’t really know much about the technical side of a mac apart from using word, email and graphical/music packages. He wanted to install a copy of mambo onto his own mac so he could play without distrupting the live server. However mambo needs mysql, php and apache installed. Thankfully apache was already configured but php wasn’t working – it was just displaying the files as text files. However when I searched for httpd.conf it didn’t come back with any details – instead I had to open terminal, change to a directory in /etc and then vi the file – only to find it was readonly, owned by root and when I asked for the root password I was met with a blank stare. I then used netinfo (i think) to remove the asterix in the passwd file for root, changed the password, logged in, edited the httpd.conf and hey presto – php was working. Undo the root passwd setups and then onto mambo installation.
This worked ok until we got to the sql installation as although mysql was installed, we couldn’t find a frontend to configure the databases and couldn’t find anything in google…I thought Mac interfaces were meant to be really helpful and friendly? This one certainly wasn’t.

Anyway, we carried on with testing on the “live” site and discovered that we needed a way of uploading files, specifically mp3 files, to the mambo server but you can only seem to do this if you are the administrator of the server. Not much use for giving users the ability to upload certain files and pictures.
The next solution was to use ftp, so does anyone know a good, easy to use (gui), free, mac ftp client?
Alternatively anyone got any alternatives to running a cms website that allows registered users to upload files (like a blog). I might just start again with an installation of WordPress – might be easier.

.htaccess file wizard

scriptygoddess linked to an article from Jennifer who linked to a online htaccess editor, which enables you to easily password protect, create custom 404 pages etc. However, Chris has discovered that this wizard is allegedly a copy of Eyecreate’s wizard who have posted their conversation with the “author” of the php2b wizard. Like they say, for someone who cant write english very well, it does make you wonder how they wrote the code! It will be interesting to see how this pans out.