Friday, May 12, 2006

Install Apache-PHP-MySQL in Linux

Dowload the Source ::

Apache 2.x - http://httpd.apache.org/download.cgi

PHP 5.x - http://us2.php.net/downloads.php

MySQL 4.1.x - http://dev.mysql.com/downloads/mysql/4.1.html#source


Install MySQL


#tar -xzvf mysql-4.1.11.tar.gz

#cd mysql-4.1.11

#./configure –prefix=/usr/local/mysql

#make

#make install


#cp support-files/my-medium.cnf /etc/my.cnf

#/usr/sbin/groupadd mysql

#/usr/sbin/useradd -g mysql mysql

#chown -R root:mysql /usr/local/mysql

#chown -R mysql:mysql /usr/local/mysql/data


#vi /etc/ld.so.conf

add the below line

/usr/local/mysql/lib/mysql

/usr/local/mysql/bin/mysqld_safe ?user=mysql &

#/usr/local/mysql/bin/mysqladmin -u root password new_password



2. Installing Apache 2.x


tar -xzvf httpd-2.0.54.tar.gz

cd httpd-2.0.54

./configure –prefix=/usr/local/apache –enable-mods-shared=all

make

make install



3. Installing PHP 5.x


tar -xzvf php-5.0.4.tar.gz

cd php-5.0.4

./configure –prefix=/usr/local/php –with-apxs2=/usr/local/apache/bin/apxs –with-mysql=/usr/local/mysql

make

make install

#cp php.ini-dist /usr/local/lib/php.ini


#vi /usr/local/apache/conf/httpd.conf

Locate the endtry AddType and enter the following
AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php .php3
AddType application/x-httpd-php .php4
AddType application/x-httpd-php .php5

#/usr/local/apache/bin/apachectl stop
#/usr/local/apache/bin/apachectl start


Finally Testing PHP


#cd /usr/local/apache/htdocs/

vi test.php

< ?

phpinfo();

?>
Check this link http://localhost/test.php in your Browser

No comments: