banner Debian GNU/Linux

A Dynamic Apache Web server configuration

LAMP : Linux, Apache, Mysql, PHP


This is part of a write-up of an attempt to use Linux as a "Small Business Server", and describes how to add support for php and mysql to this basic Apache configuration.

set up Apache

We will build on the configuration described here.

set up mysql

We will build on the configuration described here.

adding the glue : setup php5

make sure that you have a working configuration of apache and mysql and that you don't have left-over configuration changes that you want to implement. If so, take care of that before you proceed.

check for available php5 packages : apt-cache policy php5


	#install php with apache module
	apt-get install libapache2-mod-php5.
	apt-get install php5

	#install php mysql module
	apt-get install php5-mysql

	#  optional : install php-based mysql admin
	#	and create a symbolic link so that it appears in web root
	apt-get install phpMyAdmin
	ln -s /var/www/phpmyadmin /srv/http/phpmyadmin
	

php test

to see if php is working and can be used by apache, create a file test.php in /srv/http/. Its contents should just be

	<?php
		phpinfo();
	?>
	

create a hyperlink in index.html so you can call test.php from a browser. If all is well, it will report your php configuration, which shows that php is working, otherwise it wouldn't be able to generate this output in the browser.

more

Debian LAMP (Linux, Apache, MySQL, PHP)


Koen Noens
June 2006