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

Live Counter

Note: Can’t see live counter image above? Try again later as my WDMyCloud is offline!

  1. This installer will upgrade and modify your existing WD Dashboard components.
  2. Do not attempt “apt-get” or “aptitude” for any of these or you will brick your WD Dashboard!
  3. If you’re not familiar with HTTP Servers and CGIs, then maybe this is not for you.
  4. Other available manual guides listed at the end of this post.

Purpose of this post is to host sites like (WP)  WordPress v4+ and (OC)  OwnCloud v8+ on WDMyCloud firmware V4+ without breaking WD’s Dashboard and Remote access functionality. In case you’re wondering, this installer runs straight from my WDMyCloud 4TB NAS! :wink:

This is WebHosting Mods v1.0.0 for WDMyCloud V4 Firmware: Nginx, MySQL, ESMTP, UNRAR, INOTIFY-TOOLS, PERL-FCGI+LIBS, PHP5-FPM/CLI/GD/IMAGICK/CURL/MYSQL/SQLITE/MCRYPT/APCU/JSON successfully built with 64K page size memory patch. For setups and details, refer to the official sites:

For those interested on how to build from the source, refer to this  thread. It may help others to continue supporting the 64K page size memory for other packages. Below are my simplified instructions on how to get it installed on the V4 firmware (will not work on older firmwares).

AND I have also made an online generic 64K page size memory package installer to simplify the installations of Debian packages on WDMyCloud. This will not work on older version 3 WD firmwares and I’m not planning to support it either as I’m sticking with the V4 firmwares. Based on dynamic server-side FastCGI, perl and shell scripts, I’ll be using this method for newer guides from now onwards. Feel free to parse the script codes. All bug reports, opinions and suggestions are welcomed.

The Generic Online Installer:

1) Auto download of required debs including its dependencies if any.
 
2) Debs installation in the required order to prevent dependency issues.
 
3) Auto run custom configurations if any.

If you proceed further, you are fully aware of the usual WD’s _warranty void _clauses including disclaimer from any damages that may resulted from this guide.

  • Enable SSH on your NAS from the WD DashBoard settings if not done so. SSH to your NAS port 22 using i.e. putty root@wdmycloud.

  • To proceed with the installation, first you need to get the username and password from me. The credentials will expire hourly e.g. “1AM,2AM,3AM…” to prevent intentional abuse on my network resources. Click on the link below to get the credentials :

    WDMyCloud | TeaNazaR.com

  • After obtaining the credentials, just copy & paste into the SSH terminal session of your WDMyCloud:

    export NAZAR78_USER=user; export NAZAR78_PASS=pass; export NAZAR78_KEYS=keys;

  • Then run the online installer on your WDMyCloud copy & paste as below, follow the instructions and enjoy (-:

    curl teanazar.com/installer.fcgi?webhosting-mods_1.0.0|sh;

Guides and How to’s:

Online Installer change log:

[20151007] Fixed mod_fastcgi issues on firmware v04.04.00-308 which caused WD DashBoard not loading.
[20151009] Fixed perl-fcgi permission issues from unix:/var/run/perl-fcgi.sock to unix:/tmp/perl-fcgi.sock.
[20160112] Added UnRAR v5.30 support.
12 Likes
  1. You can modify apache2 configs to use as normal webserver.

  2. PHP5 and MySql available in my repo:  http://community.wd.com/t5/WD-My-Cloud/Repository-with-software-worked-on-v4-firmware/td-p/829720

Good!:smiley:

Hi  Nazar78,

How about the progress?

I’m awaiting for the owncloud on V4+ firmware.

Fox_exe wrote:

  1. You can modify apache2 configs to use as normal webserver.
  1. PHP5 and MySql available in my repo:  http://community.wd.com/t5/WD-My-Cloud/Repository-with-software-worked-on-v4-firmware/td-p/829720

I love Apache2. It is good for servers with large ram (I have one running smoothly with 16GB ram) but not when it’s using the default mpm-prefork and mod_php5 on the small WDMyCloud 256MB ram especially handing many concurrent request. The memory print is too high.

With Apache2, WDMyCloud randomly freezed when there’s lots of php request that I need to pull off the power to force reboot. I tried modifying Apache2 to run mpm-event and php5-fpm which is slightly better but eventually I gave up and switched to Nginx.

Nginx is very stable so far and never freeze the WDMyCloud. With its low memory print, I can alocate more resources to others such as Memcache and Opcache to speed things up.

wd_pnn wrote:

Hi  Nazar78,

How about the progress?

I’m awaiting for the owncloud on V4+ firmware.

 

Ah I thought there’s no interest on this topic.

I’m left with testing the changes made by the installer on a stock WDMyCloud.

Let me know if there’s anything to include.

Hi Nazar78,

a few minutes ago I installed MiniDLNA through your Web Installer. Absolutely great, now i can finaly resume aborted films! Thanks for that!

I Have got a question about this thread here. would it be possible to youse OwnCloud with it’s cloud capabilities with your installation? The backgound is, that my wife and I are using Windows Phone. And the wd2go app for windows phone is really bad. There is a owncloud app for windows phone though, so if I could install owncloud and youse this app, instead of the wd2go app, it would be absolutly awesome.

As I understand you use owncloud to host a website and not to use the remote access?

Would be nice to hear from you.

Stephan

Hi Stephan,

I don’t have any windows phone, last was win6.5 many years back. Now with android. And I haven’t tried the android OwnClould app (official paid version with mixed reviews). So I’m not sure if any of these apps are good.

But the OwnCloud (desktop & mobile browser) I’m using on this WDMyCloud is quite acceptable in terms of speed and capabilities. It can even mount your whole WD shares (not recommended for large deep folders).

There’s a newer OwnCloud 8.0.2 I’ll be testing soon on WDMyCloud when I have the time. I haven’t released this webhosting to this forum yet because there’s lots of tweaking and testing to be done on stock firmware in order not to break any of WD’s original function i.e. the WD Dashboard or bloat the nas (apache+php+mysql can really bring it down to its knees).

Hi Nazar78,

thanks for the reply. Will you eventually release the owncloud installation as one of your webinstaller versions? Iam not that deep in all this stuff, so your webinstaller was a real easy thing for me. I thought about doing the Clean Debian and OMV installation from the forum, but I think Iam not fit enough to understand everything I do, so mistakes are easy to happen. If you say your version maybe will be here someday, Iam willing to wait for it. If it is unlikely maybe I will take the risk and try the OMV.

Stephan

Hi Stephan,

Yes of course I will eventually release them here. Wordpress is more resource demanding than OwnCloud IMHO. Checkout the speed and response of my Wordpress blog hosted on WDMyCloud 4TB v4 firmware.

I need more time as we do not want anyone breaking anything from my installer. It was the reason why I started sharing with this installer because apt-get can be bricky without proper understanding.

You can checkout the OMV if you like to play around but actually you can just install OwnCloud without OMV or any of my scripts. You don’t even need MySQL which you can use the exisiting Sqlite3. Just need to tweak Apache2. Only that it will be slow running on Apache2.

@ Nazar78

Great news

I am very interested in this project

I would love to have Owncloud on the current firmware i have tried building it and the installation went successful but i got stuck with some dependancies

It would be great to see it running finally

If you need any help in building the packages let me know i am already working on availing packages for firmware 4.X

I have built dovecot and postfix if you are interesting in building your own mail server at the mycloud

They can be found here

http://diaa.no-ip.com:8080/Misc/

I am also interested in Owncloud for WDmycloud and I will be very happy to see an installer here. (Nazar78 I realy like your work with wdmycloud!)

By the way you can download the Owncloud android app, mentioned above, for free through F-droid, the android market for free and opensource apps.

However, by downloading the paid app through Google play, you support app development.

owncloud is a good idea

Everything looks good but now I’m stuck at apache because sudo fail to execute on chroot. This is required by the WD Dashboard else the Dashboard is useless. 

nazar@TeaNazaR:/# sudosudo: unable to stat /etc/sudoers: Permission deniedsudo: no valid sudoers sources found, quittingsudo: unable to initialize policy plugin

I had to use chroot because I can’t afford to test on a stock firmware (I only have one modified WDMyCloud). Since sudo failed, I tried to fake the sudo with setuid C code below. It works but failed when there’s arguments parsed like sed.

#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>

int
main (int argc, char *argv[])
{
  setuid (0);
  char system_str[256];
  switch(argc) {
    case 10:
      snprintf(system_str, 256, "%s %s %s %s %s %s %s %s %s\n", argv[1], argv[2], argv[3], argv[4], argv[5], argv[6], argv[7], argv[8], argv[9]);
      break;
    [...]
    default:
      snprintf(system_str, 256, "echo \"Usage: %s arg1...\"\n", argv[0]);
      break;
  }
    system(system_str);
}

Anyone know how to fix sudo in chroot? Or anyone with a v4 firmware and would like to test? PM me, note it might soft-brick your WD Dashboard and you’re prepared to reflash firmware so on and so forth.

1 Like

@nazar78

i am ready 

sent you a PM

@diaahussein,

You got PM~

ps: I’m done, awaiting testers to confirm. Let me know if you need anything else (Perl not included which can be setup easily):

WebHosting Mods for WDMyCloud V4 Firmware: Nginx, MySQL, ESMTP, UNRAR, PHP5-FPM/CLI/GD/IMAGICK/CURL/MYSQL/SQLITE/MCRYPT/APCU/JSON

can you shares photo about owncloud and webhosting … ?

@aksneo

For OwnCloud, you can see on their official demo site here: https://demo.owncloud.org/

For webhosting? I’m not sure about the photo you’re saying but it’s to run your own website on the nas without paying for a webhoster. Remember where you’re getting the user/pass for the pyload/transmission installer script? It’s hosted on the nas, WDMyCloud. It could be any website, doesn’t have to be OwnCloud. But you’ll need to have some knowledge on how to install and run this.

@nazar78 

thanks

but i think it is very hard for me new user.

i used the demo, it was very quickly.

and it is very developed than wd cloud app.

has it got a price?

It’s not that hard really, but you need some knowledge, google can help if you have the interest. I’ll also provide some backend setups, the rest is up to you to continue. Most experienced users can go on their own setting up webapps they need.

The demo is very quick because it’s running on dedicated webhost server with way better specs in terms of resources cpu/ram etc. Don’t expect too much on our home nas :stuck_out_tongue:

It’s free for non enterprise version (personal use).