* [[VNC]] access to your HDA if headless
** ''Terminal is available under Applications -> System Tools -> Terminal''
* [http://www.amahi.org/apps/ajaxterm Ajaxterm] SSH if headless and no VNC
* A monitor if you are not headless
To host your own web site you need the following:
What you need to do in a terminal (as root) is find the apps conf file then edit the conf file for the app:
{{Code| su -Code=su ls /etc/httpd/conf.d[enter password]:: '''NOTE:''' If you get a message like ''"ls : cannot access /etc/httpd/conf.d: No such file or directory"'', simply use the following to manually change directories: cd /etc/httpd/conf.d ls }}
Find your app .conf file. It will look like 10##-yourwebappname.conf
{{Code|Code= nano /etc/httpd/conf.d/10##-yourwebappname.conf}}:: '''NOTE:''' Depending on the options you chose during installation, you may not have the "nano" text editor installed. If that is the case, you will receive an error message. Instead, substitute "vi" for "nano" to use a different text editor. [http://www.cs.colostate.edu/helpdocs/vi.html Here are the commands to use the "vi" editor.]
Your conf file should look something like this at the top of the page:
{{Text|<pre>
<VirtualHost *:80>
ServerName app
ServerAlias app.YourDomain.lan
</VirtualHost></pre>}}
Add this (immediately after the ServerName directive):
{{Text|<pre>
ServerAlias username.yourhda.com
}}</pre>
So it looks like this:
{{Text|<pre>
<VirtualHost *:80>
ServerName app
ServerAlias username.yourhda.com
</VirtualHost>
}}</pre>
You can add more server aliases if you want to access the app under those names (for example: ServerAlias myphotos.DomainName.com). Once you are satisfied with the server aliases, you may save and quit nano by following these steps in Windows:
Restart the server using:
* Fedora
{{Code| systemctl restart httpd.service httpd reload}}
* Ubuntu
{{Code| sudo service apache2 reload}}
And you are done, enjoy your website.... or are you?
So suppose I have a domain name, which is pointed at my hda - and I set up a subdomain that for the mediawiki app. We'll call it mediawiki.myname.com.
After installing media wiki, I need to go
{{Code| sudo vi /var/hda/web-apps/mediawiki/html/LocalSettings.php}}
And scroll down to
{{Code|<pre>
## The protocol and server name to use in fully-qualified URLs
$wgServer <nowiki>= </nowiki> "http://mediawiki";}}</pre>
then change to
{{Code|<pre>$wgServer <nowiki>= </nowiki> "http://mediawiki.myname. com";}}</pre>
then enter these commands:
{{code| sudo rm -r /etc/lock/apache2 sudo php /var/hda/web-apps/mediawiki/html/maintenance/Update.php sudo service apache2 restart}}
Now you should be able to view http://mediawiki.myname.com from inside your network and on the internet as well.
= Hosting Multiple Webapps =
''If you wish to have access to multiple webapps, described below is one way to accomplish this('''NOTE:''' ''Requires a dnynamic DNS provider in addition to Amahi username.yourhda.com''):
# obtain a domain name (i.e., via godaddy.com) --for example yourdomain.com
# don't forget to restart the server each time you edit a .conf file.
:#: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 want so long as the server is set to answer to the request. Below, we'll outline the basic steps needed to accomplish this.
## 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 [[Media:Amahi-webapps.PNG|Webapps]] section via '''Apps > Webapps'''(Ubuntu). The Amahi [https://www.amahi.org/apps/web-apps Web App] provides this functionality in Amahi 7.
# 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'''.
'''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 a 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|<pre>
user@ubuntu-amahi1:~$ ls -l /etc/httpd/conf.d/
total 28
-rw-rw-r-- 1 www-data users 489 Oct 10 21:18 1002-subsonic.conf
user@ubuntu-amahi1:~$
}}</pre>
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
user@ubuntu-amahi1:~$ nano /etc/httpd/conf.d/1000-dokuwiki.conf
<pre>
<VirtualHost *:80>
</VirtualHost>
</pre>
}}
You can see that adding that ServerAlias added the line: '''ServerAlias wiki.tommy.homedns.org'''
= Hosting Webapps (Change Port)=This is an alternate method for hosting single or multiple web apps using the builtin Amahi dynamic DNS (''username.yourhda.com''WARNING:). This will likely work with other dynamic DNS providers. You can change the port that most web apps operate, specifically port 80. You can use any port not already in use by the OS or your HDA. To verify what ports are already in use, do (as ''root''user): nmap -sT -O localhost Some apps will work right out of Once you have chosen the box so port to speak with these use, follow the stepsbelow (using [https://www. Others however, (such amahi.org/apps/adminer Adminer] as mediawikian example and port 8081) will require additional work before you can visit them on : * Edit ''/etc/httpd/conf.d/####-adminer.conf'' and add the internetfollowing line. You will need Also change 80 to edit 8081 in the apps config file VirtualHost line: Listen 8081 <VirtualHost *:8081>* Update the ServerAlias: ServerAlias adminer.amahi.net:8081* Add right below ServerAlias to change use the Amahi dynamic DNS: ServerAlias username.yourhda.com:8081* Restart web server address : systemctl restart httpd Forward port 8081 on the router of that course to access from outside the network. Anytime you access the appon your network internally, navigate to <nowiki>http://adminer. We will use mediawiki as an exampleamahi.net:8081</nowiki>.
So suppose I have a domain name, which is pointed at my hda - and I set up a subdomain that for the mediawiki app:'''NOTE:''' ''amahi. Wenet'll call it mediawiki.myname.com. After installing media wiki, I need to go{{Code|sudo vi /var/hda/web-apps/mediawiki/html/LocalSettings.php}}And scroll down to {{Code|## The protocol and server name to ' part of the URL may be different depending on the domain you use in fully-qualified URLs$wgServer = "http://mediawiki";}}then change to {{Code|$wgServer = "http://mediawiki.mynamefor your HDA. com";}}
then enter these commands:{{code|sudo rm -r To change the app back to using port 80, remove the ''Listen'' line and change the port to ''80'' in ''/etc/lockhttpd/apache2sudo php conf.d/var/hda/web####-apps/mediawiki/html/maintenance/Updateadminer.conf''.phpsudo service apache2 restart}}
Now I would not recommend you should be able to view http://mediawikitry this with apps that do not use port 80.myname.com from inside your network and on For example, an application that uses the internet as wellweb server proxy will most certianly not work with this method.
= Hosting a Website =
We will create the website by creating a webapp. This is a lot easier than it sounds, so don't give up just yet!
# Got your HDA page (<nowiki>http://hda </nowiki> or <nowiki>http://hda.yourhda.com</nowiki>), click ''Setup'' and go to ''Settings''.
## Make sure your ''Advanced Settings'' option is checked (if not, check and click OK past the warning)
# Go to ''Apps'' and then ''Webapps''(Amahi 6). The Amahi [https://www.amahi.org/apps/web-apps Web App] application provides this functionality in Amahi 7.
# At the very bottom, click ''New Web App'' and type in a name like Website
:This is where your webpage will reside in, you can name this anything you'd like. This is not the title of your website or webpage. Website will be used as the name for this guide
= More Secure Access =
To enable https access to your apps, you can follow the techniques in [[Secure App Access]] page. '''NOTE:''' Recommend exercising extreme caution with this tutorial as it has been known to cause problems.
= FAQ =