Apache 2.2 on OS X Tiger

System Preferences
System Preferences

This guide will show you how to install Apache 2.2 on Mac OS X Tiger (and probably Leopard) in a way that will allow you to turn the apache server on and off via System Preferences. Phpmac.com had a guide to do this for Apache 1.3 but I have been unable to get onto that website for a long while now so I decided to write my own guide. This guide assumes that you are installing from source, that you have the Xcode package installed and you know how to user the Terminal.

Getting the source
First thing you will need to do is to go to httpd.apache.org and download the latest version of Apache 2.2. I used version 2.2.8 but the latest is 2.2.9 at the time of writing this. You should see a link to the source on the front page.

Configure and Compiling
I choose to install apache to /usr/local/apache2 with modules enabled. Assuming that you have unpacked the version of Apache you have just downloaded you should open the Terminal and change into that location.
$ ./configure --prefix=/usr/local/apache2 \
--enable-module=most \
--enable-shared=max
$ make
$ sudo make install

These commands will configure the httpd package, compile and then install it. This is the easy part, the hard part is configuring Apache to run from system preferences.

httpd.conf
Now that Apache is installed we need to configure it. There are three things you will need to do to the config file which is located in /usr/local/apache2/conf/httpd.conf . The location will depends upon what you used for –prefix= .

You need to search for the user and group name in httpd.conf. The default user and group is “daemon” but OS X uses “www”. This is line 65 on my install. After you have changes the user and group from “daemon” to “www” it should look like this.

User www
Group www

At the bottom of this config file you need to add a line to tell Apache where to store it’s PID file. This is important as this tells OS X what program to terminate when you stop the Apache service.
PidFile /var/run/httpd.pid

System link
This is the last step to getting Apache 2.2 to work from system preferences but I have an important note. This moves the default Apache 1.3 binary and replaces it with a link to our Apache 2.2 install. I have found that when I install one of Apple’s security updates the link has been replaces with the original Apache 1.3 binary. Therefore you may have to repeat this step from time to time.

In there terminal there are three command you have to run. The first one moves us into the directory that we need to work in. The second commands moves the Apache 1.3 binary out of the way and the final command replaces it with a link to our Apache 2.2 install.

$ cd /usr/sbin
$ sudo mv -v apachectl apachectl-1.3
$ sudo ln -sv ../local/apache2/bin/apachectl .

The End
Now all you have to do is go to System Preferences, click on “Sharing” and then enable “Personal Web Sharing”. When you open up your browser and type in 127.0.0.1 or [::1] (IPv4 and IPv6 respectively) you should see “It Works!“.

PSU hell

Some time ago I was given a a PowerMac G4 Quicksilver that needed a new PSU. Instead of getting a new one I made an adapter that used the damaged original PSU to supply the 25v needed and a regular ATX PSU to do the rest of the work.

Now I have a newer PowerMac G4 Mirrored Drive Door that also has a damaged PSU. I plugged it in when I got home and the fuse blow up. I’m hoping that the fuse is the only thing that needs replacing as this computer is would be the best mac that I have.

It would also seem that either the PSU or logic board has gone in my PowerMac G4 Sawtooth so that would need fixing at some point or it might be given away for recycling. In other mac news I need a new logic board for my PowerBook G4 because my FW400 port has gone and that is needed for the scanner. Even if I can’t get the software to work it would be a good idea to fix the laptop before my warranty runs out. Also my PowerMac G3 B&W is running fine with no faults that I know of. Cos one of them has to be fine…

Still some SPARC left

Last week I decided to start working on my Sunblade 100 that I got back in November. It has been sitting on my stack for about the last two months without even being turned on once. The main reason for this was the lack of networking and my knowledge of Sun’s Solaris OS. After hearing that some people had Ubuntu server running on these machines I decided to download and try it. I now have Ubuntu 7.10 installed with networking and a Linux environment that I’m used to. After disabling the built in speaker because it frustrated me to the point of smashing some keys off of my keyboard with it’s beeping when using the console. Now only thing that annoys me now is the loud hard drive but as I use it via SSH I don’t have to been in the same room as it.

Sun Blade 100

The Blacklist

In case you’re not familiar with the term “blacklist” I will elaborate. There are three colours representing different kind of list; White, Black and Red. White is a free pass with no questions asked, Black doesn’t let you in the club and Red puts you in a headlock until the cops arrive and take you away.

My blacklist is very small at the moment only consisting of one email address and one IP address. I have some anti-spam measures in place but they don’t stop everyone getting through so I look for a patten from the IP and email address marked as spam. Any that turn up a lot go on the blacklist and are never heard from again….hopefully.

Cosmo version 9 and Server

I managed to get Cosmo version 9 online at midnight but there was a problem with IE6. Thankfully it was only IE6 and it was fixed within half an hour after I woken up and had breakfast. The site is controlled by one single PHP page that calls in the content and updates the blog each month automatically. It has in place functions that make the site more secure such as checking that the page trying to be loaded is a real page and not an off site link or an incorrect date.

The server that hosts all my websites is now running my own home brewed Linux OS called Blue Square Linux. The server has also had an extra 500GB fitted via a RAID SATA controller. It was a little bit of a problem at first because the kernel was custom compiled a long time ago without support for SATA.

Cosmo v9 – www.cosmo1847.co.uk
Blue Square Linux – www.bluesquarelinux.co.uk

Sun Blade 100

On Sunday I won a bid for a Sun Blade 100 on ebay and today it arrived. I am currently installing Sun Solaris 10 8/07 onto it. This is the first time I have touched the Sun Solaris OS and it is also my first SPARC workstation so this is all new to me but I am learning. The reason I got this is for me to learn about the Sun OS and hardware because this should provide me with helpful knowledge for future use. Once I have gotten used to Solaris and Sun’s hardware I hope to use it for a SPARC version of my OS.Sun Blade 100

Powermac G4

I’ve been given an Apple Powermac G4 Sawtooth computer as my friend’s dad was throwing it out. I took it because I knew it was better than the Powermac G3 Blue and White that I have. Today I striped it down, cleaned all of the parts and then put it all back together. Whilst I was doing this I identified the parts of the computer that make the most noise and started plotting on how to get rid of these. I need to replace the 120mm case fan and hard drive to make this computer silent. This Powermac G4 was formated with Mac OS X 10.4 Tiger and also had OS 9.2.2 installed so I can use classic applications or dual boot into OS9. This mac has 1.25GB of RAM and a 10GB hard drive along with a DVD drive and internal Zip100 drive. I use this to backup important information that I have onto Zip100 discs. I also got a Mitsubishi Diamond Plus 73 CRT monitor with the computer and it’s great. If you want the specs leave a comment.

Logger

As of this moment I’ve decided that I will use this website to tell you about any project that I’ve been working on no matter how small it is. This way you get to find out more about me and what I can do. It also makes this website a big more interesting and helpful.

On Tuesday I decided that I will put a hit counter back on my personal website, www.cosmo1847.co.uk. I have done a hit counter before with PHP but the way they worked was to count everytime the script was loaded, meaning that when someone clicked refresh it would count them again. The way I got around this was by only loading the script when the first some one the website.

This was not what I wanted, I have progressed since then and I wanted a unique visitor counter so I would know how many people used my website. After looking about I found this guide which shows you how to make a unique hit counter using some files to store the information. Using this as a template I set about making a unique hit counter using MySQL and PHP. I used MySQL because it is more secure and as this will have to store IP addresses I don’t really want to leave them lying about in a readable format. The hit counter is now working on my personal website but it does not display the amount of visitors as I do not want them to know so I currently access via MySQL Query Browser, one of the tools I use for MySQL work.

FTP Whoes

I have got a working FTP server installed on the server but there is a problem, A very big problem. It accepts my user fine but not the new one that I made for Keaton. Using my ftp client, CyberDuck, I can’t log in using FTP but I can using SSH as I have made Keaton a user on the computer. The problem with SSH is the securety risk is poses to the server as they can get into all sorts out places inclusing the root, web and my person files that are stored on the server. For this reason I shell not allow using SSH access until I have sorted out a way to limit their access to directories. I will be working on FTP in the hoildays to hopefully fix this problem. Until then no one can upload stuff to the server.

Keaton’s getting the nack

I host a few wordpress web logs for my friends on my server to give it move or a point than only having my two sites on it. Keaton is one of them and he’s starting to personalize his wordpress web blog by adding a theme he found to it. I have this theme on that I am going to make small changes to here and there. The main thing I’m thinking about is the login button, I just can’t find it. Well I’m going to change some settings on my wordpress to see how things work so I can help Keaton.