Contents

Opening Comments

Apache, along with PHP and MySQL, is very straight forward to install on a stock LinkStation 2 with the OpenLink firmware installed. If you have experience with building these packages, or compiling in general, it is a snap. If you have little or no experience in such matter, just follow the guide -- everything is reversible.

If you have not already done so, visit the Openlink section and follow the instructions for installing the telnet enabled firmware. You will also need to download and install the [MIPSel Tools] before continuing.

A Remark on "--prefix"

The prefix argument, which you will see in every section below, allows you to install Unix packages to alternate locations. This is very important is the case of the LinkStation since all three packages take over 75 megs to install. You will not be able to install these packages to your root partition and doing so would be very bad.

I chose to create an "opt" directory under "/mnt/hda" to install each of these packages too, using a separate directory for each. This was done to keep the packages separated and easy to manage in the future. You may, of course, alter your install locations in any way but, if you are new to this, I suggest following my example.

It's also a good idea to create a directory to download stuff when using wget, lets use /mnt/hda/misc

MySQL

Begin with MySQL. If you do not wish to compile MySQL support into your system, please skip to the next section.

cd /mnt/hda/misc

Download the latest recommended release of MySQL from http://www.mysql.com (4.1.13, at the time of this writing).

Important Memory Usage Note: MySQL takes just under 25% of the LinkStation's total available memory when running. This should be taken into serious consideration if you choose to install MySQL support with your web server.

TODO: Need to get the server running automatically at boot.

[Ralf] Here is how to start MySQL 5 automatically at boot. I guess it works quite similar with MySQL 4.X.

Apache 1.3.xx

Apache itself is the next install. If you are not planning on installing PHP, you may ignore the "--enable-module=so" attribute below.

I decided to install Apache 1.3 because that is what my web host uses. Installing Apache 2 would be very similar and the following instructions can be easily adapted by reading the INSTALL document in the Apache 2 tarball.

Download the latest version of Apache 1.3 from http://www.apache.org (1.3.33, at the time of this writing).

Copy the archive to your LinkStation as you would any other file, into your share folder.

You will, at the very least, need to change your port to 81 (or some other port). Open '/mnt/hda/opt/apache/conf/httpd.conf' and search for '80' -- change it to '81' (or some other port).

I also suggest changing the root directory to the files to "/mnt/hda/share/www" so you can have easy access to them over the Samba share. Search for 'DocumentRoot' and change the first reference (roughly line 288) to the above path. Search again and you will find another reference to change (around line 313).

Finally, run '/mnt/hda/opt/apache/bin/apachectl start' to start the server.

Copy that start up script to /etc/init.d and include in startup shutdown

PHP

Last we will set up PHP. I decided to install the latest version of PHP4 because, again, this is what my web host uses. You may decide to install PHP5, which would requires only 1 slightly different step below.

Pay special attention to the 'configure' (step 6) command below. If you installed the above packages to an alternate location you will need to update the paths in the proper attribute.

Download the latest version of PHP4 from http://www.php.net (4.4.0, at the time of this writing).

Copy the archive to your LinkStation as you would any other file, into your share folder.