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 2006-09-16 03:19:30

TheWalt
Member
Registered: 2006-09-12
Posts: 39

lighttpd + php

Trying to get this working from files listed here.  When starting  I get the following error:

2006-09-15 19:06:37: (plugin.c.165) dlopen() failed for: /mnt/HD_a2/website/mod_staticfile.so File not found
2006-09-15 19:06:37: (server.c.583) loading plugins finally failed

I tried looking at some config files but could not find a way to exclude this mod since it isn't included in the mod pack.

Anyone else get this working? 


Thanks in advance.

Last edited by sala (2006-10-26 19:09:39)

Offline

 

#2 2006-09-16 04:26:43

TheWalt
Member
Registered: 2006-09-12
Posts: 39

Re: lighttpd + php

Ok, thanks to Sala for helping me get the toolchain working, I was able to compile lighttpd from source creating all the modules.  Server does now start and host pages fine.  smile

I would like to make it available but the file is 1.3meg and not able to be attatched.  Will send via Email. (Note:  Email failed)

Last edited by TheWalt (2006-09-16 04:54:58)

Offline

 

#3 2006-09-16 13:04:06

sala
Member / Site Admin
From: Estonia
Registered: 2006-07-28
Posts: 731
Website

Re: lighttpd + php

You are welcome smile
I have all modules, will upload them by monday.

//edit
Mod's included
http://dns323.kood.org/downloads/lightt … 11.tar.bz2

Last edited by sala (2006-09-18 15:27:18)


DSM-G600 - NetBSD hdd-boot - 80GB Samsung SP0802N
NSA-220 - Gentoo armv5tel 20110121 hdd-boot - 2x 2TB WD WD20EADS

Offline

 

#4 2006-09-18 18:31:50

TheWalt
Member
Registered: 2006-09-12
Posts: 39

Re: lighttpd + php

My next attempt is trying to get PHP 4 working in conjunction with the fastcgi of lighttpd, 

During compile, I get an error due to the lack of MONETARY.H file not being in the cross compile toolset.  Although I could (and tried) remove the reference, functions that would have been defined within are later referenced thus halting compile anyway. 

Anyone more familiar with this then I know of a work around?

Thanks in advance.

Offline

 

#5 2006-09-18 23:27:56

sala
Member / Site Admin
From: Estonia
Registered: 2006-07-28
Posts: 731
Website

Re: lighttpd + php

Try gentoo chroot method
just get gentoo running and then type:

Code:

USE="php ssl fastcgi gd pcre session cgi zlib force-cgi-redirect discard-path" emerge lighttpd
/etc/init.d/lighttpd start
echo "<?php phpinfo(); ?>" > /var/www/localhost/htdocs/index.php

PS: it takes about 2-3h to compile.


DSM-G600 - NetBSD hdd-boot - 80GB Samsung SP0802N
NSA-220 - Gentoo armv5tel 20110121 hdd-boot - 2x 2TB WD WD20EADS

Offline

 

#6 2006-09-20 06:46:16

qn1234
Member
Registered: 2006-08-18
Posts: 94

Re: lighttpd + php

sala wrote:

PS: it takes about 2-3h to compile.

I suppose you compiled on the DSM-G600 that's why it took a very long time.  wink

Offline

 

#7 2006-09-20 11:30:17

sala
Member / Site Admin
From: Estonia
Registered: 2006-07-28
Posts: 731
Website

Re: lighttpd + php

Thats right, but you are using distcc already? tongue


DSM-G600 - NetBSD hdd-boot - 80GB Samsung SP0802N
NSA-220 - Gentoo armv5tel 20110121 hdd-boot - 2x 2TB WD WD20EADS

Offline

 

#8 2006-09-22 13:41:51

sala
Member / Site Admin
From: Estonia
Registered: 2006-07-28
Posts: 731
Website

Re: lighttpd + php

TheWalt wrote:

My next attempt is trying to get PHP 4 working

Try php5, I did also fail with php4 but php5 is ok.
You can use

Code:

CC=/home/sala/powerpc-uclibc-toolchain/toolchain_powerpc/bin/powerpc-linux-uclibc-gcc \
CXX=/home/sala/powerpc-uclibc-toolchain/toolchain_powerpc/bin/powerpc-linux-uclibc-g++ \
./configure --target="powerpc-uclibc-linux-gnu" \
--host="powerpc-uclibc-linux-gnu" \
--program-prefix="" \
--program-suffix="" \
--disable-cli \
--enable-cgi \
--enable-fastcgi \
--enable-force-cgi-redirect \
--enable-discard-path \
--enable-shared \
--disable-static \
--disable-rpath \
--disable-debug \
--without-pear \
--disable-spl \
--with-config-file-path=/mnt/HD_a2 \
--disable-ipv6 \
--enable-magic-quotes \
--enable-memory-limit \
--disable-short-tags \
--disable-ctype \
--disable-dom \
--enable-ftp=shared \
--without-gettext \
--without-iconv \
--disable-libxml \
--without-libxml-dir \
--disable-mbstring \
--disable-mbregex \
--with-openssl=shared \
--enable-session=static \
--disable-simplexml \
--disable-soap \
--enable-sockets=shared \
--disable-tokenizer \
--with-zlib \
--without-xml \
--disable-xml \
--without-libxml-dir \
--disable-xmlreader \
--disable-xmlwriter \
--disable-crypt \
--without-crypt

Finaly binary will be around 9MB, so I still prefer chroot into gentoo method wink


DSM-G600 - NetBSD hdd-boot - 80GB Samsung SP0802N
NSA-220 - Gentoo armv5tel 20110121 hdd-boot - 2x 2TB WD WD20EADS

Offline

 

#9 2006-09-22 15:42:42

TheWalt
Member
Registered: 2006-09-12
Posts: 39

Re: lighttpd + php

Nice, that size was pretty much why I went with v4 to start.  I'll give that a try though, thanks for looking into it.  My goal is to setup something that could just be 'dropped' in and provide some functionality vs setting up an entire linux environment (least for now).    I've become a little discouraged as getting the DSM-G600 was an impulse buy due to low price, and then finding out there are nicer units available with lots of existing support.

Lucky for the DSM-G600 community people like you are here to lend a hand smile

Offline

 

#10 2006-10-13 15:55:39

sala
Member / Site Admin
From: Estonia
Registered: 2006-07-28
Posts: 731
Website

Re: lighttpd + php

I did re-compile lighttpd and php5 with some code optimization, now php binary is 2.9MB instead 9MB and lighttpd is about 1/3 of it's old size.


DSM-G600 - NetBSD hdd-boot - 80GB Samsung SP0802N
NSA-220 - Gentoo armv5tel 20110121 hdd-boot - 2x 2TB WD WD20EADS

Offline

 

#11 2006-10-13 16:46:09

TheWalt
Member
Registered: 2006-09-12
Posts: 39

Re: lighttpd + php

I will try them out.  I did get lighttpd working fine with the old release alone, and php from command line did respond.  However, when I set the lighttpd config to use php it reported an error (which I forget) needing another file.

I will try these new versions out now that I have some time again and report back.

Offline

 

#12 2006-10-14 00:36:02

TheWalt
Member
Registered: 2006-09-12
Posts: 39

Re: lighttpd + php

Got it working. (UPDATED: 10/14/06)  The following basic config file was successful to display the php version info page in a web browser.

Steps:

1) Untar lighttpd and php into the same directory (in my case that was /mnt/HD_a2/website)
2) Create the following config file where server.document-root is the root path to your web page files (in my case that was /mnt/HD_a2/website/pages), server.port is the port you want to use since 80 is taken by the built in interface, and where bin.path is the directory from step 1.  File name should be lighttpd.conf and placed in the same folder as step 1.

Code:

server.document-root = "/mnt/HD_a2/website/pages/"

server.port = 3000

mimetype.assign = (
  ".html" => "text/html",
  ".htm" => "text/html",
  ".txt" => "text/plain",
  ".jpg" => "image/jpeg",
  ".gif" => "image/gif",
  ".png" => "image/png"
)

index-file.names  = ( "index.php", "index.html",
                      "index.htm", "default.htm" )
                      
dir-listing.activate = "enable"

server.modules = (
  "mod_rewrite",
  "mod_access",
  "mod_fastcgi",
  "mod_accesslog",
  "mod_dirlisting",
  "mod_indexfile"
)

fastcgi.server = ( ".php" =>
  (( "host" => "127.0.0.1", 
     "port" => 1026,
     "bin-path" => "/mnt/HD_a2/website/php"
  ))
)

Then create a web page in your website root folder (index.php for example) that contains:

Code:

<?php phpinfo(); ?>

Then from telnet session (might work in funplug but haven't gotten that far) start the service by typing (using my path examples):

/mnt/HD_a2/website/lighttpd -f lighttpd.conf -m /mnt/HD_a2/website

It should respond "server started".  Then open a web browser to your file and see if it worked!   http://youriphere/index.php

Thanks again to Sala for the binaries, I'll be posting more as I continue working on it.

UPDATED:  Added the config line to auto-load index page if found.  Also added config line to enable file listing which has CSS support (still researching but default works).

Last edited by TheWalt (2006-10-14 22:00:35)

Offline

 

#13 2006-10-14 23:30:37

TheWalt
Member
Registered: 2006-09-12
Posts: 39

Re: lighttpd + php

Sala, any chance you have the php-socket from the compiled source?

Offline

 

#14 2006-10-14 23:55:24

sala
Member / Site Admin
From: Estonia
Registered: 2006-07-28
Posts: 731
Website

Re: lighttpd + php

You mean --enable-sockets=static instead of --enable-sockets=shared or what?


DSM-G600 - NetBSD hdd-boot - 80GB Samsung SP0802N
NSA-220 - Gentoo armv5tel 20110121 hdd-boot - 2x 2TB WD WD20EADS

Offline

 

#15 2006-10-15 00:06:07

TheWalt
Member
Registered: 2006-09-12
Posts: 39

Re: lighttpd + php

sala wrote:

You mean --enable-sockets=static instead of --enable-sockets=shared or what?

Well... not sure yet, jumped the gun with the post smile  If I try to use the socket file instead of the explicit IP/PORT info it returns the error:

# 2006-10-14 15:54:42: (mod_fastcgi.c.890) failed: Address family not supported by protocol
   2006-10-14 15:54:42: (mod_fastcgi.c.1356) [ERROR]: spawning fcgi failed.
   2006-10-14 15:54:42: (server.c.834) Configuration of plugins failed. Going down.

Looking into what that means, or if I'm just missing some other config option.

Offline

 

#16 2006-10-15 00:24:53

sala
Member / Site Admin
From: Estonia
Registered: 2006-07-28
Posts: 731
Website

Re: lighttpd + php

Now I know, but unfortunately it look like kernel limitation. Thats why screen and dtach is not working also.


DSM-G600 - NetBSD hdd-boot - 80GB Samsung SP0802N
NSA-220 - Gentoo armv5tel 20110121 hdd-boot - 2x 2TB WD WD20EADS

Offline

 

#17 2006-10-15 01:30:25

TheWalt
Member
Registered: 2006-09-12
Posts: 39

Re: lighttpd + php

sala wrote:

Now I know, but unfortunately it look like kernel limitation. Thats why screen and dtach is not working also.

Ok, thanks for saving me the time smile

One last thing... I've tried to start the server from funplug by adding "/mnt/HD_a2/website/lighttpd -f lighttpd.conf -m /mnt/HD_a2/website".  It does start the server as I get a log output, but then it dies right away.  If ran from telnet it will stay active no problems.

Do I need to put a shell in front?

Last edited by TheWalt (2006-10-15 01:30:43)

Offline

 

#18 2006-10-15 02:04:33

sala
Member / Site Admin
From: Estonia
Registered: 2006-07-28
Posts: 731
Website

Re: lighttpd + php

I think that you need to add full path to lighttpd.conf

Code:

/mnt/HD_a2/website/lighttpd -f /mnt/HD_a2/website/lighttpd.conf -m /mnt/HD_a2/website

DSM-G600 - NetBSD hdd-boot - 80GB Samsung SP0802N
NSA-220 - Gentoo armv5tel 20110121 hdd-boot - 2x 2TB WD WD20EADS

Offline

 

#19 2006-10-15 18:43:01

TheWalt
Member
Registered: 2006-09-12
Posts: 39

Re: lighttpd + php

sala wrote:

I think that you need to add full path to lighttpd.conf

Code:

/mnt/HD_a2/website/lighttpd -f /mnt/HD_a2/website/lighttpd.conf -m /mnt/HD_a2/website

Yup... that was it.

Offline

 

#20 2006-10-16 12:26:39

sala
Member / Site Admin
From: Estonia
Registered: 2006-07-28
Posts: 731
Website

Re: lighttpd + php


DSM-G600 - NetBSD hdd-boot - 80GB Samsung SP0802N
NSA-220 - Gentoo armv5tel 20110121 hdd-boot - 2x 2TB WD WD20EADS

Offline

 

#21 2006-10-16 14:51:31

sala
Member / Site Admin
From: Estonia
Registered: 2006-07-28
Posts: 731
Website

Re: lighttpd + php


DSM-G600 - NetBSD hdd-boot - 80GB Samsung SP0802N
NSA-220 - Gentoo armv5tel 20110121 hdd-boot - 2x 2TB WD WD20EADS

Offline

 

#22 2006-10-16 15:33:32

TheWalt
Member
Registered: 2006-09-12
Posts: 39

Re: lighttpd + php

Super!  Something to keep me busy this week.

Offline

 

#23 2006-10-26 11:59:05

sala
Member / Site Admin
From: Estonia
Registered: 2006-07-28
Posts: 731
Website

Re: lighttpd + php

I did re-compile php4 again, now it is 1.2M and has still fastcgi, session and pcre built in smile
http://dns323.kood.org/downloads/php-4.4.4.tar.bz2

We have also php3 with latest debian stable security patchset.
http://dns323.kood.org/downloads/php-3.0.18-31.tar.bz2


DSM-G600 - NetBSD hdd-boot - 80GB Samsung SP0802N
NSA-220 - Gentoo armv5tel 20110121 hdd-boot - 2x 2TB WD WD20EADS

Offline

 

#24 2006-10-27 03:23:54

TheWalt
Member
Registered: 2006-09-12
Posts: 39

Re: lighttpd + php

Found some time to work with this yet again.

Your php version 4.4.4 with gd support is working great excpet it didn't have jpg enabled, which almost everything uses.  Any chance of getting that recompiled with jpeg support... please please smile


And as long as I am waiting.  If I start the server from telnet all works fine, but if I start it from fun_plug only the web server starts, it doesn't spawn the php listeners.  Any ideas on why that might be?  path issue?  shell issue?


As always thanks in advance.

Last edited by TheWalt (2006-10-27 04:14:57)

Offline

 

#25 2006-10-27 10:01:08

sala
Member / Site Admin
From: Estonia
Registered: 2006-07-28
Posts: 731
Website

Re: lighttpd + php

Re-compiled. This time it's modular, so you need to setup php.ini for modules.
http://dns323.kood.org/downloads/php-4.4.4.tar.bz2

As of the fun_plug startup i haven't had much time to mess around with my DSMG lately and test any new stuff.
I just cross-compile binaries at work when I get bored big_smile


DSM-G600 - NetBSD hdd-boot - 80GB Samsung SP0802N
NSA-220 - Gentoo armv5tel 20110121 hdd-boot - 2x 2TB WD WD20EADS

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB