Community discussions

MikroTik App
 
Zapnologica
Long time Member
Long time Member
Topic Author
Posts: 594
Joined: Fri Sep 25, 2009 8:15 pm
Location: South frica

Web server on mikrotik

Fri Jul 23, 2010 12:26 am

How can i setup a web server on Mikrotik router.

I want to upload the html files and then be able to acces the website.

like how u go. 192.168.1.1/userman

i wana go 192.168.1.1/forum or /site and it must load my site

Can i do this? Im sure its possible. if it does it for hotspot.
 
adrianatkins
Long time Member
Long time Member
Posts: 556
Joined: Wed Sep 05, 2007 10:34 am
Location: Spain
Contact:

Re: Web server on mikrotik

Fri Jul 23, 2010 1:28 am

Look Zapa: It's a router.
How much do you want it to do ?

More important : how much will you pay ?

If you want a Web Server, get a PC or Single board equivalent, like ALIX.
Install Linux.
Install Apache (probably came with Linux)

Mikrotik is about Routers currently, although they seem to have some idea about Switches too.

You *can* do what you want with a routerboard, but it depends on the toad, and what you are prepared to sacrifice.
 
Zapnologica
Long time Member
Long time Member
Topic Author
Posts: 594
Joined: Fri Sep 25, 2009 8:15 pm
Location: South frica

Re: Web server on mikrotik

Fri Jul 23, 2010 7:19 am

Look Zapa: It's a router.
How much do you want it to do ?.
AS much as it possibly can!
This is not just a router, Its a mikrotik one, they do every thing[*]
More important : how much will you pay ?
Nothing, thats why i want to do it on the mikrotik that i currently have, Yes you can just get apache but then u need a computer and its gona run the whole time. If possible why not just have it on your mikrotik, It makes more sense in regards to reliability, cost and power consumption.


I just thought that if it does it for hotspot it could be done for some thing else. Upload the files to File manager then create a firewaall rule and it should just work...
 
leonset
Member Candidate
Member Candidate
Posts: 256
Joined: Wed Apr 01, 2009 9:09 pm

Re: Web server on mikrotik

Fri Jul 23, 2010 3:55 pm

I don't think you can serve much more than just static files and it won't support too many concurrent users, probably RouterOS isn't optimized to be used in that way. Also, I don't know if RouterOS license will allow you to do that.

Regards,
 
Zapnologica
Long time Member
Long time Member
Topic Author
Posts: 594
Joined: Fri Sep 25, 2009 8:15 pm
Location: South frica

Re: Web server on mikrotik

Fri Jul 23, 2010 5:06 pm

Yea it will probably only support HTML.

but if it can be done with hot spot. it should be doable ?
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Re: Web server on mikrotik

Fri Jul 23, 2010 5:14 pm

The short answer: no.
 
adrianatkins
Long time Member
Long time Member
Posts: 556
Joined: Wed Sep 05, 2007 10:34 am
Location: Spain
Contact:

Re: Web server on mikrotik

Fri Jul 23, 2010 8:34 pm

slightly longer answer: maybe

try installing a metarouter with an Openwrt image and see if you can get somthing like lighttpd running.

if you can, it supports PHP through the FastCGI hook.
 
adrianatkins
Long time Member
Long time Member
Posts: 556
Joined: Wed Sep 05, 2007 10:34 am
Location: Spain
Contact:

Re: Web server on mikrotik

Sat Jul 24, 2010 11:59 pm

If you want Cheap, Free and Easy all in the same box, please let me know when you stumble across the Holy Grail.

Unfortunately (?) those three tend not to come together.
 
Zapnologica
Long time Member
Long time Member
Topic Author
Posts: 594
Joined: Fri Sep 25, 2009 8:15 pm
Location: South frica

Re: Web server on mikrotik

Mon Jul 26, 2010 12:48 am

The short answer: no.

That sucks.
 
adrianatkins
Long time Member
Long time Member
Posts: 556
Joined: Wed Sep 05, 2007 10:34 am
Location: Spain
Contact:

Re: Web server on mikrotik

Tue Jul 27, 2010 2:12 am

That sucks.
did you try the otyher one ?
slightly longer answer: maybe
 
Zapnologica
Long time Member
Long time Member
Topic Author
Posts: 594
Joined: Fri Sep 25, 2009 8:15 pm
Location: South frica

Re: Web server on mikrotik

Tue Jul 27, 2010 7:37 am

yea, i know how to do it on a pc.

I just though these mikrotik routers would be able to do it aswell. I think they should make a webserver function.

I meant they have ftp, web server for hot spot & userman,

Like im not talking huge forums running php with data base.


But it would be nice to store your ISP's technical documents and that on the router so you minimise international traffic.
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 26912
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia
Contact:

Re: Web server on mikrotik

Tue Jul 27, 2010 8:12 am

if you use hotspot, you do have access to the web files in the hotspot folder. I guess you can upload some PDFs there then
 
Zapnologica
Long time Member
Long time Member
Topic Author
Posts: 594
Joined: Fri Sep 25, 2009 8:15 pm
Location: South frica

Re: Web server on mikrotik

Tue Jul 27, 2010 7:21 pm

only if u using hotspot?

if MY users are using PPPoE >

Cant i create a folder under hotspot called. SUPPORT

Then under there put all my .pdf files.


Then they just go 192.168.1.1/support
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Re: Web server on mikrotik

Tue Jul 27, 2010 8:38 pm

No.
 
Zapnologica
Long time Member
Long time Member
Topic Author
Posts: 594
Joined: Fri Sep 25, 2009 8:15 pm
Location: South frica

Re: Web server on mikrotik

Tue Jul 27, 2010 10:33 pm

but with hot spot you can?
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Re: Web server on mikrotik

Tue Jul 27, 2010 11:35 pm

Yes.
 
adrianatkins
Long time Member
Long time Member
Posts: 556
Joined: Wed Sep 05, 2007 10:34 am
Location: Spain
Contact:

Re: Web server on mikrotik

Mon Aug 02, 2010 1:44 am

Did you try a MetaRouter using either the BusyBox httpd or lighthtpd ?

What did you get ?

MetaRouter is a Mikrotik virtual router thing, with an Image (e.g OpenWRT) running - not a PC.
 
adrianatkins
Long time Member
Long time Member
Posts: 556
Joined: Wed Sep 05, 2007 10:34 am
Location: Spain
Contact:

Re: Web server on mikrotik

Mon Aug 02, 2010 1:59 am

To be honest, i can't be bothered anymore. Fewi said the same in less words.

Your question is inane.

If you make money from what you do, you should be prepared to put something back into the infrastructure you maintain.

The idea of having a router/webserver/games server/web cache/dns cache/Asterisk server is just plain silly - especially when you buy a very resonable priced router.

What if that router gets busy ? Ditch the web server ? Keep the web server and ditch the Routing ?

The idea of messing about with a router for Months to save maybe 40 euros on, say, a UBNT RouterStation to act as a hardly-used web server is just not worth pursuing - especially whan you are making money from your reasonably priced routers.

Try asking the same question on the Cisco forum.
 
Zapnologica
Long time Member
Long time Member
Topic Author
Posts: 594
Joined: Fri Sep 25, 2009 8:15 pm
Location: South frica

Re: Web server on mikrotik

Mon Aug 02, 2010 5:41 pm

Can the ubnt powerstation be a web server?
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 26912
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia
Contact:

Re: Web server on mikrotik

Mon Aug 02, 2010 5:44 pm

RouterOS can have a web server if you use Metarouter functionality, to install a secondary OS as a virtual machine ( a metarouter )
 
Zapnologica
Long time Member
Long time Member
Topic Author
Posts: 594
Joined: Fri Sep 25, 2009 8:15 pm
Location: South frica

Re: Web server on mikrotik

Mon Aug 02, 2010 5:58 pm

Thanks,

I will do some reasearch on that,

Can u load any os on there? or only openWRT ?

Cause if u got a rb1000 that is powerfull.

And its not got hectic traffic on the webserver. why not use it?
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Re: Web server on mikrotik

Mon Aug 02, 2010 6:04 pm

What if that router gets busy ? Ditch the web server ? Keep the web server and ditch the Routing ?
That's why. Routers route. Web servers serve web pages. The two are fundamentally different functions and personally I like to keep fundamentally different functions on different devices, particularly if I make revenue from those functions. I'd rather spend $100 extra and keep things simple than save $100 and make things complicated. During outages and when troubleshooting a simple design is going to make me back that $100.

But whatever floats your boat. Good luck with Metarouter and learning whatever OS you install on there, as well as whatever web server you decide to use.
 
adrianatkins
Long time Member
Long time Member
Posts: 556
Joined: Wed Sep 05, 2007 10:34 am
Location: Spain
Contact:

Re: Web server on mikrotik

Tue Aug 03, 2010 12:45 pm

MetaRouter works.

Download the Openwrt image for your board from Mikrotik.

Stick it in Files

Add an interface for the metarouter

In MetaRouter import the image you put in files.

Start the metarouter.

click on Console.

vi /etc/config/network

edit this bit :

config interface lan
option ipaddr 192.168.100.202

to be the IP you want the Metarouter's interface to have.

cd /www

wget http://ip-address-of-web-server/file-you-want

... and it works.

You should can add a 'nameserver IP-address-of-a-DNS-server' to /etc/resolv.conf too, and also set a default route for the MetaRouter.
 
adrianatkins
Long time Member
Long time Member
Posts: 556
Joined: Wed Sep 05, 2007 10:34 am
Location: Spain
Contact:

Re: Web server on mikrotik

Fri Aug 06, 2010 1:07 am

Well ?

Can't you even be arsed to try it ?
 
Zapnologica
Long time Member
Long time Member
Topic Author
Posts: 594
Joined: Fri Sep 25, 2009 8:15 pm
Location: South frica

Re: Web server on mikrotik

Mon Aug 09, 2010 2:27 pm

Oh thanks for that.

it does not sound TOOOO complicated.

I will deff give it a try, i just need to get a rb that is am not using incase i stuff it up.

And to Fewi,

I see your logic and i tend to agree with you.

Lots of little devices. when one breaks only one servis goes down.

But when you say routers route and web servers server webpages. If i have a external webserver. Its data etc is still gona have to go through the router?
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Re: Web server on mikrotik

Mon Aug 09, 2010 4:37 pm

That depends on whether or not the router sits between the server and someone accessing the server.

PLEASE attend some training? Any training? Honestly I find it a little insulting that you ask questions like that and at the same time are charging people for network services you provide.
 
adrianatkins
Long time Member
Long time Member
Posts: 556
Joined: Wed Sep 05, 2007 10:34 am
Location: Spain
Contact:

Re: Web server on mikrotik

Mon Aug 09, 2010 8:05 pm

PLEASE attend some training? Any training?
I didn't :D
 
Zapnologica
Long time Member
Long time Member
Topic Author
Posts: 594
Joined: Fri Sep 25, 2009 8:15 pm
Location: South frica

Re: Web server on mikrotik

Mon Aug 09, 2010 8:33 pm

I would really love to. I hate asking all these dumb questions on the forum.

But im at school and all the courses are like a week long and i cant go to them?

And i was not asking you that cause i dindt know it, i was just check that my theory was right.

But i think its best that i just ditch this whole webserver on mikrotik idea. I thought it was a pretty good idea. But it kinda got shut down HARD.

I learn what i can by myself on the forums in my spare time.


SO FORGIVE ME FOR TYING!!!!
 
adrianatkins
Long time Member
Long time Member
Posts: 556
Joined: Wed Sep 05, 2007 10:34 am
Location: Spain
Contact:

Re: Web server on mikrotik

Mon Aug 09, 2010 9:48 pm

ditch this whole webserver on mikrotik idea
That'd work best.

The only reason you'd ever want to do it would to be to save some money.

In a 'real' environment, such a lightweight webserver wouldn't be used.

However, the MetaRouter + OpenwRT works as a webserver on a Mikrotik, as well as it doing the routing.
 
Zapnologica
Long time Member
Long time Member
Topic Author
Posts: 594
Joined: Fri Sep 25, 2009 8:15 pm
Location: South frica

Re: Web server on mikrotik

Mon Aug 09, 2010 9:58 pm

However, the MetaRouter + OpenwRT works as a webserver on a Mikrotik, as well as it doing the routing.
Thanks,

I will have a look at that.
 
Edified
newbie
Posts: 38
Joined: Thu Sep 16, 2010 9:02 am

Re: Web server on mikrotik

Sat Nov 27, 2010 10:54 am

What's up with all the "don't do that"s?

An RB450G is plenty powerful to do some simple routing and serve some simple webpages, DNS caching, Web Proxy etc. There's nothing particularly special about an RB router, it's just computer with a few extra doodads. Plus there's plenty of good applications, especially in situations where power is limited or should be conserved.

As far as different hardware for different tasks: that's insane. Most things are moving toward virtualization. Separating out the hardware if for people who either require the horsepower or people can't conceptualize how a network works without all the physical building blocks (also don't step on their lawn).

BTW, I agree that MetaRouter (ie Virtualization) is probably the right direction.
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 26912
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia
Contact:

Re: Web server on mikrotik

Mon Nov 29, 2010 2:35 pm

It's not about what you shouldn't do, but what you can't do (at least "out of the box"). When you say "router", you don't normally expect "php server".

There are ways to overcome this (metarouter), but by default there is no webserver, content filter or spam blocker.
 
nielsbos
just joined
Posts: 10
Joined: Thu Dec 15, 2011 9:45 pm

Re: Web server on mikrotik

Tue May 14, 2013 1:21 pm

A webserver is not such an "insane" idea as someone mentioned. If only for one very "routery" reason: You want to inform a user about a routing status or decision!

For example: We use Mikrotik on ships with a master and a backup connection. On the much slower backup, only core task on the internet are allowed. I use a web page (via the hotspot as a hack), to inform the user they are on the backup and cannot use the internet at the moment from non-core computers. This saves TONS of questions, irritations and confusion on board.

Same with P2P blockage. To be effective we block all traffic from and to a P2P user and redirect any HTTP to our own server to explain why they are blocked and how to resolve it (automatically freed 5 minutes after closing P2P software). Again, this makes the difference between may phone calls that the internet is not working, or none at all because the user understands what is going on.

Nearly all routers have such status pages, so why not custom ones? I can imagine a version that allows router scripts to run for you to generate HTML: We could show any system information we'd like (bandwidth, processor usage, users online, et cetera). Even better would be to support router login (router users) and support post back (html forms) to start scripts. We could create custom management for router aspects that non-administrators perform or simple ones for complex tasks you have to perform frequently. An example would be a very simple hotspot ticket management page that allows cashiers without specific knowledge to create and sell internet vouchers. Again, many routers have web management, so I cannot see the objection here.

If anyone at Mikrotik reads this: One vote up from me:)
 
ALIEN360
just joined
Posts: 4
Joined: Thu Dec 08, 2011 2:39 pm
Location: Sofia, Bulgaria

Re: Web server on mikrotik

Fri Sep 20, 2013 10:10 am

Hi there, I was intersed too in building some http service using for storage usb flash drive on my home RB2011UAS-2HnD.
I found some workaround using openwrt with samba and lighttpd packages on metarouter, and mounting the flash drive. The final result is working http server for small needs :)
 
User avatar
Kreacher
Member
Member
Posts: 359
Joined: Wed Sep 25, 2013 3:58 pm
Location: Hogwarts

Re: Web server on mikrotik

Thu Sep 26, 2013 5:37 pm

Hello,

my 2 cents on top of this!

In normal cases a router is routing packets from one to another or more networks.
In normal cases a firewall is separating networks, one from another or more.
But today those border are not so strange and they becoming more and more blurred.

That MikroTik is offering a Router that is able to let you inserting firewall rules on their router
is a very nice goal for the security options and a fine thing in my eyes and RouterOS is offering
many, many, many features, option and services for sure and sometimes peoples are thinking or
classifying a http proxy, webserver, ftpserver also inside this categories but in my eyes this is
false! Because normally you will have a very small surface or area that can be attacked by intruders
or plain called hackers and so this surface should be so small as MikroTik can make it, but what you
want to do now is to put any kind of "things" you wished to have on this router to blow up
this surface more and more and this is in my eyes not a wise act!

Many peoples are hearing first that pfSense is a safe firewall, and than they see the following
install able plugins for pfSense:
- Squid + SquidGuard
- DansGuardian
- ClamAV
- Snort

For sure this is a capability, but this is not all running together on an Alix Board!
For this set up you will need more a small Supermicro Intel Core i7 Server starting
a 500 € and coming with 250 Watt´s, but the main focus from MikroTik is in my eyes
the most power compared with or by less power consumption.

Alternatively I would suggest to buy a QNAP NAS, they can be pimped with some plugins
to be nearly everything!!!
- Webserver
- FTP & SFTP Server
- HTTP Proxy
- File Server
- VPN Server
- Asterisk PBX
- Backup Server
- Syslog Server

In my eyes today´s best choice for having nearly all services and a lot of HDD space on top!
 
WirelessRudy
Forum Guru
Forum Guru
Posts: 3119
Joined: Tue Aug 08, 2006 5:54 pm
Location: Spain

Re: Web server on mikrotik

Sat Apr 26, 2014 1:59 pm

I was astonished for the harsh reply the initiator of this tread triggered (some years ago..) but found more recent others didn't find it such a weird question after all.

Yes, if hotspot can serve a simple html page for login etc (=webserver functionality) why should that not possible by just storing some html page on the router's file list that you can point to by means of a firewall rule.

This would serve for a simple html page informing some ample user with a payment reminder, or that he is disconnected due failed payment, etc.
We are not talking full blown webserver functionality here, just to present a simple html page to some clients only... I don't want to run a separate box for this. The lesser boxes, the lesser points of failure, the lesser power consumption.
If it is possible in hotspot, why not in webproxy?

Or maybe it is possible? Somebody with any experiance?
 
User avatar
nabeelryk
just joined
Posts: 24
Joined: Thu Jun 06, 2013 1:56 pm
Location: Pakistan
Contact:

Re: Web server on mikrotik

Wed Aug 13, 2014 12:39 pm

well i did host a small website for users about payment methods and terms and conditions. here is what i did.
1. copied all the files into a new directory named "www" inside hotspot and placed my index page in hotspot directory.
2. renamed status.html to status1.html
3. renamed ny index.html to status.html
so whenever users opens my DNS or server ip,before login, they get login.html page. but after login they get my mini website worked fine for me till 2014. now we have seprate server for local hosting.
local server hosting , entertainment stuff,gaming server, dramas, seasons, softwares, 2 live-tv-channels.
 
dawg
just joined
Posts: 15
Joined: Thu Apr 25, 2013 7:31 pm

Re: Web server on mikrotik

Wed Aug 13, 2014 8:50 pm

Lots of bad info here.

I've used older Routerboards as embedded web servers (among other things) before and they were fantastic (and cheap). The first time was back in 2008. All you need to do is load a Linux distro over the network (I believe I used OpenWRT, but I haven't done it in years). I wouldn't recommend it on a board without a serial interface, though.

That said, now you could also just buy a Raspberry Pi, which will do all you need, is slightly cheaper, and has a lot of community support for what you want to do. I have used a lot of inexpensive (relatively) SBCs for this purpose and I'm in the process of shifting to RasPi boards wherever possible due to their very low price and great performance.

Then again, if you need a lot of Ethernet interfaces (as I did), the RBs are still a great value on this front.
 
agehall
Frequent Visitor
Frequent Visitor
Posts: 67
Joined: Fri Aug 15, 2014 8:47 pm

Re: Web server on mikrotik

Fri Aug 15, 2014 10:23 pm

Honestly, it all depends on why you want to do this. I can see some valid reasons for serving a few static HTML pages off a router, but acting as a full web server? No, that is just crazy tbh, unless you are looking for a DDoS attack to take down your whole infrastructure.

Could you run a webserver on a modern gfx-card? Sure - but why would you..? Use the right hardware for the right purpose and your life will be so much easier.
 
amongdota
just joined
Posts: 7
Joined: Thu Aug 22, 2013 11:51 am

Re: Web server on mikrotik

Sun Aug 02, 2015 4:39 am

I am also looking for a way to be able to keep at least one html page.

what is the reason I think that Mikrotik can handle it.

1. All hotspot clients can access the html page under the folder hotspot.
2. we can create a custom page in a web proxy (error page).

What is my purpose?

I just wish there was a HTLM page that can be opened by the client ppp,
for redirect the page, as a warning of payment:

please see this page:
http://wiki.mikrotik.com/wiki/Payment_Reminders

let's say I have a page with just a sentence

<html> <header> <title = "payment reminder /> </ header>
<body> I'm sory, You did not pay for the internet connection </ body>
</ html>

in my mind, with only one page that is very simple, it would be regrettable if I had to use another computer,
whereas mikrotik can accommodate html page for the hotspot login.

im sory fo my bad english
 
noib
Member Candidate
Member Candidate
Posts: 291
Joined: Fri Jan 25, 2013 6:04 pm
Location: France
Contact:

Re: Web server on mikrotik

Wed Aug 10, 2016 7:26 pm

It's quite easy to do this nowadays (maybe it wasn't in routeros < 6)

install Hotspot package
add IP on the interface you want to serve files (i.e. 10.211.0.5/24)
create a hotspot profile with an HTML directory (i.e. "FILES")
create a hotspot with the previous profile on the desired interface.
RouterOS will create automatically a subdirectory called FILES, put file mypic.png on it.

Then, access the file via http://10.211.0.5/mypic.png from a device connected to this interface (and having a reachable IP, of course)

Make sure your routerboard isn't a gateway and has no DHCP server running on that interface, or else the hotspot will really work (=limiting connections, etc), and that is not what you want.
 
aartyom
just joined
Posts: 2
Joined: Thu Jan 12, 2017 11:37 am

Re: Web server on mikrotik

Tue Nov 03, 2020 10:23 pm

Sorry for necroposting but can anyone share working detailed config for a web page hosted on hotspot ?
I set 2nd IP on a bridged eth iface and used it in hotspot config. All requests (for example to errors.txt) end with 404 not found. Only after I changed eth iface to bridge and disabled www service it worked but all connections then went thru hotspot - its not what I wanted.
I just want to host wpad.dat script
Thx a lot in advance!
 
User avatar
juanvi
Member Candidate
Member Candidate
Posts: 168
Joined: Mon May 05, 2014 6:55 pm
Location: SPAIN

Re: Web server on mikrotik

Wed Jul 26, 2023 12:56 pm

if you use hotspot, you do have access to the web files in the hotspot folder. I guess you can upload some PDFs there then
Sorry for re-necroposting:

Would be possible show content of hotspot folder from browser by typping http://hotspotaddress.com/img?

Thanks in advance.

Who is online

Users browsing this forum: No registered users and 14 guests