Install Lighttpd in Ubuntu9.10 to support PHP and MySQL. Lighttpd is a reliable, fast, and standard-compliant web server. This tutorial teaches you how to install Lighttpd in Ubuntu and supports PHP5 (FastCGI) and MySQL. First, make sure you log on to the system with the root account. All the following steps are performed by the root user. 1. To install MySQL, first install mysql5: Aptitude.
Install Lighttpd in Ubuntu 9.10 to support PHP and MySQL. Lighttpd is a reliable, fast, and standard-compliant web server. This tutorial teaches you how to install Lighttpd in Ubuntu and supports PHP5 (FastCGI) and MySQL.
First, make sure you log on to the system with the root account. All the following steps are performed by the root user.
1. Install MySQL
First, install mysql5 as follows:
Aptitude install mysql-server mysql-client
You need to set a password for the mysql root User.
2. Install Lighttpd
Lighttpd is a Ubuntu package, so we can install it like this:
Aptitude install lighttpd
Enter your local IP address in the browser to view the Lighttpd page.
In ubuntu, the root directory of the Lighttpd file is/var/www by default, and the configuration file is in/etc/lighttpd. conf. The additional configuration file is stored in the/etc/lighttpd/conf-available Directory. You can enable it with lighttpd-enable-mod or use lighttpd-disable-mod to disable it.
3. Install php5
We make php5 work in Lighttpd through FastCGI. Ubuntu provides the following package:
Aptitude install php5-cgi
4. Configure Lighttpd and php5
To enable php5 in Lighttpd, you must add a line under the/etc/php5/cgi/php. ini configuration file:
Cgi. fix_pathinfo = 1
To enable fastcgi (stored in/etc/lighttpd/conf-available/10-fastcgi.conf), run the following command:
Lighttpd-enable-mod fastcgi
Then create a link/etc/lighttpd/conf-enables/10-fastcgi.conf pointing to/etc/lighttpd/conf-available/10-fastcgi.conf
Reload Lighttpd:
/Etc/init. d/lighttpd force-reload