How to create a single/simple page on Tomato

Discussion in 'Tomato Firmware' started by jbcdidgosir, Apr 25, 2013.

  1. jbcdidgosir

    jbcdidgosir Serious Server Member

    My router is WRT54GS with toasterman. Sometimes I want to publish some links to my friends. But it's very difficult for them to access these links because the length of links are very very long.

    Now I have a requirement that I want to create a single/simple page on router so that I can paste these long links on this page. My domain name is very short. So that they are easy to access. Then they can click the long links on my web page.

    I found several solutions on the different forum. But the problem is that my router has no USB port. So impossible to extend the memory. Also JFFS has only 800KB sizes remain. So is it possible to create this page? Thanks!
  2. Elfew

    Elfew Network Guru Member

    I dont know if it is possible with your wrt54gs... but Victek will release new build in the following days with integrated webserver with nice GUI
  3. jbcdidgosir

    jbcdidgosir Serious Server Member

    Is he the author of toasterman?
  4. philess

    philess Networkin' Nut Member

    No, Victek is the author of Victek mod. And Toastman is the author of Toastman mod.

    Definitely wont be easy with such little space on your router. Does your firmware have
    the www/ext folder? Try putting a links.html in there and then access it by
    http://your.router.ip/ext/links.html But that would require to open port80 of the WebUI
    to the WAN so your friends can access that html. I think the easiest way in your case
    would be to put the .html in a Dropbox folder, share the link with your friends.
    Dropbox acts as your webserver then.
  5. Elfew

    Elfew Network Guru Member

    If you dont any experience with this, use dropbox... Your router has low memory and I think you should use it only for internet access...

    Register at dropbox and easily share your stuff
  6. jbcdidgosir

    jbcdidgosir Serious Server Member

    This router doesn't have USB port. So ext is not available. But I have mounted a folder "/opt". I put web.html page in this folder and try accessing it by http://mydomain/opt/web.html . But it doesn't work. I'm sure that 80 port on WAN has been opened because now I have a solution to solve this problem. That is the executed by python.
    import socket
    import time
    while True:
    clientsock.send("HTTP/1.1 200 OK\r\nContent-Length: 1000\r\n\r\n<html><title>Welcome!</title><br><br><body lang=ZH-CN link=blue vlink=purple style='tab-interval:21.0pt;text-justify-trim: punctuation'><p class=MsoNormal><span style='font-size:18.0pt;font-family:Arial'><a href=\"\">Test</span></p></body></html>")
    f=open("/opt/Web_log.txt", "a")
    f.write(time.strftime('%Y-%m-%d %H:%M:%S ',time.localtime(time.time()))+str(clientaddr)+"\n")
    Now it works when I accesss my domain from internet. But it will be a great trouble if I need to modify my web page. And the most serious problem is: Chinese character is not supported.

    So now the questions are:
    1. Is it workable if web.html is put in /opt to make it accessable from the internet? This is the best way because it's easy to modify the web page. Also Chinese character is supported.
    2. For python solution, how to send Chinese characters?

    Thank you very much!
  7. Victek

    Victek Network Guru Member

    You need a more stable solution.. but related to long names link and chinesse characters use it? ... and then paste in your html...
  8. jbcdidgosir

    jbcdidgosir Serious Server Member

    Oh, it's a very good web site. But it seems that the last section are the combination of number and letters. Also some ones are capital letters. If lower case is used, the link will be unavailable. That's why I want to create a web site of my own. Because though my original link is not long and contains no Chinese character, but it also contain numbers and letters, also some ones are capital letters.

    Now I just want to make my web site page contains Chinese character. So the frame sent by python server must contain Chinese character. (e.g.><a href=\"\">中文测试</span></p>) But error reports when Chinese character is used.

    Thank you all the same!
  9. Victek

    Victek Network Guru Member

    ok, then ... wait till nginx with nodog will be available and then you can create your own server ... Chinese characters allowed ... ;) one-two weeks delay.

  10. jbcdidgosir

    jbcdidgosir Serious Server Member

    Really? What is nginx? Is it a new FW based on toastman?
  11. darkknight93

    darkknight93 Networkin' Nut Member

    nginx is a webserver package ;) so Software you can install and run on your router
  12. Victek

    Victek Network Guru Member

    nginx = wikipedia .. google ... ;)

    At the beginning (some year ago) Toastman and I started customized firmware from original Tomato, later improved by TomatoUSB trunk, at the present major base is still TomatoUSB but Toastman addressed his version to QoS improvement. Shibby addressed to transmission and other packages and Tomato RAF addressed to features as network hub, VoIP, SIP, Web Server, Captive portal... (read in About page of Tomato firmware to see other mod contributions).

    But you can find it in any version, the features created by other mod can be used in any version since repository is public access and instructions to build are documented.

    Elfew likes this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice