OK here goes, but before I go on I feel I should point out that I am very new to the UNIX world (loads of NT and VMS in the past). If I have made any mistakes or gone the long way round then please let me know, but be nice about it as I am still learning.
MySQL first (some if this is pulled from the MySQL install documentation at www.mysql.com):-
Installing MySQL on a Cobalt RAQ3
Note: Do not be tempted to use an RPM installation as this seemed to crash the RAQ after a little while
Pick the directory under which you want to unpack the distribution, and move into it (e.g. /tmp)
Copy the latest stable MySQL source distribution to this directory (the kit will be named `mysql-VERSION.tar.gz', where VERSION is a number like 3.23.28).
Add a user and group for mysqld to run as:
shell> groupadd mysql
shell> useradd -g mysql mysql
Note that you may need to fully qualify these commands with their paths.
These commands add the mysql group, and the mysql user.
Unpack the distribution into the current directory:
shell> gunzip < /path/to/mysql-VERSION.tar.gz | tar xvf -
This command creates a directory named `mysql-VERSION'.
Change into the top-level directory of the unpacked distribution:
shell> cd mysql-VERSION
Note that currently you must configure and build MySQL from this top-level directory. You can not build it in a different directory.
Configure the release and compile everything:
shell> ./configure --prefix=/usr/local/mysql
shell> make
When you run configure, you might want to specify some options. Run ./configure --help for a list of options.
Change to the root user:-
shell> su
and enter the root password
shell> make install
Create the MySQL grant tables (necessary only if you haven't installed MySQL before):
shell> scripts/mysql_install_db
Change ownership of the installation to the user that you will run mysqld as:
shell> chown -R mysql /usr/local/mysql
shell> chgrp -R mysql /usr/local/mysql
The first command changes the owner attribute of the files to the mysql user, and the second changes the group attribute to the mysql group.
After everything has been installed, you should initialize and test your distribution:
shell> /usr/local/mysql/bin/safe_mysqld --user=mysql &
If that command fails immediately with mysqld daemon ended then you can find some information in the file `mysql-data-directory/'hostname'.err'. The likely reason is that you already have another mysqld server running.
Testing the installation
Use mysqladmin to verify that the server is running. The following commands provide a simple test to check that the server is up and responding to connections:
shell> BINDIR/mysqladmin version
shell> BINDIR/mysqladmin variables
The output from mysqladmin version varies slightly depending on your platform and version of MySQL, but should be similar to that shown below:
shell> BINDIR/mysqladmin version
mysqladmin Ver 6.3 Distrib 3.22.9-beta, for pc-linux-gnu on i686
TCX Datakonsult AB, by Monty
Server version 3.22.9-beta
Protocol version 10
Connection Localhost via Unix socket
TCP port 3306
UNIX socket /tmp/mysql.sock
Uptime: 16 sec
Running threads: 1 Questions: 20 Reloads: 2 Open tables: 3
To get a feeling for what else you can do with BINDIR/mysqladmin, invoke it with the --help option.
Verify that you can shut down the server:
shell> BINDIR/mysqladmin -u root shutdown
Verify that you can restart the server. Do this using safe_mysqld or by invoking mysqld directly. For example:
shell> BINDIR/safe_mysqld --log &
If safe_mysqld fails, try running it from the MySQL installation directory (if you are not already there).
Run some simple tests to verify that the server is working. The output should be similar to what is shown below:
shell> BINDIR/mysqlshow
+-----------+
| Databases |
+-----------+
| mysql |
+-----------+
shell> BINDIR/mysqlshow mysql
Database: mysql
+--------------+
| Tables |
+--------------+
| columns_priv |
| db |
| func |
| host |
| tables_priv |
| user |
+--------------+
shell> BINDIR/mysql -e "select host,db,user from db" mysql
+------+--------+------+
| host | db | user |
+------+--------+------+
| % | test | |
| % | test_% | |
+------+--------+------+
There is also a benchmark suite in the sql-bench' directory (under the MySQL installation directory) that you can use to compare how MySQL performs on different platforms. Thesql-bench/Results' directory contains the results from many runs against different databases and platforms. To run all tests, execute these commands:
shell> cd sql-bench
shell> run-all-tests
The expected results are shown in the `./tests/auto_increment.res' file.
Final tasks
Remove general users from database:
shell> BINDIR/mysql
mysql> use mysql
mysql> delete from user where user = '';
Create link to the mysql command in bin directory (so mysql is in path)
shell> cd /usr/local/bin
shell> ln /usr/local/mysql/bin/mysql mysql
Grant execute permission on mysql.server script
shell> cd /usr/local/mysql/share/mysql
shell> chmod u+x mysql.server
Amend user under which mysql will run
Copy the my-medium.cnf file from the /usr/local/mysql/share/mysql diredtory to the /usr/local/mysql/var directory and rename it to my.cnf
Edit this file and under the [mysqld] section add the following line
user = mysql
Set up auto start/stop links
shell> cd /etc/rc.d/init.d
shell> ln -s /usr/local/mysql/share/mysql/mysql.server mysql
shell> cd /etc/rc.d/rc3.d
shell> ln -s /etc/rc.d/init.d/mysql S99mysql
Now stop and start mysql again and check that the user it is running under is mysql rather than root via the ps command.
Now for PHP (a bit simpler than MySQL) :-
Installing PHP4 on a Cobalt RAQ3
Note: Install MySQL first
Copy latest version of source dustribution to /tmp directory (will be named php-version.tar.gz)
Go to the directory where the source has been copied
shell> cd /tmp
Unzip and unpack the kit
shell> gunzip php-version.tar.gz
shell> tar xvf php-version.tar
Go to the new source directory
shell> cd php-version
Configure and build PHP4
shell> ./configure --with-mysql --with-apxs
shell> make
shell> make install
Now rerun slocate
shell> etc/cron.daily/slocate.cron
Find the libphp4.so module and note the directory it is located in
shell> locate libphp4.so
Edit the httpd.conf file and comment in the folowing commands
LoadModule php4_module /path/to/libphp4.so
AddModule mod_php4.c
where /path/to is the directory where libphp4.so is located
Edit srm.conf and comment in the following command
AddType application/x-httpd-php .php3
NOTE: This command may be stated as 'AddType application/x-httpd-php3 .php3' which will not work with PHP4, the x-httpd-php3 must be changed to x-httpd-php
Now restart the webserver
/etc/rc.d/init.d/httpd restart
or reboot as sometimes a simple restart doesn't seem to work.
Test the installation by creating a script called test.php3 with the follwoing command in it:-
<? phpinfo(); ?>
Now copy this script to the root directory of the webserver and invoke it via a browser. You should get a lot of PHP environment information etc. INCLUDING A small section on MySQL. If this is not present then you have not built in MySQL support correctly (ensure MySQL was correctly installed prior to the install of PHP and that you specified --with-mysql in the configuration). If you get no output or you see the <? etc. then you most likely have got an error with some of the AddType, LoadModule commands in the Apache config files.
If you have got lots of PHP info including MySQL info from running the phpinfo script then you have successfully installed PHP. You may need to use PHP.INI to now set up items such as an include location, but this is well documented in the PHP doc at www.php.net and is much simpler than the install itself.
Hope this helps, it has workled for me on two RAQ's so you should be OK.
Regards,
chrber