Installing Lighttpd With PHP5 (PHP-FPM) And MySQL Support On OpenSUSE 12.2
|
Submitted by falko (Contact Author) (Forums) on Sun, 2012-09-30 17:55. :: SuSE | Web Server | Lighttpd
Installing Lighttpd With PHP5 (PHP-FPM) And MySQL Support On OpenSUSE 12.2Version 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 OpenSUSE 12.2 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.
2 Installing MySQL 5First we install MySQL 5 like this: zypper install mysql-community-server mysql-community-server-client Then we create the system startup links for MySQL (so that MySQL starts automatically whenever the system boots) and start the MySQL server: systemctl enable mysql.service To secure the MySQL installation, run: mysql_secure_installation Now you will be asked several questions: server1:~ # mysql_secure_installation Now your MySQL setup should be secured.
3 Installing LighttpdLighttpd is available as an OpenSUSE package, therefore we can install it like this: zypper install lighttpd Then we create the system startup links for Lighttpd (so that Lighttpd starts automatically whenever the system boots) and start it: systemctl enable lighttpd.service Now direct your browser to http://192.168.0.100, and you should see that Lighttpd delivers a page (well, it's a 404 page because there's no index file in Lighttpd's document root, but at least this means that Lighttpd is working ok): Lighttpd's default document root is /srv/www/htdocs on OpenSUSE, and the configuration file is /etc/lighttpd/lighttpd.conf.
4 Installing PHP5We can make PHP5 work in Lighttpd through PHP-FPM which we install like this: zypper install php5-fpm Before we start PHP-FPM, rename /etc/php5/fpm/php-fpm.conf.default to /etc/php5/fpm/php-fpm.conf: mv /etc/php5/fpm/php-fpm.conf.default /etc/php5/fpm/php-fpm.conf Change the permissions of PHP's session directory: chmod 1733 /var/lib/php5 Then open /etc/php5/fpm/php-fpm.conf... vi /etc/php5/fpm/php-fpm.conf ... and change error_log to /var/log/php-fpm.log:
There's no php.ini file for PHP-FPM under OpenSUSE 12.2, therefore we copy the CLI php.ini: cp /etc/php5/cli/php.ini /etc/php5/fpm/ Next open /etc/php5/fpm/php.ini... vi /etc/php5/fpm/php.ini ... and set cgi.fix_pathinfo to1:
Next create the system startup links for php-fpm and start it: systemctl enable php-fpm.service
|





Recent comments
7 hours 41 min ago
17 hours 9 min ago
17 hours 59 min ago
21 hours 32 min ago
1 day 1 hour ago
1 day 2 hours ago
1 day 4 hours ago
1 day 14 hours ago
1 day 19 hours ago
1 day 20 hours ago