OwnCloud on WDMyCloud V4 Firmwares

OwnCloud V8
OwnCloud V8

 

Disclaimer: As I’m frequently updating the original guides and installers here on TeaNazaR.com, I will not be responsible for any brick issues if you were to follow my obsolete guides copied elsewhere. Thus subscribe to this post to get latest updates. Modifying any part of a device may void its warranty.

 

Similar to my WordPress installation guide here, there’s two method of running OwnCloud, first with a secondary domain (http://secondary-domain.primary-domain.com) or sub-path (http://primary-domain.com/sub-path).

Sub-path method is fairly easy to install so I’ll skip it and proceed to secondary domain (a.k.a. subdomain). You can also use this method if you own a full qualified domain (http://www.domain.com).

1) Prepare your WDMyCloud
I’ve separated the Web Server perquisites and installations in another guide. Please follow the guide WebHosting on WDMyCloud V4 Firmwares then comeback to this post to complete your OwnCloud installations on the WDMyCloud.


2) Prepare OwnCloud
We’ll use the manual method instead of the online “setup-owncloud.php” because sometimes the download wizard may timeout. This is version 8.2.2 at the time of published. You can use this version then upgrade to the latest version (highly recommended) or look for a newer version on their official website. Issue the commands below on your SSH shell session:


3) Prepare Nginx WebServer
Edit a new config file:
nano /etc/nginx/sites-available/owncloud

Paste and edit below as needed. Take note of the server_name parameter and replace it with your acquired earlier DDNS subdomain or your full qualified domain if you own it:

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


4) Enable the new configs
Activate the new owncloud config file:

Check if the new owncloud config is good:
service nginx configtest

If failed, find out why in the log and fix it:
more /var/log/nginx/error.log

Reload Nginx:
service nginx reload

Or if you have changed the listening ports:
service nginx restart

Note that you’ll also need to reload the PHP-FPM Daemon every time you make manual edits to the PHP scripts content or settings else you won’t see the changes. They are commonly files with “*.php” extension. This is perfectly normal for performance, due to precompiled scripts memory caching by PHP Opcache. The easiest way to clear the cache:
service php5-fpm reload


5) Setup OwnCloud
Browse to your domain or the free DNS forwarder you got earlier to start the setup:
http://my-freedns-subdomain-owncloud.mooo.com/

Or if you know what you’re doing and have set Nginx’s default server differently, just browse the WDMyCloud internal host/IP:
http://wdmycloud:5080/

a. Provide Username and Password of your choice under “Create an admin account“.

b. Click “Storage & database” and select “MySQL/MariaDB“.

c. Leave “Data folder” as “/DataVolume/owncloud/data“.

d. Provide the Database details:
DB-user=root
DB-password=(leave blank unless you’ve changed MySQL root password)
DB-name=owncloud
DB-host=localhost

e. Click “Finish setup“, the database will be created soon after you’ll see the main page. You can do system mount or OwnCloud mount or symlink your “/shares/user” but you’ll enjoy better experience after its internal cache build up complete especially if you have large libraries. For help and details or OwnCloud related errors, please refer to http://doc.owncloud.org.


6) Upgrade OwnCloud [Optional]
When there’s a newer version released, the “Update Center” sometimes doesn’t work due to timeout. But you could easily upgrade by just issuing the following command:
sudo -u www-data php /DataVolume/owncloud/occ upgrade

Updated: Guide updated to version 8.2.2. Note this is the last version of OwnCloud v8.

Enjoy (-:

63 thoughts on “OwnCloud on WDMyCloud V4 Firmwares”

  1. I can’t upgrade Owncloud with method you told

    PHP is configured to populate raw post data. Since PHP 5.6 this will lead to PHP throwing notices for perfectly valid code.
    To fix this issue set always_populate_raw_post_data to -1 in your php.ini

    Help me~~

    1. Hi Jim,

      Thanks for sharing. Yes I’m aware of this but the PHP version 5.6.7-1 I’m using which is also included in my installer has this value uncommented by default so the value is “-1” for both FPM and CLI as reported by phpinfo(). And I don’t see deprecated notices while upgrading via CLI occ.

  2. I followed your instructions with the exception of the freedns. I commented that portion from the scrip as i do not want one. Once I attempted to run the nginx web server this is the message I received. Can you please help me?

    Welcome to nginx on Debian!
    If you see this page, the nginx web server is successfully installed and working on Debian. Further configuration is required.

    For online documentation and support please refer to nginx.org

    Please use the reportbug tool to report bugs in the nginx package with Debian. However, check existing bug reports before reporting a new bug.

    Thank you for using debian and nginx.

    1. Hi Lucian,

      You’re seeing the default Nginx welcome page because Nginx doesn’t know the virtual host “server_name” you wanted to show so it’s showing the “default” in /etc/nginx/sites-enabled/default containing server_name _;. If you were to follow my guide exactly, you will notice that the server_name _; is different for OwnCloud. E.g. if you have a domain “lucian.com“, then the /etc/nginx/sites-enabled/owncloud will contain server_name lucian.com;. Or if you know what you’re doing and wanted to point all IPs and unknown host to a specific setup, listen 5080 default_server; is the key you should look for and note you should not have duplicate “default_server“. After doing these changes, reload/restart Nginx.

      1. To be honest this is the best guide for setting up the WD My Cloud. You are very detailed and extremely helpful. I’ve been searching for weeks how to do this and yours is the best and it work. Thank you very much.

  3. Nazar,

    you are one hell of a linux guru. This is the most easiest installation i have ever done.
    the only thing is that when i generated user/pass from your website, there was an extract line for “key”.. . This wasn’t written on your post at the WD forum, but hey, i used it anyway.

    many thanks and more power !
    export NAZAR78_USER=user;
    export NAZAR78_PASS=pass;
    export NAZAR78_KEYS=keys;

    1. Hi Glenn,

      I just recently implemented the “key” to combat bots but the guides hasn’t been updated at the WD forum. It’s supposed to be unique every time the installer is being requested. If you noticed, it’s actually the captcha itself 🙂

  4. Hi Nazar,

     

    First of all, thank you for all your wonderful work for this community.   I finally decide to give up v3 and update my firmware t0 v4,  which I should have done earlier.

    I have successfully installed the Ngnix webserver and I can access via http://mis-wdmycloud:5080/ and http://66.215.160.253 after modify the router forwarding port.  The problem I am having now is that I lost the access to Dashboard.  It will redirect to http://192.168.10.120/UI/ and give me “file not found’ error.

    I did go through your post http://community.wd.com/t5/My-Cloud/Hosting-a-website-on-WD-My-Cloud/td-p/836200/page/2.   I can not seem to get it work.  Please advise and help.

    Thanks again for everything.

    Tony

    1. Hi Tony,

      There’s a bug when installing my WebHosting Mods with the latest firmware .308 which is not compatible with MOD_FASTCGI. I’m still looking into this, wait for my updates. If you urgently need to fix the DashBoard, do a quick fix below.

      Quick fix (but Apache2 will be back using high resources, this is as per-stock firmware):

      a2dismod mpm_event fastcgi;
      
      a2enmod mpm_prefork php5;
      
      service apache2 restart;
  5. Hello Nazar,

    I installed Owncloud successfully with your instruction. I tried to have a wordpress site setup the similar way, with no luck. I have a copy of wordpress in /DataVolume/shares/wordpress folder, opened the port 5081 in my router. What did I do wrong? following is my configure setting.

    Thanks again for all the good stuff.

    -Tony

    server {
    listen 5081;
    # Uncomment below if you have a valid SSL certificate (HTTPS).
    #listen 5443 ssl;
    #ssl_certificate /etc/apache2/certs/server.crt;
    #ssl_certificate_key /etc/apache2/certs/server.key;
    # Change server_name to the DNS forwarder domain you have.
    server_name misftp.us.to;
    # Full path to OwnCloud.
    root /DataVolume/wordpress;
    index index.php;
    }

    1. Hi Tony,

      I’ve checked your domain, seems Nginx is successfully installed though I see a login prompt.

      In my guide, the port for Nginx is 5080 but you chose 5081 instead. This is ok as long as you’ve forwarded the correct port 80->5081. JFYI you can share port 5081 for both OwnCloud and WordPress or more differentiated by two server directives with unique server_name.

      The only possible mistake I see in your config is root /DataVolume/wordpress; as you said your WordPress is in /DataVolume/shares/wordpress. Also for slug names to work in WordPress, you’ll need these in the server directive:

      	location / {
      		try_files $uri $uri/ /index.php?$args;
      	}
      1. Hi Zazar,

        Sorry about this trouble. Now I got “Bad Gateway Time Out” error. html seems works fine. Any thoughts? http://misftp.us.to:5081/readme.html

        server {
        listen 5081;
        server_name localhost;
        root /DataVolume/wordpress;
        index index.php;
        location / {
        try_files $uri $uri/ /index.php?$args;
        }

        location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        # NOTE: You should have “cgi.fix_pathinfo = 0;” in php.ini

        # With php5-cgi alone:
        fastcgi_pass 127.0.0.1:9000;
        # With php5-fpm:
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
        }
        }

        1. Hi Tony,

          You have two fastcgi_pass in your directive, my php5-fpm installer only enabled the unix socket but not TCP:9000. I believe your config is trying to forward the PHP request to http://127.0.0.1:9000 which is not available. So remove or comment out fastcgi_pass 127.0.0.1:9000; and leave the fastcgi_pass unix:/var/run/php5-fpm.sock;. Else check your Nginx/PHP logs for hints.

              1. Hi Tony,

                You spotted another bug. Refer to my previous updates here for the fix.

  6. I’ve been following your guide but I got a bit lost in the webpage hosting + owncloud.
    First OwnCloud:
    I want to be able to access the owncloud webpage from local network without using a DDNS. The thing is I don’t know what to enter in the server_name option in the owncloud configuration file.
    I tried with ‘localhost’, but whenever I enter the device IP:5080 the browser loads the nginx webpage.

    I do have (a temporary) DDNS and I’ve been able to enter the owncloud webpage, but I want to use a different port than 80, wheream I suppose to change the variable SERVER_PORT?
    In the ‘sites-available’ owncloud file?

    Now why?
    I want to run two owncloud server on the same LAN and I’d like to be able to access them either locally (with the address wdmycloud:5080) AND remotely (mys_ddns_something.org:1234 for one device and mys_ddns_something.org:1235 for another).
    I’d also like to have a webpage which should access the port 80.
    Alternatively I could just use the port 80 and change the address (mys_ddns_something.org/wdone and mys_ddns_something.org/wdtwo)?

    I’m kind of lost here.

    1. It’s quite simple actually. The reason why you’re seeing the default Nginx page is because “all unknown hostname/ip” will be directed to Nginx’s default config /etc/nginx/sites-enabled/default, under directive listen 5080 default_server; and server_name _. Meaning if you use 127.0.0.1:5080, localhost:5080, wdmycloud-lan-ip:5080, wdmycloud:5080 or even your-ISP-IP-or_Hostname:80, you’ll end up seeing Nginx’s default page.

      The key setting is server_name, place the IP(impossible unless you own multiple IPs) or DDNS or local hostname there to make Nginx look for which site you’re pointing to. This is similar to Apache2’s virtual host. Also this is how a webhosting company setup multiple sites on a single server by segregating multiple IPs and hostnames. I have several DDNS running on WDMyCloud all pointing from port 80(router) to 5080(WDMyCloud). If you find it confusing, I suggest that you use multiple DDNS instead of multiple ports. Create separate config for each DDNS all listening to port 5080.

      As for your LAN, once you have setup your DDNS, your router is smart enough to route back the ports and DDNS names to your LAN without going out into the internet to resolve your DNS every time. Meaning just access the DDNS on port 80 within your LAN e.g. yourddns.org, need not use wdmycloud:5080. How to test if the traffic is all within your local network? From your PC, ping your DDNS, it’s <1ms RRT 🙂

      1. I guess I’m not understanding the server_name parameter.
        AS far as I understand, this paramtere should contain the ”address of the server”, ¿right?
        In a local network (let’s say without internet), I could input the machine IP here and then I could access the machine by its IP, right?

        If I put 192.168.0.2, by example, I could enter by writing “192.168.0.2:5080” in the browser address bar?
        Or should I put the whole name, including the port? “192.168.0.2:5080”

        (I’ve tried both and none are working for me, using a DDNS works though).

        On another subject, I’d also like to be able to use another port, because I want to use the port 80 for another IP (I have more than one device to where I want to forward the ports) and didn’t understand from this webpage.

        I’m very grateful for your answers.

        1. Okay, I’m now able to access the owncloud webpage using the local IP (added the ip to the server_name parameter, but can’t get to it using it hostname (wdmycloud:5080 just loads the default webpage, I guess I still don’t know what to enter in the server_name parameter).
          I could use it using the ddns, but I want to use the owncloud server locally (no internet) also.

          I still haven’t found how to use a different por than 80 to be able to access two different machines.
          I’ll just keep reading.

          1. Using multiple ports is rather confusing especially if you need to manage several port forwardings on your router. I used to do this but now I kept it simple. I’m also hosting on several local devices and all from one port 80 forwarded from the router. The trick is to let Nginx on WDMyCloud become the front-end proxy by using internal rewrites redirecting each request to the intended local devices.

            But for the sake of answering your doubts:-

            server_name parameter should only contain one or more virtual “hostname” (wildcards/regexp are possible) separated by spaces, not IP:port. Nginx will look for this when you access the browser by hostname. In this case it’s the DDNS name or the device hostname. If the hostname is not found, Nginx will return the default server. See Nginx’s doc here.

            If you access by local IP and port e.g. “192.168.0.2:5080” in the address bar, then it’s the listen 5080 parameter you need to look into. See Nginx’s doc here. But for your case since you insisted on multiple ports, you need to use another port other then 5080 because wdmycloud:5080 is already used as the default server in /etc/nginx/sites-enabled/default -> listen 5080 default_server;. Remember that if you use a different port on your new setup, you also need to have a separate include fastcgi_params parameter currently pointing to /etc/nginx/fastcgi_params. I’ve changed the contents in my installer to suit our WDMyCloud, so you need to create a similar file to include for your new setup using the default value fastcgi_param SERVER_PORT $server_port else your script might fail to do perform redirects.

            Finally don’t forget to reload your changes after every edits to any of your conf files service nginx restart.

  7. Hi Nazar,
    Although I run two websites and have used Linux as My computer operating system for some years My ability to use a terminal is limited.
    Is it possible for you to install OwnCloud and wordpress on MyCloud for Me with a donation if so what would be reasonable ?
    Regards
    John

    1. Hi John,

      Not a problem at all. If you like I could also help to migrate your websites to WDMyCloud provided it doesn’t require much CGI/DB code changes else you’ll need professional service which I could also provide as freelance. For the donation amount, I’ll leave it to your generosity you deem fit for my efforts. Let me know the details i.e. temporary root password to your WDMyCloud. I already have your IP from this post or let me know if you have a different IP for the WDMyCloud. Please don’t post those details here, instead send them to my feedback form http://teanazar.com/feedback/ and we’ll communicate via email.

        1. Hi John,

          Really glad that you’re happy with the WordPress and OwnCloud installations on both your MyClouds. Let me know if you need further assistance anytime. Also many thanks again for your very generous donation, it’s the highest so far I’ve received (-:

            1. Hi John,

              I would recommend using WinSCP instead. Almost similar to FileZilla but I prefer the ease of use for WinSCP i.e. CTRL+[p] to quickly open putty.

              After installing, run it and enter your MyCloud details from the “New Site” session. E.g. “File Protocol” select SFTP, “Host name” MyCloud, “Port number” leave default 22, then enter the credentials. Click “Save” then “Login”.

  8. I’m Stuck at the test part this is what I get on the error log:

    DarwinCloud:/DataVolume/owncloud# cd /etc/nginx/sites-enabled;
    DarwinCloud:/etc/nginx/sites-enabled# ln -s ../sites-available/owncloud owncloud;
    DarwinCloud:/etc/nginx/sites-enabled# service nginx configtest
    [FAIL] Testing nginx configuration: failed!
    DarwinCloud:/etc/nginx/sites-enabled# more /var/log/nginx/error.log
    2015/12/11 09:56:38 [emerg] 16342#0: could not build the server_names_hash, you
    should increase server_names_hash_bucket_size: 32
    2015/12/11 10:03:37 [emerg] 16978#0: could not build the server_names_hash, you
    should increase server_names_hash_bucket_size: 32
    2015/12/11 10:08:26 [warn] 17376#0: server name “/DataVolume/owncloud” has suspi
    cious symbols in /etc/nginx/sites-enabled/owncloud:17
    2015/12/11 10:08:26 [emerg] 17376#0: could not build the server_names_hash, you
    should increase server_names_hash_bucket_size: 32
    2015/12/11 10:08:42 [warn] 17412#0: server name “/DataVolume/owncloud” has suspi
    cious symbols in /etc/nginx/sites-enabled/owncloud:17
    2015/12/11 10:08:42 [emerg] 17412#0: could not build the server_names_hash, you
    should increase server_names_hash_bucket_size: 32
    2015/12/11 10:51:29 [warn] 20536#0: server name “/DataVolume/owncloud” has suspi
    cious symbols in /etc/nginx/sites-enabled/owncloud:17
    2015/12/11 10:51:29 [emerg] 20536#0: could not build the server_names_hash, you
    should increase server_names_hash_bucket_size: 32
    2015/12/11 10:54:47 [warn] 20771#0: server name “/DataVolume/owncloud” has suspi
    cious symbols in /etc/nginx/sites-enabled/owncloud:17
    2015/12/11 10:54:47 [emerg] 20771#0: could not build the server_names_hash, you
    should increase server_names_hash_bucket_size: 32
    2015/12/11 10:55:11 [warn] 20815#0: server name “/DataVolume/owncloud” has suspi
    cious symbols in /etc/nginx/sites-enabled/owncloud:17
    2015/12/11 10:55:11 [emerg] 20815#0: could not build the server_names_hash, you
    should increase server_names_hash_bucket_size: 32
    2015/12/11 10:55:38 [warn] 20963#0: server name “/DataVolume/owncloud” has suspi
    cious symbols in /etc/nginx/sites-enabled/owncloud:17
    2015/12/11 10:55:38 [emerg] 20963#0: could not build the server_names_hash, you
    should increase server_names_hash_bucket_size: 32
    2015/12/11 11:05:57 [warn] 22070#0: server name “/DataVolume/owncloud” has suspi
    cious symbols in /etc/nginx/sites-enabled/owncloud:17
    2015/12/11 11:06:14 [warn] 22176#0: server name “/DataVolume/owncloud” has suspi
    cious symbols in /etc/nginx/sites-enabled/owncloud:17
    2015/12/11 11:06:21 [warn] 22215#0: server name “/DataVolume/owncloud” has suspi
    cious symbols in /etc/nginx/sites-enabled/owncloud:17
    2015/12/11 11:06:22 [warn] 22219#0: server name “/DataVolume/owncloud” has suspi
    cious symbols in /etc/nginx/sites-enabled/owncloud:17
    2015/12/11 11:06:33 [error] 22221#0: *1 directory index of “/usr/share/nginx/htm
    l/” is forbidden, client: 192.168.1.100, server: 192.168.1.91, request: “GET / H
    TTP/1.1”, host: “192.168.1.91:5080”
    2015/12/11 11:06:33 [error] 22221#0: *1 FastCGI sent in stderr: “Primary script
    unknown” while reading response header from upstream, client: 192.168.1.100, ser
    ver: 192.168.1.91, request: “GET / HTTP/1.1”, upstream: “fastcgi://unix:/var/run
    /php5-fpm.sock:”, host: “192.168.1.91:5080”
    2015/12/11 11:06:37 [error] 22221#0: *1 directory index of “/usr/share/nginx/htm
    l/” is forbidden, client: 192.168.1.100, server: 192.168.1.91, request: “GET / H
    TTP/1.1”, host: “192.168.1.91:5080”
    2015/12/11 11:06:37 [error] 22221#0: *1 FastCGI sent in stderr: “Primary script
    unknown” while reading response header from upstream, client: 192.168.1.100, ser
    ver: 192.168.1.91, request: “GET / HTTP/1.1”, upstream: “fastcgi://unix:/var/run
    /php5-fpm.sock:”, host: “192.168.1.91:5080”
    2015/12/11 11:07:06 [error] 22221#0: *1 directory index of “/usr/share/nginx/htm
    l/” is forbidden, client: 192.168.1.100, server: 192.168.1.91, request: “GET / H
    TTP/1.1”, host: “192.168.1.91:5080”
    2015/12/11 11:07:06 [error] 22221#0: *1 FastCGI sent in stderr: “Primary script
    unknown” while reading response header from upstream, client: 192.168.1.100, ser
    ver: 192.168.1.91, request: “GET / HTTP/1.1”, upstream: “fastcgi://unix:/var/run
    /php5-fpm.sock:”, host: “192.168.1.91:5080”
    2015/12/11 11:38:26 [emerg] 24477#0: could not build the server_names_hash, you
    should increase server_names_hash_bucket_size: 32
    2015/12/11 11:49:22 [emerg] 25390#0: could not build the server_names_hash, you
    should increase server_names_hash_bucket_size: 32
    2015/12/11 11:49:29 [emerg] 25426#0: could not build the server_names_hash, you
    should increase server_names_hash_bucket_size: 32
    2015/12/11 11:49:36 [emerg] 25464#0: could not build the server_names_hash, you
    should increase server_names_hash_bucket_size: 32
    2015/12/11 12:25:26 [emerg] 7142#0: could not build the server_names_hash, you s
    hould increase server_names_hash_bucket_size: 32
    2015/12/11 16:38:14 [emerg] 14743#0: could not build the server_names_hash, you
    should increase server_names_hash_bucket_size: 32
    2015/12/11 16:59:21 [emerg] 2105#0: could not build the server_names_hash, you s
    hould increase server_names_hash_bucket_size: 32
    2015/12/11 17:33:49 [emerg] 6992#0: could not build the server_names_hash, you s
    hould increase server_names_hash_bucket_size: 32
    2015/12/11 19:08:24 [error] 31657#0: *2 FastCGI sent in stderr: “Primary script
    unknown” while reading response header from upstream, client: 192.168.1.100, ser
    ver: _, request: “GET /favicon.ico HTTP/1.1”, upstream: “fastcgi://unix:/var/run
    /php5-fpm.sock:”, host: “192.168.1.91:5080”, referrer: “http://192.168.1.91:5080
    /”
    2015/12/11 19:21:03 [emerg] 1774#0: could not build the server_names_hash, you s
    hould increase server_names_hash_bucket_size: 32
    DarwinCloud:/etc/nginx/sites-enabled# service nginx restart
    [FAIL] Restarting nginx: nginx failed!
    DarwinCloud:/etc/nginx/sites-enabled# service nginx reload
    [FAIL] Reloading nginx configuration: nginx failed!
    DarwinCloud:/etc/nginx/sites-enabled# service php5-fpm reload
    [ ok ] Reloading PHP5 FastCGI Process Manager: php5-fpm.
    DarwinCloud:/etc/nginx/sites-enabled#

      1. Hi Nazar,

        Im runung on my WD My cloud 3TB Connected to my att verse i opened the SSH and followed the instruction word by word. Only difference is that my modern does not allow for me to forward different port inside and outside.

        1. # Below should have already been set in /etc/nginx/sites-enabled/default.
          # Uncomment if you have removed the default config.
          #upstream php5-fpm.sock {
          # server unix:/var/run/php5-fpm.sock;
          # keepalive 1;
          #}

          server {
          listen 5080;
          # Uncomment below if you have a valid SSL certificate (HTTPS).
          #listen 5443 ssl;
          #ssl_certificate /etc/apache2/certs/server.crt;
          #ssl_certificate_key /etc/apache2/certs/server.key;
          # Change server_name to the DNS forwarder domain you have.
          server_name darwinsoncloud.mooo.com;
          # Full path to OwnCloud.
          root /DataVolume/owncloud;
          index index.php;
          rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect;
          rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect;
          rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect;
          error_page 403 /core/templates/403.php;
          error_page 404 /core/templates/404.php;
          location ~ ^/(data|config|\.ht|db_structure\.xml|README) {
          error_log off;
          deny all;
          }
          location / {
          rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
          rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;
          rewrite ^/.well-known/carddav /remote.php/carddav/ redirect;
          rewrite ^/.well-known/caldav /remote.php/caldav/ redirect;
          rewrite ^(/core/doc/[^\/]+/)$ $1/index.html;
          try_files $uri $uri/ /index.php?$args;
          }
          location ~ ^(.+?\.php)(/.*)?$ {
          include snippets/fastcgi-php.conf;
          include fastcgi_params;
          fastcgi_pass php5-fpm.sock;
          }
          }

          1. Hey Nazar
            Forget the problems I change the port to 5081 and it is working fine.

            Only problem I’m having is updating the actual own cloud

            PHP is configured to populate raw post data. Since PHP 5.6 this will lead to PHP throwing notices for perfectly valid code.
            To fix this issue set always_populate_raw_post_data to -1 in your php.ini

            is my error

  9. Hi,Nazar.
    thank you for this installations.
    i Successfully installed owncloud.
    but when setup owncloud,i get a error.
    when Click “Storage & database” and select “MySQL/MariaDB“.
    then Click “Finish setup“,
    There is an error prompt as follows:
    Internal Server Error
    The server encountered an internal error and was unable to complete your request.
    Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
    More details can be found in the server log.

    if i Click “Storage & database” and select “sqlite“
    it can work, but it’s speed is very slow.
    what’s wrong? can you help me?
    thanks very much.

    1. Did you use the version 8.0.3 from my guide or you tried installing the latest ones? There could be changes in the newer versions which you can check from their official website, I haven't tried. Is MySQL running? Try login from the SSH console mysql;, if you've changed the MySQL root password, mysql -p;. Also check the Nginx error logs for hints, tail /var/log/nginx/error.log;.

      Edited: I looked at your screenshot again, this doesn't look like it's from Nginx. You're hitting another server, either Apache (highly doubt it's from WD) or your RT-AC68U router's page. Ensure the port forwarding is being done correctly.

      1. hi,Nazar
        RT-AC68U router’s setting is as image showing.
        after installing “[APP] WebHosting for firmware V4+ (10/2015)”
        then comeback to this post to complete OwnCloud installations on my WDMyCloud.
        in there something else will be needed to do?
        thanks

      2. can you tell me how to fully reset owncloud?
        i del owncloud dir ,and reinstalled owncloud
        but when Create an admin account with database “sqlite”(if select “MySQL/MariaDB“, it’s error )
        it said that the user is be used
        maybe some other files and dirs need to del too?
        thanks very much

      3. wget download.owncloud.org/community/owncloud-8.0.3.tar.bz2;

        but actually , the downloaded file is 9.0.1,not 8.0.3
        although it’s name is owncloud-8.0.3.tar.bz2
        i can’t find owncloud-8.0.3.tar.bz2 on download.owncloud.org
        thanks

        1. I can see v8.0.3 here https://owncloud.org/changelog/.

          To reset OwnCloud, you'll need to login to MySQL mysql;, then drop the owncloud database, mysql> DROP DATABASE owncloud;.

          Also I tried to access your port 5080, it's not opened, means the port forwarding to MyCloud failed. You'll need to fix this first, try reboot your router.

          By the way my installer points fastcgi ports to 80/443, means you'll need to forward ports 80->5080 and 443->5443. If you want to use 5080/5443, you'll need to replace the ports from 80/443 to 5080/5443 in this file nano /etc/nginx/fastcgi_params;:

          #Nazar78
          if ($scheme = https) { set $_server_port 5443; }
          if ($scheme = http) { set $_server_port 5080; }
          fastcgi_param  SERVER_PORT        $_server_port;
          limit_req zone=fastcgi burst=5;`
          # Nazar78
          1. here https://owncloud.org/changelog/.
            the “owncloud-8.0.3.tar.bz2” is v9.0.1 not v8.0.3
            but “owncloud-8.0.3.zip” is right (v8.0.3)
            i replace the ports from 80/443 to 5080/5443 in this file nano /etc/nginx/fastcgi_params; reboot router ; and then install “owncloud-8.0.3.zip” , but when select “MySQL/MariaDB“ , there is same errors as before
            mysql> DROP DATABASE owncloud; it don’t work ,error showing like image
            thanks

            1. sorry.
              “mysql> DROP DATABASE owncloud;”
              only input “DROP DATABASE owncloud;”
              it show me “Query OK, 0 rows affected (0.19 sec)”
              this means that database owncloud is be deleted.
              but it still said that the use id is be used.
              seems that owncloud was not fully rest.
              in there something else will be needed to do?
              thanks

              1. There's usernames created in the MySQL for OwnCloud with oc_ prefix.

                mysql> select user, host from mysql.user where user like 'oc_%';

                You can remove them if no longer needed.

                mysql> drop user 'oc_[user]'@'[host]';

                Finally use the flush privileges command if necessary.

                mysql> flush privileges;

Leave a Reply

Your email address will not be published. Required fields are marked *

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax