- Create a MySQL password file:
|
libexec/mysqlmanager --passwd --user mysql >> /etc/mysqlmanager.passwd
|
- At the following prompt enter
You should now have a fully functioning
version of MySQL on your LinkStation. Now we can set up
the server to start like any other service.
Go back to where you have build
MySQL
|
/mnt/hda/misc/mysql-4.1.20
cp support-files/mysql.server /etc/init.d
chmod 755 /etc/init.d/mysql.server
|
You can now start your MySQL daemon as follows:
|
/etc/init.d/mysql.server start
|
PLEASE REMEMBER TO SET A
PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
|
/mnt/hda/opt/mysql/bin/mysqladmin -u root password 'new-password'
/mnt/hda/opt/mysql/bin/mysqladmin -u root -h 'servername' password 'new-password'
|
Start up and shutdown at boot
|
ln -s /etc/init.d/mysql.server /etc/rc.d/rc2.d/S99mysql.server
ln -s /etc/init.d/mysql.server /etc/rc.d/rc6.d/K92mysql.server
ln -s /etc/init.d/mysql.server /etc/rc.d/rc0.d/K92mysql.server
|
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.
|
cd /etc/rc.d
ln -s ../init.d/mysql.server rc2.d/S99mysql
ln -s ../init.d/mysql.server rc2.d/K99mysql
|
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.36, at the time of this edit).
|
wget http://apache.rmplc.co.uk/httpd/apache_1.3.36.tar.gz
tar -zxvf apache_1.3.36.tar.gz
cd apache_1.3.36
|
|
./configure --prefix=/mnt/hda/opt/apache --enable-module=so
make
make install
|
You should get this message -
+--------------------------------------------------------+
| You now have successfully built and installed the |
| Apache 1.3 HTTP server. To verify that Apache actually |
| works correctly you now should first check the |
| (initially created or preserved) configuration files |
| |
| /mnt/hda/opt/apache/conf/httpd.conf
| |
| and then you should be able to immediately fire up |
| Apache the first time by running: |
| |
| /mnt/hda/opt/apache/bin/apachectl start
| |
| Thanks for using Apache. The Apache Group |
| http://www.apache.org/ |
+--------------------------------------------------------+
You will, at the very least, need to change
your port to 81 (or some other port).
|
vi /mnt/hda/opt/apache/conf/httpd.conf
|
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, start the server.
|
/mnt/hda/opt/apache/bin/apachectl start
|
Copy that start up script to /etc/init.d
and include in startup shutdown
|
cp /mnt/hda/opt/apache/bin/apachectl /etc/init.d
|
|
ln -s /etc/init.d/apachectl /etc/rc.d/rc2.d/S99apachectl
ln -s /etc/init.d/apachectl /etc/rc.d/rc6.d/K92apachectl
ln -s /etc/init.d/apachectl /etc/rc.d/rc0.d/K92apachectl
|
- TODO: Flush out the config file editing
instructions.
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.
IMPORTANT
Pay special attention to the 'configure'
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.2, at the time of this edit).
|
wget http://uk2.php.net/get/php-4.4.2.tar.bz2/from/uk.php.net/mirror
|
It may download as a file called 'mirror' if so
|
mv mirror php-4.4.2.tar.bz2
|
|
bunzip2 php-4.4.2.tar.bz2
tar -xvf php-4.4.2.tar
cd php-4.4.2
|
This is all one command and
should be input on one line
|
./configure --prefix=/mnt/hda/opt/php4 --with-mysql=/mnt/hda/opt/mysql
--with-apxs=/mnt/hda/opt/apache/bin/apxs --with-config-file-path=/mnt/hda/opt/php4/lib
|
If you're wanting swisscenter you need to
|
./configure --prefix=/mnt/hda/opt/php4 --with-apxs=/mnt/hda/opt/apache/bin/apxs
--with-mysql=/mnt/hda/opt/mysql --with-zlib --with-zlib-dir --with-gd --enable-gd
--with-jpeg-dir=/usr/local --with-png-dir=/usr/local --with-config-file-path=/etc
--enable-mbstring
|
Should get this
+--------------------------------------------------------------------+
| License: |
| This software is subject to the PHP License, available in this |
| distribution in the file LICENSE. By continuing this installation |
| process, you are bound by the terms of this license agreement. |
| If you do not agree with the terms of this license, you must abort |
| the installation process at this point. |
+--------------------------------------------------------------------+
| *** NOTE *** |
| The default for register_globals is now OFF! |
| |
| If your application relies on register_globals being ON, you |
| should explicitly set it to on in your php.ini file. |
| Note that you are strongly encouraged to read |
| http://www.php.net/manual/en/security.globals.php |
| about the implications of having register_globals set to on, and |
| avoid using it if possible. |
+--------------------------------------------------------------------+
You will get a message
|
Build complete.
(It is safe to ignore warnings about tempnam and tmpnam).
|
Then to finish
Copy over the default config file.
IMPORTANT
If you altered the "--with-config-file-path"
attribute, above, you will need to change the below command
to copy to the appropriate path.
|
cp php.ini-dist /mnt/hda/opt/php4/lib
|
Open up apache's conf file and verify that
the following line is included:
|
vi /mnt/hda/opt/apache/conf/httpd.conf
|
|
LoadModule php4_module libexec/libphp4.so (for PHP4)
LoadModule php4_module libexec/libphp5.so (for PHP5)
|
If it is not, add it. Also add the following
two lines just below the LoadModule command:
|
AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps
|
Restart Apache and PHP should now be working.
|
/etc/init.d/apachectl restart
|
- TODO: More information on configuration
of PHP
- TODO: Information on adding additional
modules to PHP