From Fedora Project Wiki
(add module set-up) |
(add "service restart &testing") |
||
Line 1: | Line 1: | ||
== Introduction == | == Introduction == | ||
This is the procedures for deploying a | This is the procedures for deploying a lighttpd + PHP server on Fedora. This has been done on Fedora 17 which systemd is built in. | ||
== Installation == | == Installation == | ||
<ol><li> | <ol> | ||
Install package "php-cli". | <li> | ||
</li><li> | Install package "php-cli". | ||
Install package "lighttpd". | </li> | ||
</li><li> | <li> | ||
Install package "lighttpd-fastcgi". | Install package "lighttpd". | ||
</li><li> | </li> | ||
You can install it at once with yum: | <li> | ||
Install package "lighttpd-fastcgi". | |||
</li> | |||
<li> | |||
You can install it at once with yum: | |||
<pre> | |||
$ su -c "yum install php-cli lighttpd lighttpd-fastcgi" | $ su -c "yum install php-cli lighttpd lighttpd-fastcgi" | ||
</pre></ol> | </pre> | ||
</li> | |||
</ol> | |||
== Modules Setup == | == Modules Setup == | ||
<ol><li> | <ol> | ||
Gain access as user "root". | <li> | ||
</li><li> | Gain access as user "root". | ||
Open /etc/lighttpd/lighttpd.conf and uncomment the line: | </li> | ||
<li> | |||
Open /etc/lighttpd/lighttpd.conf and uncomment the line: | |||
<pre> | |||
##include "modules.conf" | ##include "modules.conf" | ||
</pre><li> | </pre> | ||
Open /etc/lighttpd/modules.conf and uncomment the line: | </li> | ||
<li> | |||
Open /etc/lighttpd/modules.conf and uncomment the line: | |||
<pre> | |||
#include "conf.d/fastcgi.conf" | #include "conf.d/fastcgi.conf" | ||
</pre><li> | </pre> | ||
Open /etc/lighttpd/conf.d/fastcgi.conf and add the following lines: | </li> | ||
<li> | |||
Open /etc/lighttpd/conf.d/fastcgi.conf and add the following lines: | |||
<pre> | |||
fastcgi.server = ( ".php" => | fastcgi.server = ( ".php" => | ||
( "localhost" => | ( "localhost" => | ||
Line 40: | Line 51: | ||
) | ) | ||
) | ) | ||
</pre></ol> | </pre> | ||
</li> | |||
</ol> | |||
== Service Restart & Testing == | |||
<ol> | |||
<li> | |||
Restart the lighttpd server: | |||
<pre> | |||
$ su -c systemctl restart lighttpd.service | |||
</pre> | |||
</li> | |||
<li> | |||
Create a file "test.php" in default home directory "/var/www/lighttpd/", with the following contents: | |||
<pre> | |||
<?php echo phpinfo(); ?> | |||
</pre> | |||
</li> | |||
<li> | |||
Open the page "http://localhost/test.php" for results. | |||
</li> | |||
</ol> |
Revision as of 16:24, 14 August 2012
Introduction
This is the procedures for deploying a lighttpd + PHP server on Fedora. This has been done on Fedora 17 which systemd is built in.
Installation
- Install package "php-cli".
- Install package "lighttpd".
- Install package "lighttpd-fastcgi".
-
You can install it at once with yum:
$ su -c "yum install php-cli lighttpd lighttpd-fastcgi"
Modules Setup
- Gain access as user "root".
-
Open /etc/lighttpd/lighttpd.conf and uncomment the line:
##include "modules.conf"
-
Open /etc/lighttpd/modules.conf and uncomment the line:
#include "conf.d/fastcgi.conf"
-
Open /etc/lighttpd/conf.d/fastcgi.conf and add the following lines:
fastcgi.server = ( ".php" => ( "localhost" => ( "socket" => "/var/run/lighttpd/php-fastcgi.socket", "bin-path" => "/usr/bin/php-cgi" ) ) )
Service Restart & Testing
-
Restart the lighttpd server:
$ su -c systemctl restart lighttpd.service
-
Create a file "test.php" in default home directory "/var/www/lighttpd/", with the following contents:
<?php echo phpinfo(); ?>
- Open the page "http://localhost/test.php" for results.