VMware Images:
|
Installing Lighttpd With PHP5 (PHP-FPM) And MySQL Support On Ubuntu 12.10
|
Submitted by falko (Contact Author) (Forums) on Thu, 2012-11-08 18:39. :: Ubuntu | Web Server | Lighttpd
Installing Lighttpd With PHP5 (PHP-FPM) And MySQL Support On Ubuntu 12.10Version 1.0 Lighttpd is a secure, fast, standards-compliant web server designed for speed-critical environments. This tutorial shows how you can install Lighttpd on an Ubuntu 12.10 server with PHP5 support (through PHP-FPM) and MySQL support. PHP-FPM (FastCGI Process Manager) is an alternative PHP FastCGI implementation with some additional features useful for sites of any size, especially busier sites. I use PHP-FPM in this tutorial instead of Lighttpd's spawn-fcgi. I do not issue any guarantee that this will work for you!
1 Preliminary NoteIn this tutorial I use the hostname server1.example.com with the IP address 192.168.0.100. These settings might differ for you, so you have to replace them where appropriate. I'm running all the steps in this tutorial with root privileges, so make sure you're logged in as root: sudo su
2 Installing MySQL 5First we install MySQL 5 like this: apt-get install mysql-server mysql-client You will be asked to provide a password for the MySQL root user - this password is valid for the user root@localhost as well as root@server1.example.com, so we don't have to specify a MySQL root password manually later on: New password for the MySQL "root" user: <-- yourrootsqlpassword
3 Installing LighttpdLighttpd is available as an Ubuntu package, therefore we can install it like this: apt-get install lighttpd Now direct your browser to http://192.168.0.100/index.lighttpd.html, and you should see the Lighttpd placeholder page: Lighttpd's default document root is /var/www on Ubuntu, and the configuration file is /etc/lighttpd/lighttpd.conf. Additional configurations are stored in files in the /etc/lighttpd/conf-available directory - these configurations can be enabled with the lighttpd-enable-mod command which creates a symlink from the /etc/lighttpd/conf-enabled directory to the appropriate configuration file in /etc/lighttpd/conf-available. You can disable configurations with the lighttpd-disable-mod command.
4 Installing PHP5We can make PHP5 work in Lighttpd through PHP-FPM which we install like this: apt-get install php5-fpm php5 PHP-FPM is a daemon process (with the init script /etc/init.d/php5-fpm) that runs a FastCGI server on the socket /var/run/php5-fpm.sock.
5 Configuring Lighttpd And PHP5To enable PHP5 in Lighttpd, we must modify /etc/php5/fpm/php.ini and uncomment the line cgi.fix_pathinfo=1: vi /etc/php5/fpm/php.ini
The Lighttpd configuration file for PHP /etc/lighttpd/conf-available/15-fastcgi-php.conf is suitable for use with spawn-fcgi, however, we want to use PHP-FPM, therefore we create a backup of the file (named 15-fastcgi-php-spawnfcgi.conf) and modify 15-fastcgi-php.conf as follows: cd /etc/lighttpd/conf-available/
To enable the fastcgi configuration, run the following commands: lighttpd-enable-mod fastcgi This creates the symlinks /etc/lighttpd/conf-enabled/10-fastcgi.conf which points to /etc/lighttpd/conf-available/10-fastcgi.conf and /etc/lighttpd/conf-enabled/15-fastcgi-php.conf which points to /etc/lighttpd/conf-available/15-fastcgi-php.conf: ls -l /etc/lighttpd/conf-enabled root@server1:/etc/lighttpd/conf-available# ls -l /etc/lighttpd/conf-enabled Then we reload Lighttpd: /etc/init.d/lighttpd force-reload
|





Recent comments
9 hours 29 min ago
18 hours 56 min ago
19 hours 46 min ago
23 hours 19 min ago
1 day 3 hours ago
1 day 4 hours ago
1 day 6 hours ago
1 day 16 hours ago
1 day 21 hours ago
1 day 22 hours ago