How to access/edit ASP pages

Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware
Goto page 1, 2  Next
Author Message
rhaynes
DD-WRT Novice


Joined: 29 Mar 2008
Posts: 8

PostPosted: Sat Mar 29, 2008 20:03    Post subject: How to access/edit ASP pages Reply with quote
Just recently purchased a Linksys WRT54GL v1.1 and successfully loaded the standard DD-WRT.

I looked on the forums and wiki and I can’t see any information on this.

Is there a way to easily edit and view the pages that make up the web interface? As well, to add my own?
Sponsor
Eko
DD-WRT Developer/Maintainer


Joined: 07 Jun 2006
Posts: 5771

PostPosted: Sat Mar 29, 2008 20:06    Post subject: Reply with quote
You can add your own to /tmp/www folder and then access it with http://routerip/user/Yourpage.asp
rhaynes
DD-WRT Novice


Joined: 29 Mar 2008
Posts: 8

PostPosted: Sat Mar 29, 2008 20:53    Post subject: Reply with quote
Ok, I did figure out how to do it that way. So I have httpd working on port 81, have my own ASP page working.

I apologize if this is a noob question... but what server side scripting can I do? I tried to put some standard ASP in there like response writing "now()".

Is this active server pages? Something else? I'm having a hard time fiding documentation on what I can access with my own pages.
rhaynes
DD-WRT Novice


Joined: 29 Mar 2008
Posts: 8

PostPosted: Mon Mar 31, 2008 18:10    Post subject: Reply with quote
Wondering if anyone knows what server-side language(s) I can use on my pages loaded into the router?

All I can tell is that httpd is running them, but I have no idea what its based in.
kuthulu
DD-WRT User


Joined: 20 Feb 2007
Posts: 219
Location: Santiago, Chile

PostPosted: Mon Mar 31, 2008 19:56    Post subject: Reply with quote
only static html pages
but if you need dynamic pages you can use cgi scripts (sh scripts or some binary file)
create the directory /tmp/www/cgi-bin

then create a script like:
Code:

#!/bin/sh
echo "<html><body>hello world</body></html>"


and save your script as script.cgi and:
chmod +x /tmp/www/cgi-bin/script.cgi
you can execute the page going to:
http://router_ip/user/cgi-bin/script.cgi

good luck

_________________
Linksys WRT54G v6 - DD-WRT Micro v24 with AutoAP as a Repeater.
wifi scanner for linux
http://kuthulu.com/iwscanner
ssh/telnet connection manager for linux
http://kuthulu.com/gcm
rhaynes
DD-WRT Novice


Joined: 29 Mar 2008
Posts: 8

PostPosted: Mon Mar 31, 2008 22:35    Post subject: Reply with quote
kuthulu wrote:
only static html pages
but if you need dynamic pages you can use cgi scripts (sh scripts or some binary file)
create the directory /tmp/www/cgi-bin

then create a script like:
Code:

#!/bin/sh
echo "<html><body>hello world</body></html>"


and save your script as script.cgi and:
chmod +x /tmp/www/cgi-bin/script.cgi
you can execute the page going to:
http://router_ip/user/cgi-bin/script.cgi

good luck


Ok, I tried that... but CGI files don't seem to do anything. If I rename the file ASP or HTML, it shows up... but does not execute. I just see the raw code (#!/bin/sh... etc...)
rhaynes
DD-WRT Novice


Joined: 29 Mar 2008
Posts: 8

PostPosted: Mon Mar 31, 2008 22:55    Post subject: Reply with quote
Also... this could be unrelated...

I now have a file in my /tmp/www named testcgi.cgi as well as the same file also named testcgi.sh (thinking the extension has something to do with it)

When I run this directly from telnet, I get this error:

/bin/sh: Can't open
rhaynes
DD-WRT Novice


Joined: 29 Mar 2008
Posts: 8

PostPosted: Tue Apr 01, 2008 21:02    Post subject: Reply with quote
Some more info on my problem.

I tried using a HTTP control to get my CGI page (similar to wget). When I do that, it times out. No other pages time out, though. No specific error- just times out after hanging for 10 or so seconds.
turkey
DD-WRT Novice


Joined: 13 Nov 2007
Posts: 31

PostPosted: Wed Apr 02, 2008 4:34    Post subject: Reply with quote
put the script in:

/tmp/www/cgi-bin/testcgi.cgi

the extension is correct (cgi)

and go to:

http://router_ip/user/cgi-bin/script.cgi
rhaynes
DD-WRT Novice


Joined: 29 Mar 2008
Posts: 8

PostPosted: Wed Apr 02, 2008 14:33    Post subject: Reply with quote
turkey wrote:
put the script in:

/tmp/www/cgi-bin/testcgi.cgi

the extension is correct (cgi)

and go to:

http://router_ip/user/cgi-bin/script.cgi



That is precisely what I am doing. Its precisely the same simple code seen above. Nothing happens.

Any way to easily debug this? What could be going wrong??
Frenchy2k1
DD-WRT Novice


Joined: 27 Feb 2008
Posts: 43

PostPosted: Wed Apr 02, 2008 19:15    Post subject: Reply with quote
from your own post, this comes from the shell not being executed at all.
go into /bin and find if sh is there, accessible and executable. If sh is not there, your script cannot run.
Until you can get your script to run from a telnet window, you cannot expect it to run in a browser.
infusion
DD-WRT Guru


Joined: 30 Aug 2006
Posts: 506

PostPosted: Wed Apr 02, 2008 20:12    Post subject: Reply with quote
Did you do:

chmod +x /user/cgi-bin/script.cgi


Just in case Cool
rhaynes
DD-WRT Novice


Joined: 29 Mar 2008
Posts: 8

PostPosted: Wed Apr 02, 2008 22:23    Post subject: Reply with quote
I did chmod +x /user/cgi-bin/script.cgi.

Here is the error I am getting inside telnet:

/bin/sh: Can't open

The file is there, the path is right, everything seems like it should work. That error isn't very helpful.

Any ideas?

(Thanks for the help, BTW!)
bww0426
DD-WRT Novice


Joined: 21 May 2008
Posts: 2

PostPosted: Thu May 29, 2008 9:37    Post subject: Reply with quote
I got a wired problem...I follow the instruction..and everything works fine...but I got confused about that whether the xxx.cgi file ran in browser would be downloaded or just shown in browser??
iJAF
DD-WRT Novice


Joined: 09 Jun 2008
Posts: 6

PostPosted: Mon Jun 09, 2008 16:29    Post subject: Reply with quote
Hi, in my fonera i have done the commands :

killall httpd
httpd -p 81 -h /www
httpd -h /jffs


I could acess the configs page all fine at port 81
I put my index.htm in /jffs and it works fine

My goal is to have a cgi running called form that index.htm.

I mkdir /jffs/cgi-bin, put my cgi.cgi inside it and:

chmod +rwx /jffs/cgi-bin/cgi.cgi

But the cgi don't work, any ideas ??
Embarassed urgent Shocked

thanks

EDIT: running v24 RC6
Goto page 1, 2  Next Display posts from previous:    Page 1 of 2
Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum