02/03/09 A348/A548 thus far: Installed a web server (Apache), seen Unix. Apache has certain folders with specific meaning: htdocs - resources (HTML, PHP) cgi-bin - resources (CGI scripts, written in Perl/Python) conf - configuration folder has httpd.conf logs - run time information folder bin - useful utilities folder such as apachectl Programs we wrote need to keep state (client side, hidden fields). Data. The standard procedure to store, organize data: RDBMS. Infrastructure: MySQL server. We will install it today. The benefit is that we will be able to: a) design databases, prove design is sensible (error-free) b) create them c) populate them with data d) query database to obtain information (SQL) We will also install PHP. --- So we start by going in /nobackup/[username] Copy the archive there: cp /l/www/classes/a348/sum2006/software/mysql-5.0.22.tar.gz . Uncompress and unarchive it: gunzip mysql-5.0.22.tar.gz tar xvf mysql-5.0.22.tar Go into the folder we just created: -bash-3.2$ pwd /nobackup/dgerman/mysql-5.0.22 -bash-3.2$ Create step006, make it executable and run it: -bash-3.2$ cat step006 ./configure --prefix=/nobackup/dgerman/mysql make make install -bash-3.2$ Create step007, make it executable, run it: -bash-3.2$ cat step007 /nobackup/dgerman/mysql/bin/mysql_install_db \ --user=dgerman \ --datadir=/nobackup/dgerman/mysql -bash-3.2$ Check to see if you have MySQL running (you shouldn't). -bash-3.2$ ps -ef | grep dgerman Create step008, make it executable and run it to start MySQL: -bash-3.2$ cat 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=47066 & -bash-3.2$ Hit enter twice when you start it: -bash-3.2$ ./step008 -bash-3.2$ Starting mysqld daemon with databases from /nobackup/dgerman/mysql -bash-3.2$ Check to see that you now have the server running: ps -ef | grep dgerman Create mysql_stop: -bash-3.2$ cat mysql_stop /nobackup/dgerman/mysql/bin/mysqladmin \ --socket=/nobackup/dgerman/mysql/mysql.sock \ --port=47066 -u root -p shutdown -bash-3.2$ Save it, make it executable and run it to stop the server. -bash-3.2$ ./mysql_stop Enter password: STOPPING server from pid file /nobackup/dgerman/mysql/mysqld.pid 090203 14:16:13 mysqld ended Your password is empty so just hit Enter when prompted.