how start lighttpd as rooot ?

Discussion in 'Site & Server Administration' started by Boten, Sep 15, 2011.

  1. AnthonyG

    AnthonyG Well-Known Member

    Messages:
    114
    Likes Received:
    3
    Best Answers:
    2
    Trophy Points:
    135
    #21
    server.max-keep-alive-requests = 100
    server.max-keep-alive-idle = 3
    server.max-fds = 4096
    server.max-connections = 2048

    What does that yield?

    Is selinux running on this server?
     
    AnthonyG, Sep 18, 2011 IP
  2. Boten

    Boten Well-Known Member

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    111
    #22
    Hi mate,

    I see selinux on the / but i think it is disabled by defaut on debian and with this command it return nothing :

    ls -Z

    Tried also lighttpd.conf but same error :

     
    Boten, Sep 20, 2011 IP
  3. AnthonyG

    AnthonyG Well-Known Member

    Messages:
    114
    Likes Received:
    3
    Best Answers:
    2
    Trophy Points:
    135
    #23
    Edit your grub.conf and append this to the kernel line to verify its disabled & reboot.
    selinux=0

    Want to make sure selinux isnt behind this snaffu....
     
    AnthonyG, Sep 20, 2011 IP
  4. Boten

    Boten Well-Known Member

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    111
    #24
    I have a lot of kernel lines, where to add selinux=0 exactly :

     
    Boten, Sep 20, 2011 IP
  5. AnthonyG

    AnthonyG Well-Known Member

    Messages:
    114
    Likes Received:
    3
    Best Answers:
    2
    Trophy Points:
    135
    #25
    
    ### BEGIN /etc/grub.d/30_os-prober ###
    menuentry "Debian GNU/Linux, kernel 2.6.26-2-686-bigmem (on /dev/sdb6)" {
    insmod part_msdos
    insmod ext2
    set root='(hd1,msdos6)'
    search --no-floppy --fs-uuid --set 99f5f029-8ca3-42f4-b127-107d45ba4214
    linux /boot/vmlinuz-2.6.26-2-686-bigmem root=/dev/sda6 ro quiet selinux=0
    initrd /boot/initrd.img-2.6.26-2-686-bigmem
    }
    Code (markup):
     
    AnthonyG, Sep 20, 2011 IP
  6. Boten

    Boten Well-Known Member

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    111
    #26
    Same problem, i told you that selinux was disabled :)
     
    Boten, Sep 20, 2011 IP
  7. AnthonyG

    AnthonyG Well-Known Member

    Messages:
    114
    Likes Received:
    3
    Best Answers:
    2
    Trophy Points:
    135
    #27
    I dont believe anything until i confirm it lol

    Well, something is blocking lighttpd from opening more fds, not sure what.
     
    AnthonyG, Sep 20, 2011 IP
  8. Boten

    Boten Well-Known Member

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    111
    #28
    Anthony, we are going to kick our head to the wall with this problem :(

    EDIT : Just found this > http://superuser.com/questions/325305/debian-max-file-descriptors

    Maybe a debian problem ?
     
    Last edited: Sep 20, 2011
    Boten, Sep 20, 2011 IP
  9. AnthonyG

    AnthonyG Well-Known Member

    Messages:
    114
    Likes Received:
    3
    Best Answers:
    2
    Trophy Points:
    135
    #29
    I was going to tell you to off lighttpd anyways and run nginx, but it was an intriguing problem anyways, without being able to check the server, i really cant think of anything else that would lock that limit.
     
    AnthonyG, Sep 20, 2011 IP
  10. Boten

    Boten Well-Known Member

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    111
    #30
    I throught that too.

    I installed lighttpd (v1.4.19) on my testing server (Debian Lenny) and lighttpd started even if the fd are 1024.

    Normally this configuration shoudn't work and i should get lighttpd fds error but it works :eek:

    Tried also this one :
    As you see the max-connections are superiors > to the max-fds but lighttpd started normally without any errors ! :eek:


    I'm very confused.... :mad:

    I tried to get errors but nothing (be aware also that there is no directive on the /etc/security/limits.conf)

    and the ulimit -n of the server and both users (root & www-data) are :

    # ulimit -n
    1024

    Anthony you can now officially KICK YOUR HEAD TO THE WALL HAHA ;)
     
    Boten, Sep 21, 2011 IP
  11. AnthonyG

    AnthonyG Well-Known Member

    Messages:
    114
    Likes Received:
    3
    Best Answers:
    2
    Trophy Points:
    135
    #31
    I did post earlier (post #6) to add the limits in /etc/security/limits.conf, why didnt you?
     
    AnthonyG, Sep 21, 2011 IP
  12. Boten

    Boten Well-Known Member

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    111
    #32
    No no, read my post, i say that i didn't added any limits on etc/security.conf and lighttpd start normaly without errors.
     
    Boten, Sep 21, 2011 IP
  13. AnthonyG

    AnthonyG Well-Known Member

    Messages:
    114
    Likes Received:
    3
    Best Answers:
    2
    Trophy Points:
    135
    #33
    I did read your post and you posted "etc/security/limits.conf", glad its resolved for you tho.
     
    AnthonyG, Sep 21, 2011 IP
  14. Boten

    Boten Well-Known Member

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    111
    #34
    I said : I tried to get errors but nothing (be aware also that there is no directive on the /etc/security/limits.conf)

    The problem is not solved.

    What i'm talking about is the "other server" not "the production server".

    Tried to get the error message : Starting web server: lighttpd2011-09-20 15:45:56: (server.c.889) can't have more connections than fds/2: 2048 824

    Without result but i have setup

    server.max-fds = 4096
    server.max-connections = 80000000

    The server.max-connections SHOULD NOT EXCEEDS 2048 connections (FDS / 2) connections or it will crash.


    Do you don't think that it is a problem with lighty ? Seriously ?
     
    Boten, Sep 21, 2011 IP
  15. AnthonyG

    AnthonyG Well-Known Member

    Messages:
    114
    Likes Received:
    3
    Best Answers:
    2
    Trophy Points:
    135
    #35
    Im not really sure on what lighty's capabilities are, ive ran it a limited amount of time over the yrs, as its a single threaded program, it may very well have connection limits that you need to stick to, back in the day, it had many memory leak issues, that is the reason i changed over to nginx yrs ago.
     
    AnthonyG, Sep 21, 2011 IP
  16. Boten

    Boten Well-Known Member

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    111
    #36
    Apparently yes and from what i read the problem of memory leaks still not resolved but I do not have those problems.

    It is perhaps time to pass under nginx?
     
    Boten, Sep 21, 2011 IP
  17. AnthonyG

    AnthonyG Well-Known Member

    Messages:
    114
    Likes Received:
    3
    Best Answers:
    2
    Trophy Points:
    135
    #37
    Thats really your choice, nginx is a nice program, with many options and great performance.
     
    AnthonyG, Sep 21, 2011 IP
  18. Boten

    Boten Well-Known Member

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    111
    #38
    In every way I plane to move on nginx but i think it will result on the same fds problem cause i can't raise it, something is blocking the system but what, we don't know...it's frustrating :(
     
    Boten, Sep 21, 2011 IP
  19. Boten

    Boten Well-Known Member

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    111
    #39
    Anthony i finally resolved the problem and guess where the problem was ? :eek:

    The problem was in the event handler on my lighttpd.conf, i had :

    server.event-handler = "select" - At the beginning I commented out of curiosity and lighttpd started without any error message :rolleyes:


    and say that we would almost create a new OS ;)
     
    Boten, Sep 27, 2011 IP
  20. dencow

    dencow Member

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #40
    Sorry for bumping up this old thread, just want to make notice for anyone referred here by search engine like I did.

    I just facing similar problem with lighttpd 1.4.3.1, and after some internet search I read old thread at http://www.neko6.tk/archives/546 and changing server.max-fds to 2048 is solving my problem.
    On my lighty server, the server.max-fds was commented on default configuration file.

    [root@centos1 lighttpd]# lighttpd -v
    lighttpd/1.4.31 (ssl) - a light and fast webserver
    Build-Date: Jun  6 2012 13:26:00
    
    Code (markup):
    you may try to upgrade the lighty version if still facing this problem

    edit.
    As I use 2.6 kernel, the server.event-handler is set to "linux-sysepoll"
     
    Last edited: Jul 11, 2013
    dencow, Jul 11, 2013 IP