Changes

From Amahi Wiki
Jump to: navigation, search
3,942 bytes added ,  15:41, 1 February 2013
:#For example, you could create the subdomain/CNAME: address.yourdomain.com for the AddressBook webapp---point that subdomain to: username.yourhda.com---in the AddressBook .conf file add: ServerAlias address.yourdomain.com---restart the server---you are done, enjoy using multiple webapps!
 
Even if you have a dynamic IP address from your ISP, this can still be done - rather inexpensively. Some [http://en.wikipedia.org/wiki/Dynamic_DNS dynamic DNS] services, like DynDNS, allow for you to create a domain and use something called a [http://en.wikipedia.org/wiki/Wildcard_DNS_record wildcard DNS record]. This acts much like the subdomain created above, but you can literally use anything you wanted so long as the server is set to answer to the request. Below, we'll outline the basic steps needed to accomplish this.
 
Some routers (Netgear, Linksys, etc.) allow you to set up credentials for you dynamic DNS service account so that it'll update the dynamic DNS service for you. If you don't have that ability, you may have to run a client-side application on a computer inside your network which will send out regular updates to the same thing. Figure out if you will be updating the dynamic DNS service via the router or a client-side app. Once you've confirmed you can utilize this technology, in one form or another, proceed with the rest of these basic steps.
 
# Obtain a ''paid'' DynDNS account.
## At the time of this writing, DynDNS is calling it their ''Pro'' account.
## Basic accounts will not allow you to use wildcards.
# In your Amahi's web-GUI, navigate to your '''Webapps''' section via '''Apps > Webapps'''.
# In our case, we'll be allowing our Dokuwiki to answer to our wildcard DNS record so expand it by clicking on it.
## This will show several options to edit but we're only going to add an '''alias'''.
### Click on '''New Alias'''.
### Enter your wildcard like what we have in our example. (screen-shot coming soon)
#### If your DynDNS account is '''tommy.homedns.org''', you'll enter something like '''wiki.tommy.homedns.org'''. Again, DynDNS allows for wildcards so you can make up stuff all day long!
 
You should be able to test this by now however, it may prove difficult to accurately test it from inside your own network. In that case, bug your fiend down the street to see if they can get to it or do it yourself at a later date.
 
'''For the curious:'''
So, what did this do? Well, what it did was add a [http://httpd.apache.org/docs/current/mod/core.html#serveralias ServerAlias] directive to the Apache configuration. (In MS-IIS, it's called a host header or binding.) You can have as many ServerAlias' as you'd like. So, if you wanted to take a look under the hood, you would open a terminal window on your server (or SSH to it) and do a directory listing of '''/etc/httpd/conf.d/'''.
{{code|
user@ubuntu-amahi1:~$ ls -l /etc/httpd/conf.d/
total 28
-rw-r--r-- 1 root root 21 Oct 10 18:46 00-init.conf
-rw-r--r-- 1 root root 2231 Oct 10 18:46 01-platform.conf
-rw-r--r-- 1 root root 516 Oct 10 18:46 03-calendar.conf
-rw-rw-r-- 1 nobody nogroup 518 Feb 1 09:20 1000-dokuwiki.conf
-rw-rw-r-- 1 www-data users 492 Oct 10 21:14 1001-phpsysinfo.conf
-rw-rw-r-- 1 www-data users 489 Oct 10 21:18 1002-subsonic.conf
user@ubuntu-amahi1:~$
}}
In our case, when we installed the Dokuwiki app, it created '''1000-dokuwiki.conf'''. Open that and you'll see the ServerAlias that was added.
{{code|Code=
user@ubuntu-amahi1:~$ nano /etc/httpd/conf.d/1000-dokuwiki.conf
 
<VirtualHost *:80>
 
ServerName dokuwiki
ServerAlias dokuwiki.home.local
 
ServerAlias wiki.tommy.homedns.org
 
DocumentRoot /var/hda/web-apps/dokuwiki/html
 
<Directory "/var/hda/web-apps/dokuwiki/html">
Options Indexes FollowSymLinks +ExecCGI
AddHandler fcgid-script .fcg
AllowOverride FileInfo Limit Options Indexes
Order allow,deny
Allow from all
 
</Directory>
 
ErrorLog /var/hda/web-apps/dokuwiki/logs/error_log
CustomLog /var/hda/web-apps/dokuwiki/logs/access_log combined env=!dontlog
 
</VirtualHost>
 
}}
You can see that adding that ServerAlias added the line: '''ServerAlias wiki.tommy.homedns.org'''
= Hosting a Website =
13

edits