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

Installer updated on the 1st post! Many thanks especially to diaahussein for helping to test out the WD DashBoard speed and bugs before I release to the public.

Lots of packages:

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/A​PCU/JSON

I’ve include OwnCloud v8 setup guide at the end of the 1st post. Enjoy (-:

1 Like

thanks

i want to try very much

but i am afraid damaged my wd cloud

maybe step by step

and teenazar.com doesnt open now

@nazar78

Thank you Nazar for your great efforts

I am installing the Owncloud now :slight_smile:

excellent and comprehensive Guide for the installation :slight_smile:

Great job man 

1 Like

@ aksneo

check the link in teh first post it contains detailed step by step

OwnCloud on WDMyCloud V4 Firmwares

cheers

1 Like

@diaahuseyin

İ can’t open this website :frowning:
Can i access the dashboard out of the home ?
Can i used wd cloud and my owncloud same time or only myowncloud ?

@aksneo
Just checked it
and it is working fine

i tried open this with safari

now i can open this site with chrome

thanks.

@Diaa,

No problem. And thanks for all the testings despite timezone differences. Hope to work together again soon :slight_smile:

@askneo,

Think there’s a WordPress 4.2 upgrade and my site on the WDMyCloud is running on 4.1.2. Maybe the auto upgrade got issues therefore it breaks on some browser. I’ve no time to check now but it’s great that Chrome works.

I’ve tried my very best to cater this project for beginners without breaking anything. Anything missed out do let me know.

@Nazar78

firstly i get freedns.

1-  Terminal

crontab -e

2-crontab

*/5 * * * * /usr/bin/curl freedns.afraid.org/dynamic/update.php?RllWcksfRUY5afdyUGNgdVcwQs43ejROhjEyNTfxgjQw >/dev/null 2>&1

**** =  myusername.mooo.com ?

3-will i open port 5080 same 8080 or 9091

4-will i install webhostinh for firmware v4+

5-then i will setup owncloud (i will skip the other steps)

Quesitons ?

1 - can i use wd cloud,wd for ios application ?

2 - can i use wd dashboard ?

3 -

thanks for helps 

@aksneo 

2-crontab  **** =  myusername.mooo.com

Not sure if you understood, those asterisks (*) are schedules for crontab not the DNS. See here http://en.wikipedia.org/wiki/Cron#Configuration_file

3-will i open port 5080 same 8080 or 9091

Not open port 5080, but open port 80 on the router to forward to wdmycloud:5080. Nginx(OwnCloud) I have set to run on port 5080 so will not conflict with Apache2(WD Dashboard) port 80.

If you open port 80->wdmycloud:5080

So you can access http://myusername.mooo.com/.

But if you open port 5080->wdmycloud:5080 you need to browse with the not so good looking http://myusername.mooo.com:5080/.

Note that *.mooo.com is just an example. There’s lots of domain you can choose from :slight_smile:

For your questions 1-2, yes you can continue to use the WD IOS apps, access network shares and WD Dashboard as per normal. My installer only upgrade and tweak those WD stuffs.

The only thing new here is that you can setup and run your personal websites like OwnCloud. Not just one website, but you can run multiple vhost websites, just get a new DNS for each and create the new config.

Hi all,

To those who already installed this till today (27th Apr 2015 6PM GMT+8). You might wanna do some minor changes without installing the whole package again. This is to resolve invalid port redirect in certain WebApps. If you have installed after this post, it’s already implemented in the installer so no changes required.

The related updated step is below:

2) Prepare your router if not done so
This is usually unnecessary for standard Nginx install which you could just forward the same ports 80/443 between externally and internally. But since we’re integrating with Apache2, you’ll need to perform some changes else there’ll be port conflicts between Nginx and Apache2 as both are by default using ports 80/443.

Forward TCP external port 80 on your router to the WDMyCloud internal IP/HOST address PORT:5080. If port 80 is already taken on your router or port 80 is blocked by your ISP, you can choose other ports like 5080 itself but you’ll then need to specify the port manually when accessing from the internet e.g. http://my-freedns-subdomain.mooo.com:5080/ or http://your-ISP-IP-address:5080/. Also if your forwarded external port is other than 80 due to these two reasons, you’ll need to change all occurrences of Nginx’s fastcgi_param SERVER_PORT $server_port variable to whatever external port you’ve chosen. One example of the occurrences is in /etc/nginx/fastcgi_params.

If you have a valid SSL certificate (HTTPS), forward port 443 to wdmycloud:5443 as well. With the port routing below, you can have multiple websites running on single port 80/443 of your router thanks to Nginx’s “server_name” similar to Apache2’s VHOST:
Router TCP port(80) -> WDMyCloud TCP port(5080)
Router TCP port(443) -> WDMyCloud TCP port(5443)

Edit the file ‘/etc/nginx/fastcgi_params’ and change below:

nano /etc/nginx/fastcgi_params;

Look for the following:

fastcgi_param SERVER_PORT $server_port;

Replace with (please include #Nazar78 comments because if you were to use my installer again in the future maybe for this mod upgrade, it will help to determine the required changes):

#Nazar78
if ($scheme = https) { set $_server_port 443; }
if ($scheme = http) { set $_server_port 80; }
fastcgi_param SERVER_PORT $_server_port;
#Nazar78

When done, “CTRL+x” to exit and “y” to save changes to the file.

Reload this new config:

service nginx reload;

i cannot solve dinamik dns.

i must buy static ip.

then i will try them.

but i cannot open your site with my safari chrome and explorer

thanks 

Thanks for this guide!

The installation of Owncloud worked like a charm.

I can confirm that there seems to be a problem with your site:

Chrome reports

"

This webpage has a redirect loop

ERR_TOO_MANY_REDIRECTS"

IE opens the site but Avast warns for 

JS:Redirector-BEE [Trj]

(Url 
http://sa.entireweb.com/sasense45?nc=1430337205032&cl=fc792b9462c6cb9cbb8c190a5cab58fa&pl=0&bgc=FFFFFF&sbc=000000&bc=000000&lc=24890D&dc=000000&uc=24890D&b=1&m=2&o=h&w=468&h=60&f=banner_468x60&lo=0&s=0&rsd=14303372050321448051633&bw=1&font=0&rd=10&scd=1366_13|{gzip}

aksneo wrote:

i cannot solve dinamik dns.

i must buy static ip.

then i will try them.

 

but i cannot open your site with my safari chrome and explorer

thanks 

I do not understand why you need to buy static IP? The free DNS forwarder will work on dynamic IP. There’s many free service to choose from but freedns.afraid.org is the easiest to setup. Check your router/firewall apps if it’s blocking anything. If you could explain your issue maybe we can help.

I can’t help if you don’t provide details what error did you encountered with safari chrome ie. If you can’t explain you can provide a screenshot.

Note recently I came up with a custom blocking mechanism against spam and brute force attacks for my nas’s website, ssh, ftp. If you got banned, you will NOT be able to see this image below:

salapis wrote:

Thanks for this guide!

The installation of Owncloud worked like a charm.

 

I can confirm that there seems to be a problem with your site:

Chrome reports

"

This webpage has a redirect loop

ERR_TOO_MANY_REDIRECTS"

 

IE opens the site but Avast warns for 

JS:Redirector-BEE [Trj]

 

(Url 
http://sa.entireweb.com/sasense45?nc=1430337205032&cl=fc792b9462c6cb9cbb8c190a5cab58fa&pl=0&bgc=FFFFFF&sbc=000000&bc=000000&lc=24890D&dc=000000&uc=24890D&b=1&m=2&o=h&w=468&h=60&f=banner_468x60&lo=0&s=0&rsd=14303372050321448051633&bw=1&font=0&rd=10&scd=1366_13|{gzip}

 

No problem.

For the error “ERR_TOO_MANY_REDIRECTS”, think I was testing something recently for few hours to block bots. Just clear your browser cache.

For the URL you mentioned, it’s an advertisement, I can’t do much about it. Sometimes AV apps/plugins scrutinize the browser too much. I don’t use any of those which will slow down my web browsing. Simply do not execute anything from the web that’s hasn’t been verified.

Hi all,

To those who already installed this till today (8th May 2015 4PM GMT+8). You might wanna do some minor changes without installing the whole package again. This is to allow larger file uploads in PHP (currently limited to less than 100MB due to the default small tmpfs). Also this fixed the session path I overlooked earlier. If you have installed after this post, it’s already implemented in the installer so no changes required.

Copy everything below, paste into your SSH window and press ENTER (you should not see any STDOUT or error):

sed -i "s/output_buffering = 4096/output_buffering = 0/g" /etc/php5/fpm/php.ini;sed -i "s/;upload_tmp_dir =/upload_tmp_dir = \/CacheVolume\/tmp/g" /etc/php5/fpm/php.ini;sed -i "s/;session.save_path = \"\/var\/lib\/php5\/sessions\"/session.save_path = \/tmp/g" /etc/php5/fpm/php.ini;sed -i "s/max_execution_time = 300/max_execution_time = 3600/g" /etc/php5/fpm/php.ini;sed -i "s/max_input_time = 60/max_input_time = 3600/g" /etc/php5/fpm/php.ini;sed -i "s/client_max_body_size 0;/client_body_temp_path \/CacheVolume\/tmp;\nclient_max_body_size 0;/g" /etc/nginx/conf.d/Nazar78.conf;

Reload this new config:

service nginx restart && service php5-fpm restart;

I am getting the following error?  what should I do?  

I did not install the Nginx or any, should I install it beforehand?

root@WallaceEX4 root # curl teanazar.com/installer.fcgi?webhosting-mods_1.0.0|sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 20984 0 20984 0 0 35461 0 --:–:-- --:–:-- --:–:-- 109k
sh: syntax error: unexpected redirection

My installer doesn’t support EX4, EX2 and Mirror variance. Those are running on busybox and I don’t have the devices to support them.

@Nazar78

Is it possible that you could seperate esmtp (or better yet sendmail) from this bundle and make a separate installer for them? I only need the emailing functionality so that I can hook it up to my rsync scripts.

Thank you in advance : )

Sendmail bundled with posfix is too bulky for our nas unless you’re running a mail server. You don’t need esmtp for your rsync task, any script that uses socket can perform the same job like perl, php, python or even bash with netcat. So you could write your own simple smtp script.

p/s: saw your python smtp post, that would work too. But I would recommend not using python as you would have already noticed that python uses a little more cpu. Perl is the best.