Installing Lighttpd; PHP5 and MySQL on your Debian Etch

Today’s tutorial is going to explain how to install Lighttpd; PHP5 and MySQL on your FlexServ (RPS) on Debian Etch 4.0.

This is an easy tutorial, and definetly a good place to start.

1. Update the repositories and your system

apt-get update
apt-get dist-upgrade

2. Install lighttpd

apt-get install lighttpd

3. Install PHP5-CGI

apt-get install php5-cgi

4. Configure lighttpd to use PHP5-CGI

Modify the php.ini:

vi /etc/php5/cgi/php.ini

Add the following line to it at the end:

cgi.fix_pathinfo = 1

Now you need to edit the lighttpd.conf

vi /etc/lighttpd/lighttpd.conf

Add the following at the top (in the list):

“mod_fastcgi”,

Then this at the bottom:

fastcgi.server = ( “.php” => ((
“bin-path” => “/usr/bin/php5-cgi”,
“socket” => “/tmp/php.socket”
)))

5. Install and configure MySQL

Title says it all:

apt-get install mysql-server mysql-client php5-mysql

Then you should also set a password for the MySQL User root:

mysqladmin -u root password yourrootsqlpassword

6. Restart your lighttpd to apply the changes

/etc/init.d/lighttpd restart

7. Test it

Ok, the last step is to test it. For that create a new .php file:

vi /var/www/info.php

Add the following text to it:

<?
php phpinfo();
?>

Then check the result by accessing the page in your Webbrowser: http://fs00000.flosoft-servers.net/info.php

If that works, you can enjoy your new Webserver!

One Comment, RSS

  1. yke 10. February, 2008 @ 2:43 pm

    i had to change the last step:

    only worked in that way:

Your email address will not be published. Required fields are marked *

*