CLOSED: Remote Wake-On-LAN Server

rdagijones
Posts: 265
Joined: Thu Jan 26, 2012 7:56 am

CLOSED: Remote Wake-On-LAN Server

Postby rdagijones » Wed Jan 21, 2015 8:09 pm

I am creating a web app from this program (http://www.jeremyblum.com/2013/07/14/rp ... nt-1373552). [I had to edit the index.php file to use a "wol" command instead of "wakeonlan" to get the program functioning in Fedora, but that was easy enough.] I got it working as a wake-on-lan tool from within my network, but need to make it accessible outside the network. I have edited /etc/httpd/conf.d/****.conf files and .htaccess files on Amahi 6 but I cannot get this one to resolve outside the network.

Questions:
In Amahi 7, does one edit the ***-wolserver.conf file between <Directory> and </Directory> if the app does not resolve outside of the network? I don't want to mess up the porting that is for access protection. I saw this:
Options Indexes FollowSymLinks +ExecCGI
AddHandler fcgid-script .fcg
AllowOverride FileInfo Limit Options Indexes
Order allow,deny
Allow from all
in an old posting but I don't think that is right.

Do I use .conf or .htaccess or what to change the port of the app? (I am guessing that I will need to get it to listen on a different port so that I will still be able to access the hda dashboard remotely.)

User avatar
bigfoot65
Project Manager
Posts: 11241
Joined: Mon May 25, 2009 4:31 pm

Re: Remote Wake-On-LAN Server

Postby bigfoot65 » Wed Jan 21, 2015 8:17 pm

That would be a NO.

Best follow the hosting multiple webapps guidance in the wiki. What it requires is a dynamic DNS provider like No-IP.org or similar using CNAME and sub domains as it describes. I use Dreamhost and it worked quite easily.

There is no way to do this with the Amahi provided dynamic DNS unless apps operate on different ports as you mentioned. You could try to make it do that, but not sure if it's as simple as changing *80 to something else. Never attempted it myself. You might find some help on the internet though.

EDIT: BTW, it would be good if you could document your experience in the wiki. We could build a Wake-On-Lan app in the Amahi store if you are willing to assist. Sounds like the solution you found would be quite easily adapted as an Amahi application.
ßîgƒσστ65
Applications Manager

rdagijones
Posts: 265
Joined: Thu Jan 26, 2012 7:56 am

Re: Remote Wake-On-LAN Server

Postby rdagijones » Wed Jan 21, 2015 8:31 pm

Could things be simplified if I create an alias (say wolserver.***.yourhda.com [*** being my Amahi DNS user]) and then start from there? (Just doing this did not solve the issue.)

Also, someone in the comment section on Andrew Blum's blog asked about changing the port from 80 and he responded:
You can adjust the port number in the apache configuration file. You could also direct a different external port to an internal port 80

User avatar
bigfoot65
Project Manager
Posts: 11241
Joined: Mon May 25, 2009 4:31 pm

Re: Remote Wake-On-LAN Server

Postby bigfoot65 » Wed Jan 21, 2015 8:45 pm

Sub domains are currently not possible using the Amahi dynamic DNS. That's why I suggested something like No-IP.org.

However, a little experimentation using this guidance for modifying Apache might work. I have never thought of trying it myself.
http://lowagie.com/apache_virtualhosts

If it works, would be good to add to the wiki if you are willing to help document it. There are always users wanting to expose multiple apps using Amahi dynamic DNS, but no guidance on doing it other than using CNAME with other providers.

I would be glad to help test and document. What say you?
ßîgƒσστ65
Applications Manager

rdagijones
Posts: 265
Joined: Thu Jan 26, 2012 7:56 am

Re: Remote Wake-On-LAN Server

Postby rdagijones » Wed Jan 21, 2015 9:46 pm

I will give it a try.

User avatar
bigfoot65
Project Manager
Posts: 11241
Joined: Mon May 25, 2009 4:31 pm

Re: Remote Wake-On-LAN Server

Postby bigfoot65 » Thu Jan 22, 2015 3:40 am

Let me know if you need any help. I am going to try and package the app in the next few days. I will also play around with the port/virtual host stuff.
ßîgƒσστ65
Applications Manager

rdagijones
Posts: 265
Joined: Thu Jan 26, 2012 7:56 am

Re: Remote Wake-On-LAN Server

Postby rdagijones » Thu Jan 22, 2015 6:31 am

Just reading through the article (http://lowagie.com/apache_virtualhosts) and wondering:

1. If I add a VirtualHost (i.e. NameVirtualHost *:8081) will I have to install those apps to a different directory? NameVirtualHost *:80 points to /var/hda/web-apps. NameVirtualHost *:8081 points to /var/hda/web-apps2. If I organize them to the same directory, will this not cause conflicts?

2. Will I have to qualify the apps that are on NameVirtualHost *:80 with the "app.localdomain.com:80" address and qualify that apps that are on NameVirtualHost *:8081 with the "app.localdomain.com:8081" address to get them to resolve correctly? Perhaps I will only have to specify the 8081 ports? What do you think?

User avatar
bigfoot65
Project Manager
Posts: 11241
Joined: Mon May 25, 2009 4:31 pm

Re: Remote Wake-On-LAN Server

Postby bigfoot65 » Thu Jan 22, 2015 6:54 am

1. If I add a VirtualHost (i.e. NameVirtualHost *:8081) will I have to install those apps to a different directory? NameVirtualHost *:80 points to /var/hda/web-apps. NameVirtualHost *:8081 points to /var/hda/web-apps2. If I organize them to the same directory, will this not cause conflicts?
No, you can only have access to an app on 1 port. You would need to make the virtual host for the Wake-On-Lan (or specific app) available on port 8081 (or other nonstandard port), but the dashboard would remain on 80. Obviously you would need to forward another port to access local port 8081.

Keep any app that you don't need remote access to as port 80 in the virtual host file. Apps that would be accessed outside the network would need a nonstandard port assigned. You would also have to add the listen line in apache.conf file for each of these nonstandard ports.

This sort of thing can be tricky and if not done correctly could break the web server.
2. Will I have to qualify that apps that are on NameVirtualHost *:80 with the "app.localdomain.com:80" address and qualify that apps that are on NameVirtualHost *:8081 with the "app.localdomain.com:8081" address to get them to resolve correctly? Perhaps I will only have to specify the 8081 ports? What do you think?
You will only have to qualify those that are on the nonstandard ports (i.e. not 80/443).

Does that make sense?

I intend to do some testing tonight.
ßîgƒσστ65
Applications Manager

rdagijones
Posts: 265
Joined: Thu Jan 26, 2012 7:56 am

Re: Remote Wake-On-LAN Server

Postby rdagijones » Thu Jan 22, 2015 7:37 am

So then the Amahi dashboard will be accessible in and outside the network on port 80 and the app (WOLServer) will be accessible on the nonstandard port (8081). Just to clarify, do I make a /var/hda/webapps2 structure or just point NameVirtualHost *:8081 to /var/hda/webapps?

User avatar
bigfoot65
Project Manager
Posts: 11241
Joined: Mon May 25, 2009 4:31 pm

Re: Remote Wake-On-LAN Server

Postby bigfoot65 » Thu Jan 22, 2015 8:14 am

So then the Amahi dashboard will be accessible in and outside the network on port 80 and the app (WOLServer) will be accessible on the nonstandard port (8081).
That is correct.
Just to clarify, do I make a /var/hda/webapps2 structure or just point NameVirtualHost *:8081 to /var/hda/webapps?
No the app location does not need to change. You do need to ensure the .conf file for the virtual host has the correct path and port identifier.

Does that make sense?
ßîgƒσστ65
Applications Manager

Who is online

Users browsing this forum: No registered users and 2 guests