[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[seul-edu] apache + php + mysql




Here are the instructions for those of you who might find them valuable,
though in a raw form. The major assumption is that you are using a RedHat
system. This doesn't go through configuring virtual hosts and mysql
tables, but it does get things working.

Apache+MySQL+PHP Installation Instructions

1. Remove any Redhat installed rpm's for apache or mod_php or mod_php3.
2. Untar source distributions for the lastest versions of apache, mysql and php in 	/usr/local/src

3.  Install MySQL.  Run the following from the MySQL source directory:

	./configure --prefix=/usr/local/mysql
	make
	make install
        cd /usr/local/mysql
	./bin/mysql_install_db
	./bin/safe_mysqld &
        cp share/mysql/mysql.server /etc/rc.d/init.d
   Arrange for /etc/rc.d/init.d/mysql.server to start at system startup.
   Change the root password for mysql by using mysqladmin in bin.

4. Install PHP.  Run the following from the PHP source directory:

    ./configure --with-mysql=/usr/local/mysql --with-zlib --enable-debug=no \				--enable-safe-mode=yes --with-exec-dir=/usr/bin --enable-track-vars=yes \
	--enable-bcmath=yes --enable-force-cgi-redirect=yes --enable-discard-path=yes \			--enable-memory-limit=yes
   make
   make install
   cp php3.ini-dist /usr/local/lib/php.ini

 Edit /usr/local/lib/php.ini and make any necessary changes (paths, etc.) Turn off "Magic    Quotes"
 Copy /usr/local/bin/php to the cgi-bin directory of the webserver. (/home/httpd/cgi-bin)

5. Install Apache.  Run the following from the Apache source directory:

   ./configure --logfiledir=/var/log/httpd --enable-shared=max --enable-suexec  \  			--suexec-caller=nobody --suexec-docroot=/home/httpd/html                \			--suexec-logfile=/var/log/httpd/suexec_log				
   make
   make install
   cp /usr/local/apache/bin/apachectl /etc/rc.d/init.d/httpd
 
 Arrange for /etc/rc.d/init.d/httpd to start at system startup.
 Edit the apache config files in /usr/local/apache/conf
 Make sure the Document root is set correctly.

 Add the following to the httpd.conf file to enable PHP:

    AddType application/x-httpd-php3 .php3
    Action application/x-httpd-php3 /cgi-bin/php	

 Find the DirectoryIndex line and add 'index.php3' to the list.
 Start the webserver.

--
Michael Hamblin            http://www.utdallas.edu/~michaelh/
michaelh@utdallas.edu      http://www.ductape.net/
UTD Linux User Group       Engineering and Computer Science Support, x2997
                           "We truly dare not waste our youth..." -Green