1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
Dismiss Notice

Welcome To SNBForums

SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.

If you'd like to post a question, simply register and have at it!

While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!

[HOW-TO] ownCloud on Router

Discussion in 'Asuswrt-Merlin' started by ryzhov_al, Mar 15, 2013.

  1. ryzhov_al

    ryzhov_al Very Senior Member

    Joined:
    Jul 23, 2012
    Messages:
    643
    Location:
    Russia
    This is how-to install ownCloud to router. After then you'll get your own Dropbox-like service. It also provides a platform to easily view & sync your contacts, calendars and bookmarks across all your devices and enables basic editing right on the web.

    Requirements: asuswrt-merlin firmware on board and a USB drive with Entware installation.

    Install necessary packages:
    Code:
    # opkg install \
    bzip2 \
    php5-cgi \
    lighttpd-mod-fastcgi \
    lighttpd-mod-access \
    php5-mod-ctype \
    php5-mod-curl \
    php5-mod-dom \
    php5-mod-fileinfo \
    php5-mod-gd \
    php5-mod-hash \
    php5-mod-iconv \
    php5-mod-json \
    php5-mod-mbstring \
    php5-mod-pdo \
    php5-mod-pdo-sqlite \
    php5-mod-session \
    php5-mod-simplexml \
    php5-mod-sqlite3 \
    php5-mod-xml \
    php5-mod-zip
    Unpack ownCloud:
    Code:
    # cd /opt/share/www/
    # wget http://download.owncloud.org/community/owncloud-5.0.0.tar.bz2
    # bzip2 -cd owncloud-5.0.0.tar.bz2 | tar -xv
    # rm ./owncloud-5.0.0.tar.bz2
    Add to the end of /opt/etc/lighttpd/lighttpd.conf:
    Code:
    server.modules += ( "mod_fastcgi",
                        "mod_access"
    )
    
    fastcgi.server = (
      ".php" =>
        ( "localhost" =>
          ( "socket" => "/tmp/php-fcgi.sock",
            "bin-path" => "/opt/bin/php-fcgi",
            "max-procs" => 1,
            "bin-environment" =>
              ( "PHP_FCGI_CHILDREN" => "2",
                "PHP_FCGI_MAX_REQUESTS" => "1000"
              )
            )
         )
     )
    
    $HTTP["url"] =~ "^/owncloud/data/" {
      url.access-deny = ("")
    }
    
    $HTTP["url"] =~ "^/owncloud($|/)" {
      dir-listing.activate = "disable"
    }
    server.port = 81
    Edit /opt/etc/php.ini:
    Code:
    upload_max_filesize = 100M
    post_max_size = 100M
    memory_limit = 32M
    Make ownCloud available from internet. Enable JFFS and fill /jffs/scripts/firewall-start with:
    Code:
    #!/bin/sh
    /usr/sbin/iptables -I INPUT -p tcp --dport 81 -j ACCEPT
    make it executable:
    Code:
    chmod +x /jffs/scripts/firewall-start
    and reboot router. Point browser to…
    Code:
    http://<ip address of router>:81/owncloud
    …and create new account.

    That's all! Have fun with web interface or client(s), available for most popular desktop/mobile platforms.
     
    Last edited: Mar 15, 2013
    mad_daddy, Dalle and jtp10181 like this.
  2. krabs

    krabs Regular Contributor

    Joined:
    Apr 6, 2013
    Messages:
    82
    Location:
    Limburg Belgium
    Hi
    Do you know how to get external storage working with FTP?
    I have installed the external storage support app in owncloud and php_mod_ftp from entware.
    I can access the ftp share in owncloud but when downloading files there all 0 bytes.
    Uploading seems to work.
    I get this kind of errors
    Code:
    fopen(ftp://[email protected]/data/transmission/Torrent/Completed/archlinux-2013.06.01-dual.iso): failed to open stream: FTP server reports 550 Could not get file size. at /tmp/mnt/entware/share/www/owncloud/apps/files_external/lib/ftp.php#71
    
    stat(): stat failed for ftp://pieter-jan:[email protected]/data/transmission/Torrent/Completed/archlinux-2013.06.01-dual.iso at /tmp/mnt/entware/share/www/owncloud/apps/files_external/lib/streamwrapper.php#81
    
    filetype(): Lstat failed for ftp://pieter-jan:[email protected]/data/transmission/Torrent/Completed/archlinux-2013.06.01-dual.iso at /tmp/mnt/entware/share/www/owncloud/apps/files_external/lib/streamwrapper.php#33
    
     
  3. NeutralGold

    NeutralGold Regular Contributor

    Joined:
    May 2, 2012
    Messages:
    123
    Well the steps are pretty simple but... I get nothing. I can't seem to figure out what the problem is. Installs fine and nothing is apparently wrong. I reboot and try visiting the address and it times out. I've triple checked all FEW settings. Tried setting up a different 4 digit port to use. Made sure the firewall script was executable. I made sure all the packages were installed and overall, rebooted about 6 times.

    No real need for this, I just wanted to check it out. So unless anyone can give me a few idea's on what could be the problem. I give up~ :eek:


    I have transmission and weave-minimal installed for firefox sync. Firefox sync is super useful to me. I hardly ever touch transmission. I don't see any conflict, but just to get out there what I else I have installed.
     
  4. NeutralGold

    NeutralGold Regular Contributor

    Joined:
    May 2, 2012
    Messages:
    123
    My thumb drive I have entware installed on is apparently going bad. After giving up and attempting to remove all traces of owncloud my router locked up while accessing files on the drive. Swapped thumb drives out and everything works fine.
     
  5. NeutralGold

    NeutralGold Regular Contributor

    Joined:
    May 2, 2012
    Messages:
    123
    Very cool alternative to aicloud. Way to beefy for the router though imo. Memory usage is pretty good, and the cpu usage is pretty bad. I guess it's to be expected. If it weren't so slow to navigate and load anything I'd definitely keep it on the router because it doesn't make any impact on any network usage that I could tell.

    I do how ever like it enough to break out my old little webserver and throw it on that.

    Either way, thanks for this.
     
  6. Andycar

    Andycar Occasional Visitor

    Joined:
    Dec 1, 2012
    Messages:
    19
    Thanks! Great app, very versatile compared to AiCloud, although ownCloud seems to be a bit slow.

    One problem - it looks like that I have no more AiCloud functionality when owncloud (lighttpd on port 81) is running... Is anyone else experiencing the same?
     
    Last edited: Jun 16, 2013
  7. Andycar

    Andycar Occasional Visitor

    Joined:
    Dec 1, 2012
    Messages:
    19
    And so, any chance that we could have lighttpd working with both AiCloud AND ownCloud?
     
  8. ryzhov_al

    ryzhov_al Very Senior Member

    Joined:
    Jul 23, 2012
    Messages:
    643
    Location:
    Russia
    Andycar, I think problem is here: both ownCloud and AiCloud uses lighttpd. OwnCloud — from our repo, AiCloud — a bit modified lighttpd from firmware. Some start script may detect\kill both lighttpd instances.

    You may check it by replacing lighttpd with another web server: apache, nginx or mini_httpd.
     
  9. Andycar

    Andycar Occasional Visitor

    Joined:
    Dec 1, 2012
    Messages:
    19
    ryzhov_al, OK, understood. I will try nginx from Entware specially for ownCloud maybe then.
     
  10. JGrana

    JGrana Regular Contributor

    Joined:
    May 31, 2013
    Messages:
    184
    Got it working... but needed a restart of lighttpd

    Using 354.29 Beta 1, installed as per ryzhov's initial post. Did the reboot - and it did not respond to web access...
    So, noticed that there was an instance of lighttpd running, with a conf file located in /tmp. (not in /opt/etc). So, added the lines to the /tmp/lighttpd.conf file - and did a restart (/opt/etc/init.d/S80lighttpd restart).
    ownCloud now works.
    Interesting though - ps now shows lighttpd using the /opt/etc version!

    I will do a bit more experimenting this evening. Maybe just a delayed restart of lighttpd during boot would do the trick.

    Overall - nice cloud package.
     
  11. RMerlin

    RMerlin Super Moderator

    Joined:
    Apr 14, 2012
    Messages:
    28,844
    Location:
    Canada
    That other instance of lighttpd is AiCloud.
     
  12. JGrana

    JGrana Regular Contributor

    Joined:
    May 31, 2013
    Messages:
    184
    Yes, now I see that. I had disabled AICloud before installing.

    So, I tried a few things to see if I could get both to co-exist.
    First, I added a $SERVER["socket"] bind to the instructions on modifying lighttpd.conf. I bound 81 to /opt/share/www.

    Then, killed lighttpd (the one started at boot) then restarted with the same command line.

    Hmm, somewhat confused - when I got to http://192.168.1.1:81/owncloud, I end up with AIclouds landing page, but no login buttons etc.

    So, I ended up adding the following line to /jffs/scripts/services-start:

    /opt/etc/init.d/S80lighttpd restart

    It seems this kills the original lighttpd instance (I don't see it in ps) and runs the version in this thread pointing to the newer lighttpd.conf file...

    which means I can reboot and have owncloud (but no AICloud).

    So, one or the other!
     
  13. Andycar

    Andycar Occasional Visitor

    Joined:
    Dec 1, 2012
    Messages:
    19
    JGrana,
    I have got exactly the same results and conclusion so far...
    Maybe, we have to choose:D
     
  14. slytho

    slytho Occasional Visitor

    Joined:
    Jun 16, 2013
    Messages:
    13
    Which PHP modules are necessary?

    Hi! You list all the mentioned modules as "necessary" for Owncloud. The Owncloud admin manual, however, lists different and also less modules as necessary.

    I like to keep the installation of Owncloud on the N66U router light-weight, so I just like to why you included more and different modules in your list above than the original documentation?

    Thank you a lot!
     
  15. NeutralGold

    NeutralGold Regular Contributor

    Joined:
    May 2, 2012
    Messages:
    123
    I'm gonna make a guess and say that it's probably the platform it's being installed on. It's being installed through entware for the mips architecture. Like most other things being installed through opt/entware, you're not going to see any kind of official support. So that documentation doesn't apply.
     
  16. Meecrob

    Meecrob Occasional Visitor

    Joined:
    Jan 17, 2014
    Messages:
    13
    I just bought the AC56U, installed Asuswrt-Merlin, saw that there is no AiCloud, so i tried to install Owncloud, but it didn't work (because of no entware?!?). Is there any chance to make it work on my router?
     
  17. RMerlin

    RMerlin Super Moderator

    Joined:
    Apr 14, 2012
    Messages:
    28,844
    Location:
    Canada
    AiCloud is there on the RT-AC56U.
     
  18. Meecrob

    Meecrob Occasional Visitor

    Joined:
    Jan 17, 2014
    Messages:
    13
    My Router was working in AP Mode, thats why it didn't show AiCloud option. Changing it to default mode enabled it, but I can't access it from WAN, which I think would work if it would be in AP Mode. Nonetheless is it possible to install Owncloud on it?
     
  19. rod

    rod Occasional Visitor

    Joined:
    Dec 5, 2013
    Messages:
    44
    Location:
    Venezuela
    Almost done with last Owncloud 6.0.3

    Hi ryzhov_al

    Following your tutorial I was able to install the last version of Owncloud. After initial login, It stated that it will be better to use https secure connection. At first it doesn't worked for me, but finally managed to turn on ssl on lighttpd and login that way.

    Then the status page in Owncloud says that the setup dont allow WebDav access. I tryed to install an enable mod_webdav, but then lighttpd doesnt start at all... unless I disable the mod_webdav.

    Do you have any suggestions or tips to achieve that?

    I will try ngnix and cherokee.

    Any advice is welcomed. Thanks! ;)

    -----
    Made it work with ssl and webdav.

    It is not a lighttpd issue. The webdav sync worked in http, but after setting up lighttpd with a self-signed cert it started to complain. Found many suggestions, but this one made the result:

    In the last Owncloud 6.0.4 i believe, used this fix from other site:

    After this, it will only say that the cert is untrusted and self signed, but you accept it manually anyway and it will work.

    So first you have to set up lighttpd to use ssl (I choosed to use ONLY that), then install owncloud last version, and finally do that edit.

    I can access via https, or use client software with https and have de webdav enabled, no errors no complains.

    :)

    Now I am stuck trying to sign the cert in cacert.org for free. In order to add a domain there, they send a verification email to root or admin @yourasusdomain.asuscomm.com (or wathever dyndns you use) and I wasn't able to set up xmail in the router to achieve that... any help is apreciated
     
    Last edited: Jul 3, 2014
  20. ryzhov_al

    ryzhov_al Very Senior Member

    Joined:
    Jul 23, 2012
    Messages:
    643
    Location:
    Russia
    Try to start ligthy from console, you'll see where it was misconfigured.

    IMHO, it's useless because lighty's WebDAV module is too primitive.