Page 1 of 1

Access different web-apps using 6 urls and same IP

Posted: Thu Jul 16, 2009 1:24 pm
by hart02
Some of you may know this
HostingAWebsite

You want to run a web server in your Amahi server and make it visible from the web outside your home.

FIRST: making anything visible outside your network can open security issues, so you are doing this at your own risk. Some apps are more secure than others, but there is nothing ultimately secure. Best is to use the VPN to login back home."

With that out of the way, to host your own web site you need the following:
Forward a port to your HDA ip address, either for plain insecure http: 80, for https, 443 (advanced users can use other ports). Some routers call this or require a "virtual server"
Chose a domain name that you own (or your free username.yourhda.com that comes with Amahi). This is how the app will be accessed outside
Chose the app you want to make accessible outside, let's say, yourweabppname

What you need to do (as root) is edit the config file for the app:
cd /etc/httpd/conf.d
nano 10*-yourweabppname.conf

Then add:
ServerAlias username.yourhda.com

You can add more server aliases if you want to access the app under those names. Then save the file, quit the editor (nano in this case) and restart the server:
service httpd reload
well with my pfsense router config (I turned off amahi's dhcp server because I got my router config perfected) a free dyndns.com account and possible your username.yourhda.com domain that comes with amahi, you can have 6 urls with the same external ip each a different web app.(5 is the limit of url you can have for free on dyndns.) I have
  • ports 80,8080 and 443 open to my server which is static
  • turned off Allow DNS server list to be overridden by DHCP/PPP on WAN
  • dns forwarder on
  • turned off dhcp on amahi using webmin
  • ddclient on my amahi server and the webmin module
  • pfsense with dynamic dns on and a url entry
  • a free dyndns account
  • use of open dns on my router
You may have to do it differently with your setup. mine is just a pfsense pc. with my setup, I can just go to whatever app in the terminal or through webmin and then add the ServerAlias clause to the conf file each with a different url. Wish i could get it on one url via http://example.com/somewebapp. apache wont let me do it. If you don't believe me then try this go to yougetsignal.com and look up the ip for whatisthistome.blogsite.org and jinzora.kicks-ass.org

Re: Access different web-apps using 6 urls and same IP

Posted: Thu Jul 16, 2009 10:57 pm
by cpg
nice setup!

wiki page?

Re: Access different web-apps using 6 urls and same IP

Posted: Fri Sep 04, 2009 7:54 am
by lou1z
that won't work with https as the headers are encrypted. ultimately, you can have as many web apps as you want with as many domains as you want. that's a standard apache or iis feature and is what shared hosting is based on.