Second Summer 2009


Installation of MySQL and PHP
You have been given ports. Here they are:

Apache MySQL
 44039 44065 Brumbaugh, Margaret Susan
 44040 44066 Sorosky, Nicholas Tyler
 44041 44067 Turner, Sarah Megan
 44042 44068 Amanbayev, Talgat
 44043 44069 Baker, Jordan Keith
 44044 44070 Castner, Dean A
 44045 44071 Fernandez, Francis Paul
 44046 44072 Jefford, Logan Nance
 44047 44073 Kang, Yoon Mo
 44048 44074 Skaggs, Timothy Lee
 44049 44075 Al-Azdee, Mohammed
 44050 44076 Liu, Hongliu
 44051 44077 Nehrt, Nathan
 44052 44078 Pejaver, Vikas
 44053 44079 Rectanus, Lauren Caitlin
 44054 44080 Wright, Scott N
 44055 44081 Huang, Gang
 44056 44082 Keif, Echo Marie
 44057 44083 Paulraj, Sushmitha
 44058 44084 Sabetti, Leonard
 44059 44085 Sankaranarayanan, Madhuvanthi
 44060 44086 Shah, Neethu
 44061 44087 Sobieralski, Joseph Bernard
 44062 44088 Swaminathan, Rajeswari
 44063 44089 German, Dan-Adrian
 44064 44090 Dan Wick 
Today we install MySQL and PHP and who knows what else we will do.

We will follow

http://www.cs.indiana.edu/~dgerman/eowp06.pdf
Chapters 9, 10, 3...

Move to

cd /nobackup/[username]
Copy the necessary archive there:
cp /l/www/classes/a348/sum2006/software/mysql-5.0.22.tar.gz .
Uncompress and unarchive:
  gunzip mysql-5.0.22.tar.gz 
  tar xvf mysql-5.0.22.tar
Remove archive, move into the folder created:
  rm mysql-5.0.22.tar 
  cd mysql-5.0.22/
Create a file pico step006:
./configure --prefix=/nobackup/dgerman/mysql
make
make install
Make sure you use your username, make file executable, run, wait. When it's over create file pico step007:
/nobackup/dgerman/mysql/bin/mysql_install_db \
  --user=dgerman \
  --datadir=/nobackup/dgerman/mysql
Save, chmod +x it, then execute: it's a configuration step, it takes 3 seconds and prints one screen of output. Create file pico step008:
/nobackup/dgerman/mysql/bin/mysqld_safe \
  --user=dgerman \
  --pid-file=/nobackup/dgerman/mysql/mysqld.pid \
  --log=/nobackup/dgerman/mysql/mysqld.log \
  --socket=/nobackup/dgerman/mysql/mysql.sock \
  --basedir=/nobackup/dgerman/mysql \
  --log-error=/nobackup/dgerman/mysqld-error.log \
  --datadir=/nobackup/dgerman/mysql \
  --port=13038 &
This is to start the server. Make it +x and run it.

Port number:

http://www.cs.indiana.edu/~dgerman/fall2008/students.html
The MySQL ports are in a column with that label.

To check that the server is running:

ps -ef | grep [username]
Stop the server: create a file pico mysql_stop as follows
/nobackup/dgerman/mysql/bin/mysqladmin \
  --socket=/nobackup/dgerman/mysql/mysql.sock \
  --port=13038 -u root -p shutdown
Check with ps -ef | grep [username] that it went away. That's it about MySQL for today. We move on to PHP.

This is Chapter 10.

  cd /nobackup/dgerman
  cp /l/www/classes/a348/sum2006/software/php-5.1.4.tar.gz .
  gunzip php-5.1.4.tar.gz 
  tar xvf php-5.1.4.tar 
Then
  rm php-5.1.4.tar 
  cd php-5.1.4/
Create a file pico try:
./configure \
  --with-mysql=/nobackup/dgerman/mysql \
  --with-apxs2=/u/dgerman/apache/bin/apxs \
  --with-config-file-path=/u/dgerman/apache/conf \
  --with-xml --enable-track-vars \
  --prefix=/u/dgerman/apache
make
make install
Make it executable, run it.

A file php.ini-dist has been created, take it with you:

  cp php.ini-dist ~/apache/conf/php.ini

  cd ~/apache/conf
Now open
pico httpd.conf
and at line 290 or so add this:
    AddType application/x-httpd-php .php .phtml
    AddType application/x-httpd-php-source .phps 
Then exit (and save) stop and start server.

To verify that PHP is working create

pico ~/apache/htdocs/one.php
with the contents:
<? phpinfo(); ?>
Then access this file from a browser:
  http://silo.cs.indiana.edu:11350/one.php
Create a symbolic link to one.php:

  ln -s one.php one.phps
Then see the code posted at:
  http://silo.cs.indiana.edu:11350/one.phps