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 2008-09-10 05:24:26

iazmin
Member
Registered: 2008-09-10
Posts: 55

lighttpd.sh to use port 80

I am currently run my web server using the 8080 port successfully.
I want to change to port 80. My try to follow strickly from the wiki
http://dns323.kood.org/howto:lighttpd_p … r_lighttpd

I did change the folder name of fun_plug.d to ffp since I ffp appear on my Volume_1
I copied the edited lighttpd.sh and admwebs.sh into mt ffp/start
Then I:

Code:

 chmod a+x lighttpd.sh.

Code:

 chmod a+x admwebs.sh

Then I try to execute the lighttpd.sh using:

Code:

sh lighttpd.sh start

Then this  error message appears:

Code:

root@nashawa:/mnt/HD_a2# sh lighttpd.sh start
: not found: line 18:
: not found: line 20:
: not found: line 25:
lighttpd.sh: line 52: syntax error: word unexpected (expecting "in")
root@nashawa:/mnt/HD_a2#

What I am supposed to do now? If there  any better guide on this?

Offline

 

#2 2008-09-10 05:53:58

bq041
Member
From: USA
Registered: 2008-03-19
Posts: 709

Re: lighttpd.sh to use port 80

Post a copy of your lighttpd.sh.  The line 52 error is probably because you forgot to put "in" after the case statement, or you forgat to close a set of quotation marks somewhere and this is where it is regestering the error.  The next thing is that I do not see the variables VOL1, SBINDIR, and ECTDIR defined anywhere.  That may be why you are getting not found errors, because the path you are calling cannot be found.  Anyway, post your script and then people can take a look at it.


DNS-323     F/W: 1.04b84  H/W: A1  ffp: 0.5  Drives: 2X 400 GB Seagate SATA-300
DNS-323     F/W: 1.05b28  H/W: B1  ffp: 0.5  Drives: 2X 1 TB  WD SATA-300
DSM-G600   F/W: 1.02       H/W: B                Drive:  500 GB WD ATA

Offline

 

#3 2008-09-10 06:19:45

iazmin
Member
Registered: 2008-09-10
Posts: 55

Re: lighttpd.sh to use port 80

I am using Notepad++ for editing the lighttpd.sh script
I went to Line 52:

Code:

case "$1" in

I am newbie actually :-)
What I am supposed to replace for the VOL1, SBINDIR and ETCDIR...
is it like this:
VOL1--->

Code:

 mnt/HD_a2

SBBIN--->

Code:

mnt/HD_a2/lnx_bin

or

Code:

mnt/HD_a2/ffp/bin

ETCDIR--->

Code:

mnt/HD_a2/ffp/etc

Anyway here is my edited lighttpd.sh.


Attachments:
Attachment Icon lighttpd.sh, Size: 1,858 bytes, Downloads: 238

Offline

 

#4 2008-09-10 14:35:00

rcblackwell
Member
From: Pickering, ON
Registered: 2008-05-19
Posts: 204
Website

Re: lighttpd.sh to use port 80

iazmin wrote:

I am using Notepad++ for editing the lighttpd.sh script

I had a look at your file. The context of the case statement seems fine. I did however notice that each line ends with a CR & LF. FUN_PLUG files are UNIX based and thus must not contain the CR.

Did you set line endings in the Settings/Preferences/New Document to UNIX? Notepad++ 5.03 has an edit function to convert files formatted as Windows to UNIX; Format/Convert to UNIX format. Change the files format, save it and try again.

Last edited by rcblackwell (2008-09-10 14:36:23)


Bob Blackwell
Pickering, ON

Offline

 

#5 2008-09-10 16:45:44

iazmin
Member
Registered: 2008-09-10
Posts: 55

Re: lighttpd.sh to use port 80

rcblackwell wrote:

iazmin wrote:

I am using Notepad++ for editing the lighttpd.sh script

I had a look at your file. The context of the case statement seems fine. I did however notice that each line ends with a CR & LF. FUN_PLUG files are UNIX based and thus must not contain the CR.

Did you set line endings in the Settings/Preferences/New Document to UNIX? Notepad++ 5.03 has an edit function to convert files formatted as Windows to UNIX; Format/Convert to UNIX format. Change the files format, save it and try again.

You are right, I did  not do that, will try again, may be this time using nano right in the command line.

By the way may you explain what is end of line CR & LF? I totally ignorant about these jargons....sorry bro

Last edited by iazmin (2008-09-10 16:51:37)

Offline

 

#6 2008-09-10 18:43:17

iazmin
Member
Registered: 2008-09-10
Posts: 55

Re: lighttpd.sh to use port 80

I solved my problem, but not using the above method since I realized I am using fun_plug v0.5 which should be using the method here:
http://dns323.kood.org/howto:ffp#lighttpd_web_server

I actually had try something similar to this from this guide:
http://www.nas-tweak.net/CH3SNAS:Tutorials/lighttpd

but the later skip one of the key step which is to reconfigure the  lighttpd.conf in ffp/etc by adding these:

Code:

cd /ffp/etc
sed -i '/server.port/ s/^/#/' lighttpd.conf
cd /ffp/start
chmod a+x kickwebs.sh lighttpd.sh

Once I applied the above codes and then restart the lighttpd.sh, my DNS323 now can run as a perfect web server at the native port 80 with the admin web run on port 81.

Without the above codes, lighttpd.conf is confused before you force it to be in port 81 but the conf file still using 8080

Offline

 

#7 2008-09-11 01:00:20

bq041
Member
From: USA
Registered: 2008-03-19
Posts: 709

Re: lighttpd.sh to use port 80

CR is "Carrige Return" and LF is "Line Feed".  CR is the equivelant on a type writer to sliding the carrige back to the starting point at the end of a line and LF is the equivelant to advancing the paper by 1 line.  CR + LF is equivelant to doing both, which is what the shiny metal bar on the typewriter did.


DNS-323     F/W: 1.04b84  H/W: A1  ffp: 0.5  Drives: 2X 400 GB Seagate SATA-300
DNS-323     F/W: 1.05b28  H/W: B1  ffp: 0.5  Drives: 2X 1 TB  WD SATA-300
DSM-G600   F/W: 1.02       H/W: B                Drive:  500 GB WD ATA

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB