Community discussions

MikroTik App
 
okw
newbie
Topic Author
Posts: 37
Joined: Thu May 24, 2018 7:05 pm

Hosting website on USB stick

Thu Aug 18, 2022 2:19 pm

What is the best way of securely setting up my 2011UiAS to host a very small (and and low traffic) web site? I have static IP.
It's small and has like 5-10 visits a day. We have two computers connected at all the times, but would the built-in USB be more secure? Putting the 2-3MB website on a USB stick and mount this?
 
User avatar
k6ccc
Forum Guru
Forum Guru
Posts: 1490
Joined: Fri May 13, 2016 12:01 am
Location: Glendora, CA, USA (near Los Angeles)
Contact:

Re: Hosting website on USB stick

Thu Aug 18, 2022 5:36 pm

Pretty straight forward. Set up a NAT forward for port 80 (and 443 if you have it secured) to whatever computer runs the web server.
add action=dst-nat chain=dstnat comment="Web Server on Jupiter." \
    dst-address-type=local dst-port=80 in-interface=Fiber_Internet protocol=tcp \
    to-addresses=192.168.201.11 to-ports=80

If you don't have an allow anything DST NATted firewall rule, you need to specifically allow traffic to the web server. In my case, I have an allow all DST NATted.
add action=accept chain=forward comment="Accept all that is DST NATed" \
    connection-nat-state=dstnat connection-state=new

I'm not sure I understand what you mean by putting the web site on a USB drive. You need a computer running a web server - not just the web files. In my case, I am using Apache on my Windows server named Jupiter. For a lightly used website as you describe, you could easily use a RaspBerry Pi as the web server.
 
User avatar
jvanhambelgium
Forum Veteran
Forum Veteran
Posts: 985
Joined: Thu Jul 14, 2016 9:29 pm
Location: Belgium

Re: Hosting website on USB stick

Thu Aug 18, 2022 6:17 pm

What is the best way of securely setting up my 2011UiAS to host a very small (and and low traffic) web site? I have static IP.
It's small and has like 5-10 visits a day. We have two computers connected at all the times, but would the built-in USB be more secure? Putting the 2-3MB website on a USB stick and mount this?
Too bad you have a 2011 that cannot run "containers" , that is a MIPS platform, you need ARM/ARM64/x64 for containers.
Otherwise that would have been your best option.

You also might want to experiment with the "proxy" feature of RouterOS, but make changes to all your webpages (Cache-Control directives) but I'm afraid the maximum value is 604800 (= 7 days) then any proxy will flush it and re-fetch it from the origin. If you manage to get ALL the "objects" of you small website in the cache and serve only from the cache ... you "kind of" have some webserver but I have my doubts if it will work in practice. A very,very simple website only with some static ojects might work but....

So besides this I have no ideas how to accomplish this. You cannot "use" the webservice on RouterOS that serves "Webfig" for these purposes. That would be a complete security loophole. I don't think you can "serve" other files than webfig and you do not have access to these files from RouterOS I believe.
 
User avatar
bpwl
Forum Guru
Forum Guru
Posts: 2983
Joined: Mon Apr 08, 2019 1:16 am

Re: Hosting website on USB stick

Thu Aug 18, 2022 7:45 pm

Only need to share the files on the USB stick (SMB drive?), and be aware of the limitations

https://superuser.com/questions/543744/ ... t-a-server
 
User avatar
BartoszP
Forum Guru
Forum Guru
Posts: 2865
Joined: Mon Jun 16, 2014 1:13 pm
Location: Poland

Re: Hosting website on USB stick

Fri Aug 19, 2022 8:49 am

IMHO it's much better to buy Raspberry Pi and host a full WWW server on it. More flexible.
 
User avatar
bpwl
Forum Guru
Forum Guru
Posts: 2983
Joined: Mon Apr 08, 2019 1:16 am

Re: Hosting website on USB stick

Fri Aug 19, 2022 12:12 pm

 
pe1chl
Forum Guru
Forum Guru
Posts: 10195
Joined: Mon Jun 08, 2015 12:09 pm

Re: Hosting website on USB stick

Fri Aug 19, 2022 2:59 pm

What is the best way of securely setting up my 2011UiAS to host a very small (and and low traffic) web site? I have static IP.
It's small and has like 5-10 visits a day. We have two computers connected at all the times, but would the built-in USB be more secure? Putting the 2-3MB website on a USB stick and mount this?
Too bad you have a 2011 that cannot run "containers" , that is a MIPS platform, you need ARM/ARM64/x64 for containers.
But a 2011 can run MetaROUTER! That existed a decade before containers.
Of course you need some perseverance to get a webserver working in a custom MetaROUTER image, but it would be the same for containers.

Who is online

Users browsing this forum: nescafe2002 and 71 guests