Monday 17 January 2011

Configuring Apache/PHP

./configure --prefix=/usr/local/apache --enable-so
make
make install
vi /usr/local/apache/conf/httpd.conf
Add the places from the webpages - usually this will not actually be in the same place as you are running apache and it is most commonly /var/www/html

/usr/local/apache/bin/apachectl -k start

Upgrading

copy the config.nice file from the working version of the server to the new version directory. Use a new prefix and a different port to test the configuration - change the Listen directive to specify the new port.
./config.nice
make
make install
usr/local/apache/bin/apachectl -k graceful-stop
usr/local/apache/bin/apachectl -k start

add a call to apachectl to the rc.local file so that it autostarts.

PHP

./configure --prefix=/usr/local/php \
--with-apxs2=/usr/local/apache/bin/apxs \
--with-config-file-path=/usr/local/php \
--with-gd \
--with-mysql=/usr/local/mysql/ \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-pgsql=/usr/local/pgsql

make
/usr/local/apache/bin/apachectl stop
make install

Edit httpd.conf to add
LoadModule php5_module modules/libphp5.so
AddType application/x-httpd-php .php
<Files *.php>
SetOutputFilter PHP
SetInputFilter PHP
</Files>



Edit php.ini for pgsql and mysql lines removes the ; but not on the dll lines.

No comments:

Post a Comment