Multiple domain names on one Pi

Posted by samattacott 
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
Multiple domain names on one Pi
August 08, 2019 12:22PM
I'm wondering if it's possible have additional domain names working on the same box, where the goal is to simulate a tiny version of the internet. Lets say the default redirect is to some.domain and I would like to be able to enter into the browser to get a completely different site. I know I can just make extra html files to access through some.domain/another_site.html but I'd like to make it "feel" more like the internet. For example, I would like to be able to enter video.files into the browser and have a pseudo YouTube type site running.

Any ideas on whether this is possible, and if so where to start?

thanks : )
Re: Multiple domain names on one Pi
August 13, 2019 04:09PM
Okay so: I found a way to do this with lighttpd (which is the software that piratebox is using to turn itself into a web server). Basicaly all you need to do is add some code into the lighttpd.conf file that redirects traffic to a document root folder. I do most of my pirateboxwork through ssh so I just ran:

sudo nano /opt/piratebox/conf/lighttpd/lighttpd.conf

and then added this to the bottom of the file:

$HTTP["host"] == "" {
   server.document-root = "/opt/piratebox/share/directory/of/"
with "directory/of/" as the location of your new sites index.html file.

This works okay in that you can enter [] and land on the page, but still falls foul of the https problems with modern browsers. When testing on android I find that I need to switch off mobile internet to get this working in browser (although it works fine when it pops up after the "sign in" dialog).