Results 1 to 13 of 13
  1. #1
    Join Date
    Jul 2010
    Location
    Mexico
    Posts
    104

    Install lighttpd+PHP5 on CentOS

    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

    Code:
    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

    Code:
    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

    Code:
    yum install lighttpd
    Once lighttpd is installed you will need complements for php (we will use PHP5)

    Install PHP

    Code:
    yum install lighttpd-fastcgi php-cli
    Now we gonna set up our lighttpd configuration

    Change settings of lighttpd

    Code:
    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"

    Code:
    server.use-ipv6 = "disable"
    Now we gonna open the modules configuration file

    Change settings of modules

    Code:
    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

    Code:
    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

    Code:
    ##
    ## FastCGI (mod_fastcgi)
    ##
    #include “conf.d/fastcgi.conf”
    and change for

    Code:
    ##
    ## 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.

  2. #2
    Join Date
    May 2011
    Location
    Geneva, Switzerland
    Posts
    18
    Thanks for sharing. You may also want to add some php modules like mysql, curl, etc ...

  3. #3
    Join Date
    Jul 2010
    Location
    Manchester
    Posts
    125
    Great tutorial.

    For some reason I had to put my index.html file in /srv/www/lighttpd

    But apart from that, worked on a CentOS 5 32bit VPS!

    Regards,
    Daniel
    zFast Technologies - Affordable Web Hosting
    █ Shared, Reseller, VPS, SHOUTcast & Domain Registration!
    █ Quality web hosting since 2009 - www.zfast.co.uk

  4. #4
    That is a great tutorial I have copied all

  5. #5
    Join Date
    Jan 2011
    Posts
    453
    Hello,

    Thanks for sharing the tutorial. It is really appreciable if members share such tutorials.

    I will surely try it in my test server.
    " Your work is to discover your work and then with all your heart to give yourself to it. "

    That's the mark of a true professional !

  6. #6
    Join Date
    Jul 2010
    Location
    Mexico
    Posts
    104
    Quote Originally Posted by zFastDan View Post
    Great tutorial.

    For some reason I had to put my index.html file in /srv/www/lighttpd

    But apart from that, worked on a CentOS 5 32bit VPS!

    Regards,
    Daniel
    Ya I know, was my bad, since we can't edit our old threads...

  7. #7
    Join Date
    Feb 2011
    Location
    EU
    Posts
    97
    This script includes mysql?

  8. #8
    Join Date
    Jul 2010
    Location
    Mexico
    Posts
    104
    Quote Originally Posted by darwin7 View Post
    This script includes mysql?
    No, this doesnt include MYSQL you need to install as a single software.

  9. #9
    thanks i will try it

  10. #10
    Join Date
    Sep 2011
    Posts
    14
    thanks for you
    will surely try it in my test server.

  11. #11
    Join Date
    Jun 2010
    Location
    Indonesia
    Posts
    473
    Is there any tutorial if I have the following case?

    IPv6 Enabled VPS with /64 subnet.
    More than 1 Domain name to be hosted in the VPS, for example :

    I want to server each domain name with each IPv6 address I have.

    www.domaina.com = 2a02:2658:1011:1::2:1
    Location = /var/www/www.domaina.com/html
    www.domainb.com = 2a02:2658:1011:1::2:2
    Location = /var/www/www.domainb.com
    www.anotherdomainofmine.com = 2a02:2658:1011:1::2:3
    Location = www.anotherdomainofmine.com
    www.forumwebsite.com = 2a02:2658:1011:1::2:4
    Location = www.forumwebsite.com
    How would the lighttpd.conf would be like?

    Regards,

    Erawan Arif Nugroho

  12. #12
    Join Date
    Aug 2010
    Location
    Egypt/Cairo
    Posts
    472
    that's great .

    I'm using kloxo , it have the option to switch from Apache to lighthttpd
    however I like Apache because of the rewrite module
    Web Developer

  13. #13
    Join Date
    Feb 2012
    Posts
    36
    Thanks for sharing .. This tutorial works

Similar Threads

  1. Replies: 5
    Last Post: 09-06-2008, 02:24 AM
  2. How to install Lighttpd in CentOS 5.2 ?
    By mrhungpham in forum Hosting Security and Technology
    Replies: 7
    Last Post: 09-01-2008, 06:16 AM
  3. How to install PHP5 on CentOS 4? I get an error...
    By Peppermint in forum Hosting Security and Technology
    Replies: 4
    Last Post: 06-23-2007, 10:46 PM
  4. Lighttpd on CentOS 4.4
    By priceww in forum Hosting Security and Technology
    Replies: 0
    Last Post: 04-07-2007, 03:10 PM
  5. centos:apache,php, yum install or source install?
    By cchere in forum Hosting Security and Technology
    Replies: 2
    Last Post: 08-29-2006, 05:14 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •