DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2011-02-27 05:28:52

colinkhalid
Member
From: Kuching, Malaysia
Registered: 2011-01-31
Posts: 27

Lighttpd has error on config file , how to correct it ?

I have completed all the installation steps for lighttpd but the server won't run or rather defaults back to the standard Dlink interface.

according to this post

http://dns323.kood.org/forum/viewtopic. … 94&p=3

the problem is in the lighttpd.conf file but does not say how to resolve it  ! The post says the following :


If it works you've got this :
4309 root     /ffp/sbin/lighttpd-angel -D -f /ffp/etc/lighttpd.conf
4310 root     /ffp/sbin/lighttpd -D -f /ffp/etc/lighttpd.conf
4313 root     grep light

if it doesn't work : it loaded the standard one :
4196 root     /usr/sbin/lighttpd-angel -D -m /usr/local/lib -f /etc/lighttpd/lighttpd.conf
4197 root     /usr/sbin/lighttpd -D -m /usr/local/lib -f /etc/lighttpd/lighttpd.conf
4232 root     grep light


Then there is a problem in the lighttpd.conf file...

In my case I have :

4196 root     /usr/sbin/lighttpd-angel -D -m /usr/local/lib -f /etc/lighttpd/lighttpd.conf
4197 root     /usr/sbin/lighttpd -D -m /usr/local/lib -f /etc/lighttpd/lighttpd.conf
4232 root     grep light

I can't see any where in the lighttpd.conf where I can make any changes, Can anyone help ?
Thanks in advance

Offline

 

#2 2011-04-01 14:17:27

stefanth
Member
Registered: 2010-12-14
Posts: 63

Re: Lighttpd has error on config file , how to correct it ?

Hi

The result you have shows that the standard dlink lighttpd is running (as it should)

To get your lighttpd running (at start up) you need script to be executed at start up in /ffp/start

Let us say that your lighttpd is installed in ffp/sbin

Then the following code into the file /ffp/start/lighttpd.sh

Code:

#!/ffp/bin/sh

# PROVIDE: lighttpd
# REQUIRE: LOGIN


. /ffp/etc/ffp.subr

name=lighttpd
start_cmd="lighttpd_start"
stop_cmd="lighttpd_stop"
status_cmd="lighttpd_status"
required_files="/ffp/etc/lighttpd/lighttpd.conf"

find_lighttpd_pids()
{
    ps -o pid,comm,args | grep $1 | while read _pid _comm _arg0 _args; do
        if [ "$_arg0" = "$1" -o "$_comm" = "$1" ]; then
            echo -n "$_pid "
        fi
    done
    echo
}


lighttpd_start()
{
                rm -rf /ffp/var/lighttpd/*
        /ffp/sbin/lighttpd -f $required_files  </dev/null &
}

lighttpd_stop()
{
        _pids=$(find_lighttpd_pids "/ffp/sbin/lighttpd")
        for currps in $_pids; do
                kill -9 $currps
        done

        _pids=$(find_lighttpd_pids "/ffp/bin/php-cgi")
        for currps in $_pids; do
                kill -9 $currps
        done
}

lighttpd_status()
{
        _pids=$(find_lighttpd_pids "/ffp/sbin/lighttpd")
        for currps in $_pids; do
                echo "/ffp/sbin/lighttpd is running as $currps"
        done
        if test "$_pids" = ""; then
                echo "/ffp/sbin/lighttpd is not running"
        fi
}

run_rc_command "$1"

and enter at the command prompt

Code:

chmod 775 /ffp/start/lighttpd.sh

Now your lighttpd will autostart when the NAS starts.


you can start it right away by typing

Code:

/ffp/start/lighttpd.sh start

lighttpd is controlled by a configuration file, depending on how you installed lighttpd it is somewhere under /ffp
In my case it is /ffp/etc/lighttpd/lighttpd.conf

You need to modify /ffp/etc/lighttpd/lighttpd.conf in order to get it working.

The dlink's lighttpd is using port 80 and therefore you can not use this if you do not, by some tricks, force dlinks lighttpd  to use other ports.
In my case I accept that dlink's lighttpd  is using port 80 and let mine using port 8080 so in /ffp/etc/lighttpd/lighttpd.conf I have the line

Code:

server.port                = 8080

You also need to fix the php-cgi stuff for lighttpd

find and replace the lines in /ffp/etc/lighttpd/lighttpd.conf so they look like this

Code:

## php support
## uncomment the following lines and the mod_fastcgi module above
fastcgi.server = ( ".php" => ((
    "bin-path"  => "/ffp/bin/php-cgi",
    "socket"    => "/tmp/php-cgi.socket",
    "max-procs" => "2"
)))

Last edited by stefanth (2011-04-01 14:18:52)

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB