OscarS
04-25-2011, 07:05 PM
Hi everybody this is my first tutorial I'm not an expert but hope this will be helpful for someone.
This tutorial was tested on a Xen VPS 512RAM with CentOS 5.6 64bits
Well less chat and more guide.
First we need to add working repositores.
Add repo if you are 32bits
rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
Add repo if you are 64bits
rpm -Uhv http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
Install lighttpd
yum install lighttpd
Once lighttpd is installed you will need complements for php (we will use PHP5)
Install PHP
yum install lighttpd-fastcgi php-cli
Now we gonna set up our lighttpd configuration
Change settings of lighttpd
nano /etc/lighttpd/lighttpd.conf
This gonna open the file configuration of lighttpd we gonna disable IPv6 if we are using IPv4 (if not skip this)
Search "server.use-ipv6 = “enable”" and change for "disable"
server.use-ipv6 = "disable"
Now we gonna open the modules configuration file
Change settings of modules
nano /etc/lighttpd/modules.conf
Search
server.modules = (
“mod_access”,
# “mod_alias”,
# “mod_auth”,
# “mod_evasive”,
# “mod_redirect”,
# “mod_rewrite”,
# “mod_setenv”,
# “mod_usertrack”,
)
and change for
server.modules = (
"mod_access",
"mod_alias",
"mod_auth",
"mod_evasive",
"mod_redirect",
"mod_rewrite",
"mod_setenv",
"mod_usertrack",
)
Note: in this step we change # in modules to active it.
now scroll down and Search
##
## FastCGI (mod_fastcgi)
##
#include “conf.d/fastcgi.conf”
and change for
##
## FastCGI (mod_fastcgi)
##
include "conf.d/fastcgi.conf"
fastcgi.server = ( ".php" =>
( "localhost" =>
(
"socket" => "/tmp/php-fastcgi.socket",
"bin-path" => "/usr/bin/php-cgi"
)
)
)
Now everything its ok, I recommend to you to put an index.html in var/www/lighttpd because by default lighttpd give you an 404 error (chrome show me this like broken link that was my first fail)
This tutorial is mine translate from spanish to english.
This tutorial was tested on a Xen VPS 512RAM with CentOS 5.6 64bits
Well less chat and more guide.
First we need to add working repositores.
Add repo if you are 32bits
rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
Add repo if you are 64bits
rpm -Uhv http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
Install lighttpd
yum install lighttpd
Once lighttpd is installed you will need complements for php (we will use PHP5)
Install PHP
yum install lighttpd-fastcgi php-cli
Now we gonna set up our lighttpd configuration
Change settings of lighttpd
nano /etc/lighttpd/lighttpd.conf
This gonna open the file configuration of lighttpd we gonna disable IPv6 if we are using IPv4 (if not skip this)
Search "server.use-ipv6 = “enable”" and change for "disable"
server.use-ipv6 = "disable"
Now we gonna open the modules configuration file
Change settings of modules
nano /etc/lighttpd/modules.conf
Search
server.modules = (
“mod_access”,
# “mod_alias”,
# “mod_auth”,
# “mod_evasive”,
# “mod_redirect”,
# “mod_rewrite”,
# “mod_setenv”,
# “mod_usertrack”,
)
and change for
server.modules = (
"mod_access",
"mod_alias",
"mod_auth",
"mod_evasive",
"mod_redirect",
"mod_rewrite",
"mod_setenv",
"mod_usertrack",
)
Note: in this step we change # in modules to active it.
now scroll down and Search
##
## FastCGI (mod_fastcgi)
##
#include “conf.d/fastcgi.conf”
and change for
##
## FastCGI (mod_fastcgi)
##
include "conf.d/fastcgi.conf"
fastcgi.server = ( ".php" =>
( "localhost" =>
(
"socket" => "/tmp/php-fastcgi.socket",
"bin-path" => "/usr/bin/php-cgi"
)
)
)
Now everything its ok, I recommend to you to put an index.html in var/www/lighttpd because by default lighttpd give you an 404 error (chrome show me this like broken link that was my first fail)
This tutorial is mine translate from spanish to english.
