LAMP Server: Step by Step NOTES: 1. Whenever the notation .../dirname is used, the ... refers to your source directory, which is /usr/local/src by our default. You can use anything you want instead, just make sure that ... is always replaced by the true absolute path to your source directory. Install RedHat 8.0 base server configuration with: lynx default development packages After install Change character encoding: # nano /etc/sysconfig/i18n LANG=”en_US.UTF-8” ===> LANG=”en_US” > Note: Must reboot for these changes to take effect Setup virtual interfaces: # cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0:x Change IP address in new file > Note: Must reboot for these changes to take effect Download Nano from http://www.nano-editor.org/ # rpm -i nano-1.2.0-1.i386.rpm Set Up Source Tree: # mkdir /usr/local/src Open SSL # cd .../openssl-0.9.7a # ./config no-threads -fPIC # make # make test MM # cd .../mm-1.1.x # ./configure --disable-shared # make Mod SSL # cd .../mod_ssl-2.8.12-1.3.27 # ./configure --with-apache=.../apache-1.3.27 CPAN # perl -MCPAN -e shell > NOTE: answer the configuration questions as best you can or pick auto config # install Bundle::CPAN # reload CPAN # exit Mod Perl # cd .../mod_perl-1.27 # perl Makefile.PL \ USE_APACI=1 \ EVERYTHING=1 \ DO_HTTPD=1 \ SSL_BASE=.../openssl-0.9.7a \ EAPI_MM=.../mm-1.2.2 \ APACHE_PREFIX=/usr/local/apache \ APACHE_SRC=.../apache_1.3.27/src \ APACI_ARGS='--enable-module=ssl,--enable-module=rewrite,--enable-module=speling,--enable-module=so,--disable-module=userdir' > NOTE: if any error messages pop up, go back into CPAN and install the appropriate modules # make # make test # make install Apache # cd .../apache_1.3.27 # make certificate > NOTE: when prompted for pass phrase, do not supply # make install > NOTE: for some reason test certificates must be copied manually # cp conf/ssl.crt/server.crt /usr/local/apache/conf/ssl.crt # cp conf/ssl.csr/server.csr /usr/local/apache/conf/ssl.csr # cp conf/ssl.crt/server.key /usr/local/apache/conf/ssl.key CONGRATULATIONS! You now have a functioning Apache / mod_SSL / mod_perl server! Now on the databases! Download mysql 3.23.55 http://www.mysql.com postgresql 7.3.2 http://www.postgresql.org MySQL # /usr/sbin/groupadd mysql # /usr/sbin/useradd -g mysql mysql # tar -xzf mysql-3.23.55-pc-linux-i686.tar.gz # mv mysql-3.23.55-pc-linux-i686 .../ # cd .../ # ln -s mysql-3.23.55-pc-linux-i686 mysql # cd mysql # scripts/mysql_install_db # chown -R root . # chown -R mysql data # chgrp -R mysql . > NOTE: move the data to the new location and clear out old tables # cp -Rp data /home/mysql # rm -fr data/test # rm -f data/mysql/* > NOTE: now we copy a script and set up mysql to autostart on boot # cp support-files/mysql.server /etc/rc.d/init.d/mysql # nano /etc/rc.d/init.d/mysql datadir=/home/mysql/data # /sbin/chkconfig --add mysql # /sbin/chkconfig mysql on > NOTE: Setup MySQL config file # cp support-files/my-medium.cnf /etc/my.cnf # nano /etc/my.cnf [mysqld] datadir=/home/mysql/data ... [safe_mysqld] ledir=/usr/local/mysql/bin > NOTE: start MySQL # /etc/rc.d/init.d/mysql start > NOTE: set MySQL password # bin/mysqladmin -u root password new-password PostgreSQL # /usr/sbin/groupadd postgres # /usr/sbin/useradd -g postgres postgres # mkdir /home/postgres/data # chown postgres /home/postgres/data # tar -xzf postgresql-7.2.3.tar.gz # cd postgresql-7.2.3 # ./configure --prefix=/usr/local/pgsql --datadir=/home/postgres # make # make install # su postgres # /usr/local/pgsql/bin/initdb -L /home/postgres -D /home/postgres/data # exit > NOTE: now we copy a script and set up postgresql to autostart on boot # cp contrib/start-scripts/linux /etc/rc.d/init.d/postgresql # chmod 755 /etc/rc.d/init.d/postgresql > NOTE: alter script file to start postgresql with TCP/IP sockets open # nano /etc/rc.d/init.d/postgresql PGDATA="/home/postgres/data" >change su - $PGUSER -c "$DAEMON start -D '$PGDATA' -s -l $PGLOG" >to su - $PGUSER -c "$DAEMON start -D '$PGDATA' -s -l $PGLOG -o '-i'" >change su - $PGUSER -c "$DAEMON restart -D '$PGDATA' -s -m fast" >to su - $PGUSER -c "$DAEMON restart -D '$PGDATA' -s -m fast -o '-i'" # /sbin/chkconfig --add postgresql # /sbin/chkconfig postgresql on > NOTE: start postgresql # /etc/rc.d/init.d/postgresql start CONGRATULATIONS! MySQL and PostgreSQL are now installed and running! Now onto some other web application platforms! CF # gunzip allaire_coldfusion_server_v4.5_professional_edition_for_linux.zip.gz # unzip allaire_coldfusion_server_v4.5_professional_edition_for_linux # cd coldfusion-451-linux-pro # ./cfinstall ? ColdFusion registration ID: CF45PLX-5112010024 ? ColdFusion installation directory: /usr/local ? Web server running: Apache ? Automatically configure Apache: yes ? Apache installation directory: /usr/local/apache ? Web server document root: /usr/local/apache/htdocs ? ColdFusion documentation installed: no ? CFAdmin password: graistuff385 ? CFRDS password: greistuff385 ? ColdFusion server runs as: nobody > NOTE: after installation an error will occur; to fix # nano /usr/local/apache/conf/httpd.conf LoadModule coldfusion_module /usr/local/coldfusion/webserver/apache/src/mod_coldfusion.so # /usr/local/apache/bin/apachectl graceful Download zlib 1.1.4 http://www.gzip.org/zlib/ libpng 1.2.5 http://www.libpng.org/pub/png/libpng.html libjpeg 6b http://www.ijg.org/files php 4.3.1 http://www.php.net ZLib # tar -xzf zlib-1.1.4.tar.gz # cd zlib-1.1.4 # ./configure # make test # make install LibPNG # tar -xzf libpng-1.2.5.tar.gz # cd libpng-1.2.5 # cp scripts/makefile.linux makefile # make test # make install LibJPEG # tar -xzf jpegsrc.v6b.tar.gz # cd jpegsrc-6b # mkdir /usr/local/man/man1 # ./configure --enable-shared --enable-static # make # make test # make install PHP # ./configure \ --with-mysql=/usr/local/mysql \ --with-pgsql=/usr/local/pgsql \ --with-gd \ --with-jpeg-dir=/usr/local \ --with-png-dir=/usr/local \ --with-zlib-dir=/usr/local \ --with-xml \ --enable-track-vars \ --enable-exif \ --enable-ftp \ --enable-wddx \ --with-apxs=/usr/local/apache/bin/apxs # make # make install # nano /usr/local/apache/conf/httpd.conf LoadModule php4_module libexec/libphp4.so AddType application/x-httpd-php .php .php3 AddType application/x-httpd-php-source .phps Other Notes: > Edit the DirectoryIndex directive of Apache to choose a priority for .html, .php, .cfm etc.