Web Server in GL-MT300N

We are interested in using MT300N as a web server for a personal cloud not linked to internet. We are a small church and would like to share our books for local investigators. The idea is to hold web pages in the local USB or microUSB devices and be able to access them from a tablet or PC and surf thru them via wifi. We have the device and tried it but it seems it just allows to download the files and not to surf thru them like we were expecting. We would not people accessing the device and getting the books at all so that should be forbidden, just to surf thru them.

We don’t know too much about linux so if it is possible would appreciate detailed instructions if it is possible what we want to do.

The pages are html and I think javascript like we attach at the end of the message. If it works we would get some of them to use in our different places. It is just different folders with one book with its pages in jpg in each one.

Thanks in advance.

<p align=“center”>Inici|Anterior|1 2 3 4 5 6 </p>

<center>

<table border=“2” cellpadding=“0” cellspacing=“0”>

<tr>

<td valign=“middle” align=“center” width=“25%”><table align=“center” border=“0” cellspacing=“2”><tr><td height=“422” valign=“middle” align=“center”>

O13-181_1.jpg</td>

how did you configure that? I think it should be very simple.

First, mount your usb disk,

then, make a symbol link to www folder, e.g. ln -s /mnt/mydisk/ /www/mydisk

now you can access the pages from http://192.168.8.1/bible/

You can also use a simple resolve name for 192.168.8.1, e.g. http://bible.me/bible, in order to do this, add “bible.me” in the router’s /etc/resolv.conf

1 Like

Thanks for the answer. It sounds promising.

We were surfing the net and finally and after getting a Putty ssh client We could try the solution and it seems working great. What We did was to enter in server thru Putty and type:

ln -s /mnt/KINGSTON/WEB /www/web

after it, going to browser and typing

http://192.168.8.1/web/index,html

we could enter in the pages as expected.

The problem is that those changes don’t remain, being temporary and we dont know how to do them permanent. We guess is some way to edit the internal files and doing it but we dont know how. Also We would like in the case it was possible that after entering in the Wifi it was going directly to our main page not typing the 192.168.8.1/web/index.html could it be possible not losing the ability to enter to the config main pages of server?

thanks in advance for your support.

 

You should already set up a password for the router now. You need SSH to the router. If you are in windows, you can use putty, downloadable from putty , if you use Mac or Linux, you could use ssh in the command line.

ssh root@192.168.8.1

After you ssh to the system, make a link, using

ln -s /mnt/KINGSTON/WEB/ /www/bible

then you can access via http://192.168.8.1:/bible

1 Like

Hello again

After reading a lot we did 2 changes thru WINSCP software:

We added in etc\rc.local

ln -s /mnt/KINGSTON/BOOKS //www/books &

to install automatically the USB

and in resolv.conf

web 192.168.8.1

in order to be able to connect in browser with

http://web/books/index.html

Didn’t find any easier way even we found some difficulties accesing from some phones but solved theirself after awhile.

We are very happy with results and we are going to buy 3 more devices.

we have a question about temperature, It seems the device becomes hot after some time, the same with the USB device.

We are wondering if it is any difference using microSD instead of USB to reduce it. Is it the same?

Thanks again and we are very satisfied with the device.

I am glad that it is working for you.

GL-MT300N is actually low power consuming and is not too hot. If it can be touch by hand it should be OK. MT300N also don’t have a MicroSD card inside. The modem with MicroSD card inside is GL-MT300A. But it will be even hotter.

Maybe you can install a captive portal so that when users connect to the wifi, the page http://web/books/index.html will pop up automatically. I don’t know how to config it though.

Thanks for the answer and to point us to that “Captive portal” idea. We will work on it and see if we are able to find the way.

You can try nodogsplash

We tried that nodogsplash.

1st We upgraded device from 2.19 to new 2.22 firmware

We tried to install the package from luci and got an error 255.

We removed it and installed again from Putty. This time we got no errors and started it

We went to Log in to Luci web interface to make sure the nodogsplash was started.

System->Startup

Look for nodogsplash

And it showed Enable under “Enable/Disable” column

So it seemed it was installed and running, but we couldnt find any difference in the behavior of the device and we couldnt get the nodogsplash page.

Using “/usr/bin/ndsctl status” to check if it was up was not running saying it was not found.

After reading a lot we disabled firewall:
/etc/init.d/firewall stop
/etc/init.d/firewall disable

but nothing changed. We also tried
starting http server

/etc/init.d/uhttpd enable

/etc/init.d/uhttpd start

but it said that couldnt find those files.

So we think that we will leave it like it was and teach our users to type the http:192.168.8.1 /… line to acces books because we couldn’t make resolv.conf working either after the 1st successful try and rebooting the device. It seems it is a lot to learn.

If anybody know about it, ok and if not, we are happy with what we got for now.

thanks a lot for the support

https://piratebox.cc/

y0u can take a look here, i´m sure its possible to create a image for the mt300n aswell

Thanks for the info.

Actually we are very happy with the software and functions of the device. In fact we are able to run it without installing and running any other software, just with the configuration pages that it is coming with. We played with some things with Putty and WinSCP but finally we decided to keep it easy. We just had to find the right place to mount the USB device than finally we found in advanced - System - Startup. With that , it makes it very easy to give instructions to people that will run them. Actually we have one MT300N and 3 MT300A coming. Is amazing that we dont have even to connect any network cable to it and everything can be done wireless. So simple and great.

thanks to everyone helping.

@xcn, I think you checked Nodogsplash [Old OpenWrt Wiki]

Actually most configurations is ready. You can just install nodogsplash, disable firewall and config it with /etc/config/nodogsplash

I think the splashpage is the correct place to setup. Not tested.

option splashpage “/books/index.html”

There is several other options you need to check: webroot, pagesdir, imagedir, redirecturl,

I have no idea of how this relates to the default web server.

 

I found this thread fairly useful. Thanks. I managed to get an MT300N v2 and configure so that now I can connect to WiFi and access http://192.168.8.1/web/index.html

Doing that and up pops the mini website installed on the flash drive.

What I’d really like to do is have the web/index.html load automatically after connecting to the WiFi.

Sadly I’m struggling to find clarity in the various posts and suggestions. I took a look at LibraryBox and Pirate Box but both talk about having to load firmware but I see nothing for the MT300N v2

I also hoped that the reference to NoDogSplash might be informative but that appears to be a means of offering a WiFi hotspot to visitors rather than creating a mini web server.

The lack of documentation for these non-standard uses for the MT300N is understandable but a pointer to where help might be found would be really useful.

I wonder if @xcn got anywhere with this project. Your experimentation seemed to be attempting to achieve just what we have in mind for similar requirements.

Andrew

 

Hi,

Yes, I did something about it but I COULD NOT achieve to start automatically the page after connect the Wifi.

That I have working is that after connected to wifi, starting the browser, typing ANY url that is NOT https:// then it goes to the page that the nodogsplash says.

Steps,

Run Putty and go to 192.168.8.1 and enter root user and password

opkg update
opkg install nodogsplash
/etc/init.d/firewall stop
/etc/init.d/firewall disable

Then you have to update /etc/nodogsplash/nodogsplash.conf and add a redirect to your main page:
option redirecturl ‘http://192.168.8.1/…’ <<<< Your main page

You can also update the splash page and add the redirect there I think:
\etc\nodogsplash\htdocs\splash.html

I hope it helps. If you find the way to start directly the browser with the page you want, let me know it, please.

Xav

Thanks Xav.

I’ll give this a go and see where it takes me…

 

Thanks @xcn for this extra set of insights. The server works with NoDogSplash as expected.

As with most captive portal set ups the mini-web server does not automatically load the server login page. In NoDogSplash this is splash.html

Mobile devices will sometimes force a log-in/connection but PCs will typically only connect when an attempt is made to access any real world http:// (not https://) URL.

In NoDogSplash it is perfectly in order to configure a personalised splash.html provided that the relevant code is included in the page. I edited and improved the default with my own theme and images but otherwise left the underlying HTML untouched. Seems to work just fine.

So for access by a passing mobile device everything works as I would like. Generally visitors see my splash.html which includes a brief explanation of what is being offered and links to the documents stored on the flash drive.

I’m working on writing up the stages I’ve followed and I’ll paste them here for others to try out.

 

agsteele

I am glad it worked for you too. I also have personalized the splash.html before enter to the pages stored in the USB. We have those devices, actually 4, working daily for more than 1 year now and we are very satisfied with them.

xcn