Community discussions

MikroTik App
 
User avatar
dallas
Long time Member
Long time Member
Topic Author
Posts: 548
Joined: Wed Dec 13, 2006 4:13 am
Location: Minnesota
Contact:

Small Web Server on RouterOS, please.

Fri Sep 23, 2011 9:56 pm

I want to very basic website on every CPE so if the internet is offline to display a troubleshooting page or what else I would like to display. Greatly appreciated if this could be a feature in 6.x.
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Re: Small Web Server on RouterOS, please.

Fri Sep 23, 2011 10:00 pm

Install the Hotspot feature. Edit the login.html shown to users when they aren't authenticated to show whatever you want it to show. Use scripts to turn on the Hotspot when the CPE is offline, and turn it back off when it comes back online.
 
User avatar
dallas
Long time Member
Long time Member
Topic Author
Posts: 548
Joined: Wed Dec 13, 2006 4:13 am
Location: Minnesota
Contact:

Re: Small Web Server on RouterOS, please.

Fri Sep 23, 2011 10:05 pm

Yeah that works but I think thats a work around. I was looking for Mikrotik to implement the feature the way I think it should be done. Thanks for your reply.
 
jandafields
Forum Guru
Forum Guru
Posts: 1515
Joined: Mon Sep 19, 2005 6:12 pm

Re: Small Web Server on RouterOS, please.

Sat Sep 24, 2011 5:01 am

I seriously doubt they will ever put a webserver into their router. As long as your own network is up, you could redirect clients to your own webserver.

The hotspot idea is not a bad idea at all... regardless of being a "workaround", once you get it working the way you want it to, just set it, copy it, and forget it.

Even with a webserver, it won't help in situations like computer virus, bad computer settings, unplugged cable, bad Mikrotik power supply, etc, etc, etc....

If a customer's computer is in good enough condition to get TO the website on the routerboard, but cannot get internet through it... what possible troubleshooting tips can you give them? It's most likely a problem beyond their control if they can get a website to pull up from the routerboard, but not from beyond that...
 
User avatar
dallas
Long time Member
Long time Member
Topic Author
Posts: 548
Joined: Wed Dec 13, 2006 4:13 am
Location: Minnesota
Contact:

Re: Small Web Server on RouterOS, please.

Sat Sep 24, 2011 8:14 am

I will just keep hoping.
 
Sob
Forum Guru
Forum Guru
Posts: 9121
Joined: Mon Apr 20, 2009 9:11 pm

Re: Small Web Server on RouterOS, please.

Wed Sep 28, 2011 4:55 am

I seriously doubt they will ever put a webserver into their router.
They don't have to, it's already there. ;) All that's needed is to add one simple No thanks, I don't want RouterOS default webpage, just serve files from my directory please checkbox to WinBox.
As long as your own network is up, you could redirect clients to your own webserver.
The device may be as well CPE unit, i.e. when the connection fails, it doesn't have access anywhere, except to customer's own network.
If a customer's computer is in good enough condition to get TO the website on the routerboard, but cannot get internet through it... what possible troubleshooting tips can you give them?
"Please don't panic, we have good monitoring and someone is probably already working on fixing your problem." / "If you see this page for more than two weeks, please give us a call at 123456789 if you want to see any other page ever again" / etc...
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Small Web Server on RouterOS, please.

Wed Sep 28, 2011 5:20 am

It isn't quite that simple. You need to recognize that the CPE is down. Then you need to redirect all DNS to it so it can serve as a resolver, and it needs to resolve all requests to itself via a wild card. Then it needs to either have a proxy that really listens to the request and instead fetches your local page, or needs to have a specialized web server that can answer any request - after all people are unlikely to specifically ask for your error page.

You can do all that already with the built in tools, combined with a Hotspot. You're asking for a check box that combines all those steps into one. Fair enough, if they want to implement that more power to you. Personally I'd argue that RouterOS is powerful precisely because it doesn't have "click here and all kinds of magic happens" checkboxes. This problem is solvable more or less right now already, but you'll have to build it together from the bits and pieces.

Edit: just to be more explicit - what you're asking for already exists in RouterOS. Whatever solution Mikrotik comes up with would have to recognize failure, then perform DNS redirects and reply spoofing, and then perform HTTP inspection and rewriting, and finally - after convincing the client that it really wants to see your error page instead of what it asked for - serve error page. That is more or less the definition of scripts enabling DNS NAT, DNS wildcards, and a Hotspot. You are just calling it a workaround because it's not a one click solution, but whatever one click solution anyone would come up with internally would work exactly like wildcard DNS and Hotspots already do. Alternatively instead of the Hotspot you could use a proxy with a deny all rule redirecting - but that is exactly what a Hotspot does to unauthenticated users.

No skin off my nose if you implement that, but maybe it'll be of use to someone else reading this thread.
 
Sob
Forum Guru
Forum Guru
Posts: 9121
Joined: Mon Apr 20, 2009 9:11 pm

Re: Small Web Server on RouterOS, please.

Wed Sep 28, 2011 6:05 am

Well, for my part I have to admit that I should have stopped after first paragraph, with rest I went too far without thinking it through.

I just wanted to say that if there's already webserver running on RouterOS, there's no good reason to deny user to use it for his own files too. They may be some static files for download if separate server would be overkill. Or something useful generated by RouterOS scripting. Anything...

And btw, if someone really needs it, they can already boot some Linux and create one right symlink. It's just unnecessary extra work. I once tried to get access to Dude-generated map images this way and it almost worked, it was ruined only by files being owned by root and having 0600 permissions.
 
User avatar
dallas
Long time Member
Long time Member
Topic Author
Posts: 548
Joined: Wed Dec 13, 2006 4:13 am
Location: Minnesota
Contact:

Re: Small Web Server on RouterOS, please.

Wed Sep 28, 2011 5:03 pm

I seriously doubt they will ever put a webserver into their router.
They don't have to, it's already there. ;) All that's needed is to add one simple No thanks, I don't want RouterOS default webpage, just serve files from my directory please checkbox to WinBox.
As long as your own network is up, you could redirect clients to your own webserver.
The device may be as well CPE unit, i.e. when the connection fails, it doesn't have access anywhere, except to customer's own network.
If a customer's computer is in good enough condition to get TO the website on the routerboard, but cannot get internet through it... what possible troubleshooting tips can you give them?
"Please don't panic, we have good monitoring and someone is probably already working on fixing your problem." / "If you see this page for more than two weeks, please give us a call at 123456789 if you want to see any other page ever again" / etc...
heheh, thanks that was great. I want to have website to show customers how to troubleshoot their connection.
 
User avatar
dallas
Long time Member
Long time Member
Topic Author
Posts: 548
Joined: Wed Dec 13, 2006 4:13 am
Location: Minnesota
Contact:

Re: Small Web Server on RouterOS, please.

Wed Sep 28, 2011 5:05 pm

It isn't quite that simple. You need to recognize that the CPE is down. Then you need to redirect all DNS to it so it can serve as a resolver, and it needs to resolve all requests to itself via a wild card. Then it needs to either have a proxy that really listens to the request and instead fetches your local page, or needs to have a specialized web server that can answer any request - after all people are unlikely to specifically ask for your error page.

You can do all that already with the built in tools, combined with a Hotspot. You're asking for a check box that combines all those steps into one. Fair enough, if they want to implement that more power to you. Personally I'd argue that RouterOS is powerful precisely because it doesn't have "click here and all kinds of magic happens" checkboxes. This problem is solvable more or less right now already, but you'll have to build it together from the bits and pieces.

Edit: just to be more explicit - what you're asking for already exists in RouterOS. Whatever solution Mikrotik comes up with would have to recognize failure, then perform DNS redirects and reply spoofing, and then perform HTTP inspection and rewriting, and finally - after convincing the client that it really wants to see your error page instead of what it asked for - serve error page. That is more or less the definition of scripts enabling DNS NAT, DNS wildcards, and a Hotspot. You are just calling it a workaround because it's not a one click solution, but whatever one click solution anyone would come up with internally would work exactly like wildcard DNS and Hotspots already do. Alternatively instead of the Hotspot you could use a proxy with a deny all rule redirecting - but that is exactly what a Hotspot does to unauthenticated users.

No skin off my nose if you implement that, but maybe it'll be of use to someone else reading this thread.
I did complete everything for the page to be displayed. The only thing I cant do it display my webpage instead of a default mikrotik page of login.html. I want to have my own page.html.
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Re: Small Web Server on RouterOS, please.

Wed Sep 28, 2011 5:27 pm

What's the difference between displaying myownpage.html and login.html when you can edit login.html and put the content of myownpage.html into it?

But if that's your last hang up replace the content of the stock login.html with this:
<html><head><meta http-equiv="refresh" content="0; url=myownpage.html"></head></html>
That will issue a final redirect to the client and show myownpage.html, which you'll have to upload to the Hotspot directory.
 
User avatar
dallas
Long time Member
Long time Member
Topic Author
Posts: 548
Joined: Wed Dec 13, 2006 4:13 am
Location: Minnesota
Contact:

Re: Small Web Server on RouterOS, please.

Wed Sep 28, 2011 7:16 pm

Thanks for the input. I know we can do this. I was just hoping I could get mikrotik to do this without a workaround. Thanks again. Anyone else have any uses for this standalone feature?
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 26381
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia

Re: Small Web Server on RouterOS, please.

Thu Sep 29, 2011 8:27 am

It's not a workaround, it's completely standard behavior. Apache also defaults to index.html, and if you want to show another page as the first one, you make a redirect.
 
User avatar
dallas
Long time Member
Long time Member
Topic Author
Posts: 548
Joined: Wed Dec 13, 2006 4:13 am
Location: Minnesota
Contact:

Re: Small Web Server on RouterOS, please.

Fri Sep 30, 2011 5:05 pm

ok thanks
 
User avatar
dallas
Long time Member
Long time Member
Topic Author
Posts: 548
Joined: Wed Dec 13, 2006 4:13 am
Location: Minnesota
Contact:

Re: Small Web Server on RouterOS, please.

Mon Oct 03, 2011 10:22 pm

When a customer has no internet. I would like to use a firewall rule to redirect customers to a webproxy. The webproxy will redirect the customer to the small webserver with a custom ste.html. I would not like to use a hotspot. Is this possible?
 
User avatar
NetworkPro
Forum Guru
Forum Guru
Posts: 1376
Joined: Mon Jan 05, 2009 6:23 pm
Location: bit.ly/the-qos
Contact:

Re: Small Web Server on RouterOS, please.

Tue Nov 29, 2011 9:35 pm

This is a feature asked for many times and not taken on but seriously, in WISP business the above described simple scenario is a must. How hard could it be? Using HotSpot for workaround puts unnecessary overhead on the configuration and traffic flow.

MikroTik, I truly believe that the proper way to go is to have a tiny web server. I know you have Wireless and routing and security and x86 compatibility to take care of, so you may work on the tiny web server after those.
 
jandafields
Forum Guru
Forum Guru
Posts: 1515
Joined: Mon Sep 19, 2005 6:12 pm

Re: Small Web Server on RouterOS, please.

Tue Nov 29, 2011 9:43 pm

I still say that if a customer can access a website on the CPE, but can't get past the CPE... then it is the ISP that has a problem, not the customer... and therefore nothing for the customer to troubleshoot.

If the ISP network is up, but the ISP's upstream is down, you can put a webserver on your network and redirect all traffic to a page on that webserver.

As for the person that wrote "please call if you see this error message for more than 2 weeks, then call us...", what kind of ISP tells their customers to wait TWO WEEKS before calling in about internet problems?!?!?
 
User avatar
otgooneo
Trainer
Trainer
Posts: 581
Joined: Tue Dec 01, 2009 3:24 am
Location: Mongolia
Contact:

Re: Small Web Server on RouterOS, please.

Thu Dec 01, 2011 8:41 am

I want to very basic website on every CPE so if the internet is offline to display a troubleshooting page or what else I would like to display. Greatly appreciated if this could be a feature in 6.x.
I agree with dallas.
 
User avatar
stmx38
Long time Member
Long time Member
Posts: 618
Joined: Thu Feb 14, 2008 4:03 pm
Location: Moldova, Chisinau

Re: Small Web Server on RouterOS, please.

Sat Apr 14, 2012 11:27 pm

Very nice idea.
This can be a separate package.
I think it will be more useful then samba ;)
 
mindragon
newbie
Posts: 28
Joined: Tue Apr 20, 2010 5:50 pm

Re: Small Web Server on RouterOS, please.

Sun Apr 15, 2012 6:44 pm

Isn't something like this possible with Metarouter / OpenWRT / Apache?

In any case...I think most folks want the router to be a secure router and not a hackable web server...

MD
 
User avatar
stmx38
Long time Member
Long time Member
Posts: 618
Joined: Thu Feb 14, 2008 4:03 pm
Location: Moldova, Chisinau

Re: Small Web Server on RouterOS, please.

Mon Apr 16, 2012 8:30 am

mindragon
I think most folks want the router to be a secure router and not a hackable web server...
1. Hotspot is based on web server - as you told if you use it your router is hackable web server, right ?
2. It can be an optional package - should be installed manually or can be enabled manualy - like samba.
3. Samba integrated in the router is a more secure than web server ?
 
wpeople
Member
Member
Posts: 380
Joined: Sat May 26, 2007 6:36 pm

Re: Small Web Server on RouterOS, please.

Mon Apr 16, 2012 10:50 am

3) Agree - if you go for security, you should disable everything than enable what's needed.

However, if you need to display a webpage, a very basic httpd (preferably one-way only) would do the job.
 
herschel
just joined
Posts: 15
Joined: Sat Nov 12, 2011 7:56 am
Location: NYC

Re: Small Web Server on RouterOS, please.

Mon Apr 16, 2012 4:15 pm

Web server can be used to host browser-based performance tests, which are extremely useful.
 
Sob
Forum Guru
Forum Guru
Posts: 9121
Joined: Mon Apr 20, 2009 9:11 pm

Re: Small Web Server on RouterOS, please.

Mon Apr 16, 2012 7:59 pm

The main problem I see with web server on ROS is what exactly it should be able to do. Because I'm pretty sure that whatever feature MikroTik adds, the first reaction will always be "yeah, cool, but you should also add feature *****". And it won't stop until ROS contains full-blown Apache clone. But is that good reason to rather not add anything at all? Remember, there is webserver running on ROS already.

So for example, simple "I just want to make few files available via http" scenario, it is already possible now with some "light hacking". Just access ROS disk some way (extremely easy for x86, little harder for RB), create directory /rw/pckg/web and make symlink /home/web/user pointing to it. And voila, any file you put in files/web subdirectory is accessible under http://<your ROS IP>/user/. You can just put some static files there for download. But you can also generate files using ROS scripting, surely that could be useful for something. Could it hurt anyone if ROS included something like this by default? I don't think so. And it could make some people happy.

Of course then comes that "cool, but ..." thing. It's just subdirectory, no one wants to type that. And virtual hosts would be nice. And if http request could actually execute some script. Etc... But it's just a matter of deciding what can be solved easily without any side effects and what would be too much.
 
wpeople
Member
Member
Posts: 380
Joined: Sat May 26, 2007 6:36 pm

Re: Small Web Server on RouterOS, please.

Wed Apr 18, 2012 10:33 am

probably yes, it possible.
However, I think this violates the software usage (modifying the storage in unwanted way), and i don't think its possible on already installed CPE - remotely.
i would welcome a solution, if i create a folder on the ROS device like "public" it would be accessible via http like http://device/public/

it definitely needs no more modification in config than an "alias"
that would solve everything.
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 26381
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia

Re: Small Web Server on RouterOS, please.

Wed Apr 18, 2012 10:34 am

you can do all of that with the Branding package, or with Hotspot.
 
User avatar
stmx38
Long time Member
Long time Member
Posts: 618
Joined: Thu Feb 14, 2008 4:03 pm
Location: Moldova, Chisinau

Re: Small Web Server on RouterOS, please.

Wed Apr 18, 2012 1:26 pm

normis
What is a Branding package ?
 
User avatar
otgooneo
Trainer
Trainer
Posts: 581
Joined: Tue Dec 01, 2009 3:24 am
Location: Mongolia
Contact:

Re: Small Web Server on RouterOS, please.

Wed Apr 18, 2012 4:48 pm

Hi Normis, Branding package is only for distributors?
 
mindragon
newbie
Posts: 28
Joined: Tue Apr 20, 2010 5:50 pm

Re: Small Web Server on RouterOS, please.

Wed Apr 18, 2012 5:54 pm

mindragon
I think most folks want the router to be a secure router and not a hackable web server...
1. Hotspot is based on web server - as you told if you use it your router is hackable web server, right ?
But the hotspot is an HTML-based system with very limited scripting capability. Compare this to Apache that can serve up PHP, Perl, Java and so much more. Each of those elements broadens the amount of hackable items.
3. Samba integrated in the router is a more secure than web server ?
By default, Samba is off... I don't ever plan on turning this on. If MT ever introduces Apache into the core, I don't ever plan on turning that on either. As it is, I already leave everything off except for Winbox.
 
User avatar
stmx38
Long time Member
Long time Member
Posts: 618
Joined: Thu Feb 14, 2008 4:03 pm
Location: Moldova, Chisinau

Re: Small Web Server on RouterOS, please.

Thu Apr 19, 2012 9:07 am

mindragon
I think most folks want the router to be a secure router and not a hackable web server...
1. Hotspot is based on web server - as you told if you use it your router is hackable web server, right ?
But the hotspot is an HTML-based system with very limited scripting capability. Compare this to Apache that can serve up PHP, Perl, Java and so much more. Each of those elements broadens the amount of hackable items.
3. Samba integrated in the router is a more secure than web server ?
By default, Samba is off... I don't ever plan on turning this on. If MT ever introduces Apache into the core, I don't ever plan on turning that on either. As it is, I already leave everything off except for Winbox.
1. See the first post - "I want to very basic website."
What Java, Perl, Php ? About Apache in this topic wrote only you, normis and Sob. Not author of topic or me.
2. Web server also can be turned off by default.
 
nosovk
Frequent Visitor
Frequent Visitor
Posts: 63
Joined: Wed Jan 25, 2012 11:25 am
Location: Ukraine
Contact:

Re: Small Web Server on RouterOS, please.

Sat Jul 07, 2012 1:25 am

It's inaf Hotspot functionality for very basic web site. Dont't do server functionality on a router, don't do torrents on it.
Better make routing things, like: wins support, Ethernet support for GRE etc.
 
User avatar
MForooghii
just joined
Posts: 17
Joined: Thu Mar 01, 2012 6:57 am

Re: Small Web Server on RouterOS, please.

Sat Aug 11, 2012 7:40 am

hi friends
if a distributors can create a package for users we can use this feather easily
please see here: http://forum.mikrotik.com/viewtopic.php?f=10&t=47555
 
rzirzi
Member
Member
Posts: 393
Joined: Mon Oct 09, 2006 2:33 pm

Re: Small Web Server on RouterOS, please.

Wed Aug 15, 2012 6:09 pm

I have posted the same request at thread: "Simple http server":

SMB feature is great, but it should be possibility to download files just from http from MikroTik server.
So - it should be simple http server that would share files uploaded with SMB.
MikroTik team - could You add this feature to MT6.x please?

Who is online

Users browsing this forum: Amazon [Bot] and 126 guests