SmallNetBuilder Forums

Go Back   SmallNetBuilder Forums > Wireless Networking > ASUS Wireless > Asuswrt-Merlin

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-07-2013, 06:49 PM
TeHashX's Avatar
TeHashX TeHashX is online now
Very Senior Member
 
Join Date: Jul 2012
Location: Europe
Posts: 260
Thanks: 65
Thanked 88 Times in 55 Posts
TeHashX is just starting out
Lightbulb [TUTORIAL] LIGHTTPD web server with PHP support through Entware

Works only on Merlin's firmware because /jffs partititon is required for Entware environment
We need a usb-flash formatted EXT2 or a usb-hdd formated EXT3, may not work on FAT32 or NTFS.
First, setup Entware from this guide (see youtube video here)

Login to router with putty terminal and enter this commands:
Quote:
# opkg install lighttpd
# opkg install php5-cgi
# opkg install lighttpd-mod-fastcgi
# /opt/etc/init.d/S80lighttpd stop
# rm /opt/etc/lighttpd/lighttpd.conf
# wget -c -O /opt/etc/lighttpd/lighttpd.conf http://tinyurl.com/amvkxt3
# wget -c -O /opt/share/www/index.html http://tinyurl.com/bxfxpq6
# wget -c -O /opt/share/www/test.php http://tinyurl.com/b9b34kp
# /opt/etc/init.d/S80lighttpd start
Go to 192.168.1.1:81 and if you see this page, the lighttpd web server is configured correctly



Go to 192.168.1.1:81/test.php and if you see this page, the php-mod-fastcgi is configured correctly



TO ACCESS THE WEBSITE FROM WAN
--------------------------------------------------------------------------
Quote:
# opkg install nano
# nano /jffs/scripts/firewall-start
and add this lines
Quote:
#!/bin/sh
iptables -I INPUT -p tcp --destination-port 81 -j ACCEPT
Save with CTRL-O / Enter / and exit with CTRL-X
Quote:
# chmod a+rx /jffs/scripts/firewall-start
Go to Port Forwarding and redirect port 80 to 81, after reboot you should have access from wan.



Video HERE...

Last edited by TeHashX; 01-09-2013 at 10:58 AM.
Reply With Quote
The Following 7 Users Say Thank You to TeHashX For This Useful Post:
  #2  
Old 01-09-2013, 10:59 AM
TeHashX's Avatar
TeHashX TeHashX is online now
Very Senior Member
 
Join Date: Jul 2012
Location: Europe
Posts: 260
Thanks: 65
Thanked 88 Times in 55 Posts
TeHashX is just starting out
Default

Added youtube video HERE...

Last edited by TeHashX; 01-09-2013 at 12:16 PM.
Reply With Quote
The Following User Says Thank You to TeHashX For This Useful Post:
  #3  
Old 01-09-2013, 02:11 PM
ryzhov_al's Avatar
ryzhov_al ryzhov_al is online now
Senior Member
 
Join Date: Jul 2012
Location: Smolensk, Russia
Posts: 170
Thanks: 15
Thanked 104 Times in 55 Posts
ryzhov_al is just starting out
Send a message via ICQ to ryzhov_al Send a message via Skype™ to ryzhov_al
Default

Quote:
Originally Posted by TeHashX View Post
Added youtube video HERE...
Feel free to add terminal recordings with asciiio package. Here is an example.
__________________
The Entware. A modern Optware replacement.
Reply With Quote
The Following User Says Thank You to ryzhov_al For This Useful Post:
  #4  
Old 01-09-2013, 04:37 PM
TeHashX's Avatar
TeHashX TeHashX is online now
Very Senior Member
 
Join Date: Jul 2012
Location: Europe
Posts: 260
Thanks: 65
Thanked 88 Times in 55 Posts
TeHashX is just starting out
Thumbs up

THX, it's a very good terminal recorder, I will use it but sometimes I need the entire screen to be shown.
http://ascii.io/a/1838
Reply With Quote
  #5  
Old 01-09-2013, 05:00 PM
TeHashX's Avatar
TeHashX TeHashX is online now
Very Senior Member
 
Join Date: Jul 2012
Location: Europe
Posts: 260
Thanks: 65
Thanked 88 Times in 55 Posts
TeHashX is just starting out
Unhappy

I'm facing a little problem here, after rebooting the router, S80lighttpd it's starting normally with all other apps in init.d folder (it's running in background) but I can't access the web site from lan or wan, if I restart with /opt/etc/init.d/S80lighttpd restart command, initiating to work fine, dunno why.
Solved temporary by adding this lines to /jffs/scripts/services-start
Quote:
#!/bin/sh
sleep 20
/opt/etc/init.d/rc.unslung start
sleep 10
/opt/etc/init.d/S80lighttpd restart

Anyone else is facing the same problem?
Reply With Quote
  #6  
Old 01-09-2013, 07:44 PM
RMerlin's Avatar
RMerlin RMerlin is offline
Very Senior Member
 
Join Date: Apr 2012
Location: Canada
Posts: 3,636
Thanks: 27
Thanked 1,578 Times in 770 Posts
RMerlin is just starting out
Default

Quote:
Originally Posted by TeHashX View Post
I'm facing a little problem here, after rebooting the router, S80lighttpd it's starting normally with all other apps in init.d folder (it's running in background) but I can't access the web site from lan or wan, if I restart with /opt/etc/init.d/S80lighttpd restart command, initiating to work fine, dunno why.
Solved temporary by adding this lines to /jffs/scripts/services-start
[/color][/color]
Anyone else is facing the same problem?
I had some similar issues with Entware and Minidlna (I was merely testing something). Seems to be a timing issue if starting some services too early through services-start, inserting a sleep command also resolved my issue.
__________________
Asuswrt-Merlin: Customized firmware for Asus routers
Github: github.com/RMerl - Twitter: RMerlinDev
See the sticky post for more info.
Reply With Quote
The Following User Says Thank You to RMerlin For This Useful Post:
  #7  
Old 01-10-2013, 12:12 AM
ryzhov_al's Avatar
ryzhov_al ryzhov_al is online now
Senior Member
 
Join Date: Jul 2012
Location: Smolensk, Russia
Posts: 170
Thanks: 15
Thanked 104 Times in 55 Posts
ryzhov_al is just starting out
Send a message via ICQ to ryzhov_al Send a message via Skype™ to ryzhov_al
Default

Quote:
Originally Posted by RMerlin View Post
I had some similar issues
TeHashX, RMerlin, can the /usr/sbin/httpd be a cause?
Think I'm not faced this trouble because I'm manually Ğmoveğ httpd from TCP80 port with my own scripts:
Quote:
$ cat /opt/etc/init.d/S00firmware_services
#!/bin/sh

prefix="/opt"
PATH=${prefix}/bin:${prefix}/sbin:/sbin:/bin:/usr/sbin:/usr/bin

start() {
...
# Moving web interface to another port.
# You'll need it while using your own web-server on 80 port
/usr/bin/killall httpd
cd /www
/usr/sbin/httpd -p 65080 &
...
}
...
__________________
The Entware. A modern Optware replacement.
Reply With Quote
  #8  
Old 01-10-2013, 01:26 AM
RMerlin's Avatar
RMerlin RMerlin is offline
Very Senior Member
 
Join Date: Apr 2012
Location: Canada
Posts: 3,636
Thanks: 27
Thanked 1,578 Times in 770 Posts
RMerlin is just starting out
Default

Quote:
Originally Posted by ryzhov_al View Post
TeHashX, RMerlin, can the /usr/sbin/httpd be a cause?
Think I'm not faced this trouble because I'm manually Ğmoveğ httpd from TCP80 port with my own scripts:
The issue I encountered was with Minidlna (the Entware version), so I doubt it was related to httpd in any way. I was just testing service auto-starting through unslung at the time.
__________________
Asuswrt-Merlin: Customized firmware for Asus routers
Github: github.com/RMerl - Twitter: RMerlinDev
See the sticky post for more info.
Reply With Quote
  #9  
Old 02-02-2013, 08:20 AM
jmir jmir is offline
New Member
 
Join Date: Dec 2012
Location: Lisbon
Posts: 5
Thanks: 4
Thanked 0 Times in 0 Posts
jmir is just starting out
Default

Hello TeHashX!
Thanks for your nice how-to!
Do you think it's possible to install lighttpd on optware as well? I'm not ready yet for entware and would like to use this nice webserver which I know reasonable well from NSLU2...

jmir (RT-N16 user)

Last edited by jmir; 02-02-2013 at 08:23 AM.
Reply With Quote
  #10  
Old 02-02-2013, 09:23 AM
TeHashX's Avatar
TeHashX TeHashX is online now
Very Senior Member
 
Join Date: Jul 2012
Location: Europe
Posts: 260
Thanks: 65
Thanked 88 Times in 55 Posts
TeHashX is just starting out
Default

Lighttpd is available on optware too, but probably you should make some minor changes to it
# ipkg install lighttpd
There is Cherokee Web Server tutorial that you may try, look at my signature.

Last edited by TeHashX; 02-02-2013 at 09:27 AM.
Reply With Quote
The Following User Says Thank You to TeHashX For This Useful Post:
Reply

Tags
howto, lighttpd, php, rt-n66u, tutorial, web server

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT -4. The time now is 02:44 AM.

Top 10 Stats
Top Posters* Top Thanked
RMerlin  332
coxhaus  116
stevech  106
Fraoch  45
vdemarco  41
tipstir  40
RogerSC  32
CaptainSTX  24
Pericynthion  23
DmitryOlenin  22
RMerlin  1578
stevech  145
ryzhov_al  104
TeHashX  88
RogerSC  71
GregN  54
Geraner  44
CL-Jeremy  42
joegreat  39
sfx2000  34
Most Viewed Threads* Hottest Threads*
Old Asuswrt-Merli...  4738
Old Asuswrt-Merli...  3268
Old Adding NvRam...  1832
Old 2GHz...  1680
Old Article...  1420
Old FlexRaid on...  1311
Old IPv6 not...  1270
Old Does...  1242
Old RT-N66U...  1224
Old AC 5ghz...  1148
Old Asuswrt-Merli...  55
Old Asuswrt-Merli...  42
Old IPv6 not...  36
Old Two DHCP...  28
Old Adding NvRam...  24
Old DLNA Media...  22
Old BW logs not...  20
Old RT-N66U...  19
Old Inaccuracy -...  19
Old what does...  18





Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
© 2006-2013 Pudai LLC All Rights Reserved.