[APP] WebHosting for firmware V4+ (10/2015)

hi nazar

i am trying to install wol on my cloud . i create the pgl file for apache2 i reload apache2 i create the script wol.pl put i cant find the ./private folder to put it neither the shares/scripts

Those paths are example, you can place the wol.pl script anywhere you want e.g. you already have a path to place all your custom script in ‘/shares/scripts/’.

And the “./private” folder is also just an example you can create in “/var/www/htdocs” (for apache2), then symlink the script there. You can also place the wol.pl directly in /var/www/htdocs but it’s not recommended because you will lose it on firmware upgrade and the docroot path is used by WD Dashboard for you to password protect, hence symlink from your DataVolume is preferred.

PS: Refresh the guide from my site, there’s a minor change to the script name that my cache didn’t clear, wol.pl instead of hostsdeny.pl.

sorry i am bothering u but on shares folder there is no scripts folder i must create it ??

i create folder private and i put the wol.pi here

what is symlink and how can i create it
i am confused sorry again please help me

No problem :slight_smile: I said ‘example’ means you can create any folder if you don’t have an existing one to place your custom scripts. Details below:

  1. Yes create a new folder /DataVolume/shares/myscripts then set it to perm 755.

  2. Place the wol.pl script in /DataVolume/shares/myscripts/ make sure wol.pl is also perm 755.

  3. Create a symlink of the wol.pl script to the /var/www/htdocs/private folder which you have just created e.g.:
    ln -s /DataVolume/shares/myscripts/wol.pl /var/www/htdocs/private/;

  4. Create the .htaccess and .htpasswd as per my guide.

Then access the WOL from e.g. http://wdmycloud/private/wol.pl or http://your-public-ip/private/wol.pl

ps: I saw in your screenshot you already have the wol.pl in the private folder but it’s not symlink, so if you try to run the symlink command it will fail as the filename exists. Remove the existing wol.pl in the private folder or add a -f switch to the ln command to force overwrite.

ok i think i made a progress now what lines i must change from wol.pl like mac adress e.t.c. or it is ok???

in photo it asks my for user and pass end then i have this photo

There’s two method of adding the mac address, both will produce the same results.

  1. View the script from the GUI then add your device from there, the device needs to be online for the first time to let the script detect its IP.

  2. Add manually from the script:
    my $devices = q/
    MyRoomPC|00:00:00:00:00:00
    MyRoomLaptop|00:00:00:00:00:00
    /;

Have you created this new config file /etc/apache2/conf.d/cgi.conf and reload apache2? If yes check your apache log tail -f /var/log/apache2/error.log;.

Aha you haven’t created the “htpasswd” part from my guide :slight_smile:

cd to the apache2 docroot: cd /var/www/htdocs/private; then run htpasswd commands from my guide (stated before the htaccess part).

Try changing both wol.pl and the path ownership/group to www-data:

chown www-data:www-data /DataVolume/shares/myscripts/ /DataVolume/shares/myscripts/wol.pl;

many many thnx my friend u are the best how can i see the saved list???

No problem. Try and test them, e.g. put your PC to sleep (make sure its NIC can wakeup, see details in the guide), the run the URL (using public IP or DDNS) on your mobile in 3G/4G mode, WAKEUP the PC :slight_smile: I put all my laptops/pc to auto sleep after 1hr. If I need to RDP or VNC, I wake them up.

All the saved list are there on the GUI, eventually saved to the wol.pl itself. The GUI will scan your local network for active devices and list out the MAC and IPs for you to save or wake.

yes it working great but i rename the host to e.g. ananias47 but it steals shows me the ip-name

I just tested and I can add ananias47 as the hostname. Note on some router it can’t detect your hostname which you’ll need to add it yourself as a form of identification. Of course you can just leave it as an IP because not everyone can remember MAC address.

if the pc is off it shows as saved name if its on it is ip-name is it because i have static ip??

Erm not sure about static IP because I’m using DHCP but with IP reservation. The way it works is the script will first check and display your active devices, then the saved list. When it’s checking the active device, it will try to get the hostname first by socket gethostbyaddr, if empty then try to match the hostname by MAC in your saved list then finally return as IP. And I think for your case it returns hostname as IP for active devices the reason why you see IP instead of hostname. My v4 firmware 04.01.02-417 returns the hostname, not sure about the latest firmware though.

never mind it working great so no problem i have transmission if i install pyload i will slow down the performance of wd??

You should have no problem if you schedule your downloads accordingly e.g. not downloading all at once.

wol.pl Updated!

v1.3 - 20160520 - Fixed UDP input on certain browsers. Display saved hosts over active IPs.

I’ve updated the wol.pl to v1.3. See if it’s showing the saved name for active device.

You might wanna preserve the settings if you have saved any:

# Begin Settings
# UDP port to send magic packet.
my $udpPort = 9;
# Manually add Hostname|MAC per-line eg. MyRoomPC|00:00:00:00:00:00
my $devices = q/
MyRoomPC|00:00:00:00:00:00
MyRoomLaptop|00:00:00:00:00:00
/;
# End Settings