Steps to Build a SLAMPS Server - Slackware Linux, Apache, MySQL, PHP, SSL

Here is what we are using:

Build MySQL

  1. cd /downloads
  2. create a mysql user and mysql group if they don't already exist:
  3. mkdir /var/run/mysql
  4. chown -R mysql.mysql /var/run/mysql
  5. wget latest source from http://www.mysql.com
  6. tar zxvf mysql-5.0.24.tar.gz
  7. cd mysql-5.0.24
  8. ./configure --prefix=/usr/local/mysql --localstatedir=/home/mysql --enable-assembler --enable-thread-safe-client --with-unix-socket-path=/var/run/mysql/mysql.pid --with-mysqld-user=mysql --with-extra-charsets=none --with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static --without-debug --without-bench --without-docs
  9. make
  10. make install
  11. echo "/usr/local/mysql/lib/mysql" >> /etc/ld.so.conf
  12. ldconfig
  13. cp /usr/local/mysql/share/mysql/my-medium.cnf /etc/my.cnf
  14. cd /usr/local/mysql
  15. bin/mysql_install_db --user=mysql
  16. cd /usr/local
  17. chown -R root.mysql mysql
  18. cd /home
  19. chown -R mysql mysql
  20. /usr/local/mysql/bin/mysqld_safe &
  21. Now we will set the root password for localhost and host_name and delete the anonymous accounts for localhost and host_name
  22. cp /usr/local/mysql/share/mysql/mysql.server /etc/rc.d/rc.mysqld


Configure Apache

  1. cd /downloads
  2. wget latest source from http://httpd.apache.org
  3. tar zxvf apache_1.3.37.tar.gz
  4. cd apache_1.3.37
  5. ./configure --prefix=/usr/local/apache


Configure mod_ssl

  1. cd /downloads
  2. wget source that matches Apache version from http://www.modssl.org
  3. tar zxvf mod_ssl-2.8.28-1.3.37.tar.gz
  4. cd mod_ssl-2.8.28-1.3.37
  5. ./configure --with-apache=../apache_1.3.37 --with-ssl --prefix=/usr/local/apache --enable-module-so


Build PHP

  1. cd /downloads
  2. wget latest source from http://www.php.net
  3. tar zxvf php-5.1.4.tar.gz
  4. cd php-5.1.4
  5. ./configure --prefix=/usr/local --with-config-file-path=/etc --with-apache=../apache_1.3.37 --with-mysql=/usr/local/mysql --with-mysql-sock=/var/run/mysql/mysql.sock --with-mysqli=/usr/local/mysql/bin/mysql_config --with-openssl --enable-ftp --disable-debug --enable-memory-limit --enable-inline-optimization --enable-magic-quotes --enable-mbstring --enable-track-vars --enable-xml --with-dom --with-xml --enable-sockets --with-zlib --with-gettext --with-pear --with-apsell
  6. make
  7. make install
  8. cp php.ini-recommended /etc/php.ini
  9. edit /etc/php.ini and do the following:


Build Apache

  1. cd /downloads/apache_1.3.37
  2. Create apache user and group if they don't already exist:
  3. SSL_BASE=SYSTEM ./configure --prefix=/usr/local/apache --with-layout=GNU --activate-module=src/modules/php5/libphp5.a --enable-module=ssl --disable-rule=SSL_COMPAT --enable-rule=SSL_SDBM --disable-module=status --disable-module=imap --server-uid=apache --server-gid=apache
  4. make
  5. make certificate TYPE=test
  6. make install
  7. edit /usr/local/apache/etc/httpd.conf do the following for PHP support:
  8. echo "/usr/local/apache/sbin/apachectl start" >> /etc/rc.d/rc.local
  9. /usr/local/apache/sbin/apachectl start
  10. The above starts Apache in normal mode. To start in SSL mode, do 'startssl' instead of 'start'.
  11. go to http://your_server and https://your_server to make sure Apache is working on both ports 80 and 443
  12. echo "<? phpinfo(); ?>" > /usr/local/apache/share/htdocs/test.php
  13. go to http://your_server/test.php and see if your PHP is working


Copyright © 2006, Adam Cantwell