Monday, November 3, 2008

Installing Apache http server and PHP5

First get binary distribution:

Apache

URL :
http://httpd.apache.org/download.cgi


Current Version - 2.2.10

PHP

URL :

http://www.php.net/downloads.php


Current Version -5.2.6

1.Installation of Apache web server:

#tar -zxf
httpd-2.2.10.tar.gz (enter)

#cd httpd-2.2.10 (enter)

Follow this command by
typing;



#./configure --prefix=/usr/local/apache2_2
--enable-mods-shared=most (enter)

# make
# make install
# vi /usr/local/apache2/conf/httpd.conf

DirectoryIndex
index.html index.html.var index.php


AddType application/x-httpd-php
.php


Thats it, save the file and
we are done with Apache.


2.PHP5 installation

#tar -zxf
php-5.2.6.tar.gz (enter)

#cd php-5.2.6
 
#./configure --prefix=/usr/local/php5
--with-apxs2=/usr/local/apache2_2/bin/apxs --enable-chmop
#make
#make install
#cp php.ini-recommended
/usr/local/php5/lib/php.ini
#vi /usr/local/php/lib/php.ini
doc_root= "/usr/local/apache2_2/htdocs/"


3.Testing

#/usr/local/apache2_2/bin/apachectl
start

If you get an permission error -
Cannot load /www/libexec/libphp5.so into server: /www/libexec/libphp5.so:

cannot restore segment prot after reloc: Permission denied

run:chcon -t texrel_shlib_t $APACHE_HOME/modules/*.so



No comments: