What's new

[HOW-TO] ownCloud on Router

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

ryzhov_al

Very Senior Member
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:
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://...@192.168.1.1/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:xxxxxx@192.168.1.1/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:xxxxxx@192.168.1.1/data/transmission/Torrent/Completed/archlinux-2013.06.01-dual.iso at /tmp/mnt/entware/share/www/owncloud/apps/files_external/lib/streamwrapper.php#33
 
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.
 
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.
 
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.
 
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:
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.
 
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.
ryzhov_al, OK, understood. I will try nginx from Entware specially for ownCloud maybe then.
 
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.
 
That other instance of lighttpd is AiCloud.
 
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!
 
Which PHP modules are necessary?

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

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!
 
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!

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.
 
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?
 
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?

AiCloud is there on the RT-AC56U.
 
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?
 
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:

Solution
Rafael Cristaldo - Mon, 2014/06/02 - 06:43.

1. Open the file $OWNCLOUD_DIR/3rdparty/Sabre/DAV/Client.php in your favorite text editor
2. Find the $curlSettings array in the request function
3. Add the following two elements to the array:

CURLOPT_SSL_VERIFYPEER => 0,
CURLOPT_SSL_VERIFYHOST => 0,

4. Save the file and exit the editor
5. Restart your web server

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:
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.
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.
 

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top