PROMO SELL

Tuesday, March 08, 2005

Apache/PHP/MySQL Installation

Title: Apache/PHP/MySQL Installation
Contributor: yudhax (aka Ranman)
Last Update: Mart 08 22:24 EST 2005

# Move to /usr/local
cd /usr/local

# Get the following source:

http://www.ibiblio.org/pub/mirrors/apache/httpd/httpd-2.0.48.tar.gz
http://www.linuxguruz.org/downloads/php-4.3.4.tar.gz
http://mysql.secsup.org/Downloads/MySQL-3.23/mysql-3.23.55.tar.gz

# Decompress the sources:
tar -xvzf httpd-2.0.48.tar.gz
tar -xvzf php-4.3.4.tar.gz
tar -xvzf mysql-4.0.17.tar.gz

cd ../mysql-4.0.17
./configure
make
make install
scripts/mysql_install_db

adduser mysql
# In the file /etc/login.access add this line:
-:mysql:ALL
# So the user mysql never actualy logs in

# For Slackware:
chown -R mysql.users /usr/local/var
# For Redhat:
chown -R mysql.mysql /usr/local/var

mysqld_safe --user=mysql &
# Hit
mysqladmin -u root password 'yourpasswordhere'

cd ../httpd-2.0.48
./configure --prefix=/usr/local/apache --enable-module=all --enable-so
make

# Note: There is a Redhat bug that complains about mod_auth_dbm.so
# during the Apache `make` proccess. Adding the configuration
# switch --disable-module=auth_dbm to the end of the ./configure line
# will fix it.

# If you presently have a libphp4.so module you should make a backup:
cp /usr/local/apache/libexec/libphp4.so /usr/local/apache/libexec/libphp4.so.was

# If you have a file called /usr/local/apache/conf/httpd.conf already, you
# should make a backup:
mv /usr/local/apache/conf/httpd.conf /usr/local/apache/conf/httpd.conf.was

# This way you'll get a fresh httpd.conf with all your Apache modules listed
# and 100% loadable.

# Don't worry if your web server is presently running. The httpd.conf file
# is only read by the httpd binary when starting the web server.

make install

cd ../php-4.3.4
./configure --with-apxs2=/usr/local/apache/bin/apxs --with-config-file-path=/usr/local/apache/conf --enable-versioning --with-mysql=/usr/local --enable-ftp --with-gd --enable-bcmath --disable-debug --enable-memory-limit=yes --enable-track-vars
make
make install

# Make sure you have, Uncomment (remove the #'s), Change or Create
# the following lines in the file /usr/local/apache/conf/httpd.conf

LoadModule php4_module libexec/libphp4.so


DirectoryIndex index.html index.php index.php3 index.phtml

# And for PHP 4.x, use:
#
AddType application/x-httpd-php .php .php3 .phtml
AddType application/x-httpd-php-source .phps

cp /usr/local/php-4.3.4/php.ini-dist /usr/local/apache/conf/php.ini

# Start Apache:
/usr/local/apache/bin/apachectl start

# Create a file in /usr/local/apache/htdocs called index.php
head--title-PHP Test Page-/title--/head
body
? phpinfo(); ?
/body
/html

# Point your Web Browser at:
http://localhost/index.php

Anyone who wishes to make additions or changes to this
PHP Tutorial email them to webmaster@linuxguruz.org

Copyright (c) 1999, 2000, 2001, 2002, 2003 and 2004 by LinuxGuru

No comments: