Serving the index page from another machine

Posted by magnickel 
This forum is currently read only. You can not log in or make any changes. This is a temporary situation.
Now, this forum is in read-only mode. You find details Details hereContinue on /r/PirateBox
Serving the index page from another machine
April 02, 2016 11:42PM
I have piratebox setup on my router (m3020). However, I have linux server installed on an old computer that I want to be serving the index page and content.

Here are the steps I have taken, and my problem:

-editing /etc/hosts I have added 192.168.1.38 library.lan, the address of my ubuntu server machine

- editing /opt/piratebox/www/redirect.html I have changed piratebox.lan to library.lan

At this point, when connecting to the wifi, the browser opens up and is redirected to library.lan/. However, this is still at the piratebox index page, not my server index page. Though if I type the actual server ip-address in the url, 192.168.1.38, I am successfully at the server index page.

I am thinking this is a DNS-masq issue, so I jumped into dnsmasq_captive.conf and changed address=/#/192.168.1.1 to address=/#/192.168.1.38.

Now when I connect, the browser doesn't automatically open the microsoft.com/whatever to cause the automatic redirection.

However if I type yahoo.com, or any http website (HTTPS gives an error and does NOT work), then I get redirected sucessfuly to library.lan/ which is now my correctly at my server index page.

So, my question is... how do I get the automatic browser url redirect to work upon connection, while still getting library.lan/ to take me to my server index page?



Edited 1 time(s). Last edit at 04/02/2016 11:44PM by magnickel.
the instructions in the piratebox.conf file are confusing to me, it mentions having a two component setup. If someone could explain a bit better?
Re: Serving the index page from another machine
April 06, 2016 06:19PM
You have room for other static entries here

/opt/piratebox/conf/hosts

Make your entry from /etc/hosts in this file and it will work out after restart the piratebox (easiest solution, you can also send a SIGHUP to dnsmasq winking smiley )

best regards
Matthias