Differences

This shows you the differences between two versions of the page.

doc:howto:owncloud [2014/03/01 14:55]
nomailing
doc:howto:owncloud [2014/06/05 15:43] (current)
motherjoker
Line 1: Line 1:
====== ownCloud on OpenWrt ====== ====== ownCloud on OpenWrt ======
-Hint: I'm installed OwnCloud on an TP-Link TL-WR2543ND, using lighttpd and sorry, it's dead slow! :-(+Hint: I've installed OwnCloud on an TP-Link TL-WR2543ND, using lighttpd and sorry, it's dead slow! :-(
 + --- //unknown//
 +
 +I've also installed it on a more powerful TP_Link TL-WDR3500 but it's still very slow, 4-5 secs per page...
 +
 + --- //motherjoker 2014/06/05 15:41//
===== Get OpenWrt ===== ===== Get OpenWrt =====
-Use current trunk-version of OpenWrt[0], cause one necessary package (php5-mod-zip) isn't available in latest stable version 10.3.1. The web resources of OpenWrt will help you figuring out what firmware you will need for your device and how to flash it.+Use Attitude Adjustment or current trunk-version of OpenWrt[0], because one necessary package (php5-mod-zip) isn't available in version 10.3.1. The web resources of OpenWrt will help you figuring out what firmware you will need for your device and how to flash it.
| {{:meta:icons:tango:48px-outdated.svg.png?nolink}} | OpenWrt is not built with locale support by default, which is needed for ownCloud. Therefore this HOWTO only works if you compile your own OpenWRT firmware image and include full language support in the kernel. For more information see [[https://forum.openwrt.org/viewtopic.php?id=45251]].  | | {{:meta:icons:tango:48px-outdated.svg.png?nolink}} | OpenWrt is not built with locale support by default, which is needed for ownCloud. Therefore this HOWTO only works if you compile your own OpenWRT firmware image and include full language support in the kernel. For more information see [[https://forum.openwrt.org/viewtopic.php?id=45251]].  |
===== Get USB-support ===== ===== Get USB-support =====
-ownCloud is around 30 MB and you will like to store your data somewhere. So best both is done on some external storage cause small routers don't have that much.+ownCloud is around 30 MB and you will like to store your data somewhere. So best both is done on some external storage because small routers don't have that much.
Have a look in the OpenWrt-Wiki at usb.essentials [1] and usb.storage[2], and figure out what USB-mode your device is using (ohci or uhci) and know what filesystem is on your storage (here: ext4). Have a look in the OpenWrt-Wiki at usb.essentials [1] and usb.storage[2], and figure out what USB-mode your device is using (ohci or uhci) and know what filesystem is on your storage (here: ext4).
Line 36: Line 41:
/etc/init.d/lighttpd start /etc/init.d/lighttpd start
-===== If <= 8MB flash; Get extroot =====+===== If <= 8MB flash: Get extroot =====
-If your device has only 8 MB of flash-memory, it is to small to get all the dependencies on it. You'll need to put the operating-system on the USB-device as well. Have a look at [[doc:howto:extroot]] and follow the instructions for trunk. The flavour "New external overlay variant (pivot overlay)" worked for me on a TP-Link WR1043ND quite well. Remember to use both steps while "Duplicate Data": pivot overlay and pivot root.+If your device has only 8 MB of flash-memory (or even less), it is too small to get all the dependencies on it. You'll need to put the operating-system on the USB-device as well. Have a look at [[doc:howto:extroot]] and follow the instructions for trunk. The flavour "New external overlay variant (pivot overlay)" worked for me on a TP-Link WR1043ND quite well. Remember to use both steps while "Duplicate Data": pivot overlay and pivot root.
===== Install & configure webserver ===== ===== Install & configure webserver =====
==== use luci with httpd (default web server for luci) ==== ==== use luci with httpd (default web server for luci) ====
-May you have allready the OpenWrt web-interface (luci) on your router, may you want to get the OpenWrt web-interface initially.+May you have already the OpenWrt web-interface (luci) on your router, may you want to get the OpenWrt web-interface initially.
If you like OpenWrt-webinterface luci, install it If you like OpenWrt-webinterface luci, install it
opkg install uhttpd luci opkg install uhttpd luci
-You're able to start uhttpd twice: Add an new uhttpd section in the /etc/config/uhttpd file. And don't forget to serve luci on another port.+You're able to start uhttpd twice: Add a new uhttpd section in the /etc/config/uhttpd file. And don't forget to serve luci on another port.
|'' |''
Line 77: Line 82:
==== disable httpd and use luci on lighttpd ==== ==== disable httpd and use luci on lighttpd ====
-Somewhere I got the hint to use lighttpd for running ownCloud. I tried out uhttpd simultaniously - the interfaced looked quite broken.+Somewhere I got the hint to use lighttpd for running ownCloud. I tried out uhttpd simultaneously - the interface looked quite broken.
-And may you would no run two web server simultanious.+If you don't want to run two web servers simultaneously:
Disable uhttpd even after reboot Disable uhttpd even after reboot
Line 90: Line 95:
opkg install lighttpd lighttpd-mod-cgi lighttpd-mod-fastcgi lighttpd-mod-access opkg install lighttpd lighttpd-mod-cgi lighttpd-mod-fastcgi lighttpd-mod-access
-//If the httpd server is located on the SquashFS it is not recomend to remove the files// from the space, due to wasing space by doing this (learn more about SquashFS!). Otherwise you're able to remove httpd by typing+//If the httpd server is located on the SquashFS, it is not recomend to remove the files// from the space, due to wasting space by doing this (learn more about SquashFS!). Otherwise you're able to remove httpd by typing
opkg --force-depends remove uhttpd opkg --force-depends remove uhttpd
 +
 +
 +Now configure lighttpd, to be able to use luci again.
Edit the config-file /etc/lighttpd/lighttpd.conf Edit the config-file /etc/lighttpd/lighttpd.conf
-First configuration lighttpd, and you are able to use luci again. uncomment the mod_cgi:+Uncomment the mod_cgi:
server.modules = ( server.modules = (
Line 126: Line 134:
server.port = 80 server.port = 80
-Set www-root for OwnCloud (We will add a new Server for Luci later.): +Set www-root for OwnCloud (We will add a new server for Luci later.):
server.document-root = "/www/owncloud" server.document-root = "/www/owncloud"
Line 145: Line 153:
} }
-Due to this remember to remove the line, we're added bevore:+Due to this, remember to remove the line we have added before:
#cgi.assign = ( "luci" => "/usr/bin/lua" ) #cgi.assign = ( "luci" => "/usr/bin/lua" )
-ReStart the webserver with+Restart the webserver with
/etc/init.d/lighttpd restart /etc/init.d/lighttpd restart
Line 156: Line 164:
/etc/init.d/lighttpd enabled /etc/init.d/lighttpd enabled
-Now point your browser to http://yourhost/index.php and see if this manual missed something. If so; please contact the author (see details below) or get an account for this wiki and fix the how-to yourself :)+Now point your browser to http://yourhost/index.php and see if this manual missed something. If so, please contact the author (see details below) or get an account for this wiki and fix the how-to yourself :)
===== Install & configure PHP ===== ===== Install & configure PHP =====
-Get the dirty part: php and sqlite. I am not sure if really all these packages are necessary, but it seems so:+Get the dirty part: php and sqlite. I am not sure if really all of these packages are necessary, but it seems so:
opkg install php5 php5-cgi php5-fastcgi php5-mod-json php5-mod-session php5-mod-zip libsqlite3 zoneinfo-core php5-mod-pdo php5-mod-pdo-sqlite php5-mod-ctype php5-mod-mbstring php5-mod-gd sqlite3-cli php5-mod-sqlite3 php5-mod-curl curl php5-mod-xml php5-mod-simplexml php5-mod-hash php5-mod-dom php5-mod-iconv opkg install php5 php5-cgi php5-fastcgi php5-mod-json php5-mod-session php5-mod-zip libsqlite3 zoneinfo-core php5-mod-pdo php5-mod-pdo-sqlite php5-mod-ctype php5-mod-mbstring php5-mod-gd sqlite3-cli php5-mod-sqlite3 php5-mod-curl curl php5-mod-xml php5-mod-simplexml php5-mod-hash php5-mod-dom php5-mod-iconv
-Configure /etc/php.ini to our needs, mainly uncomment the installed Dynamic Extensions and change the doc_root to our www-root:+Those packages are also suggested: 
 + opkg install php5-mod-mcrypt php5-mod-openssl php5-mod-fileinfo php5-mod-exif 
 + 
 +Configure /etc/php.ini to our needs and change the doc_root to our www-root:
;open_basedir= ;open_basedir=
Line 169: Line 180:
doc_root = doc_root =
cgi.fix_pathinfo=1 cgi.fix_pathinfo=1
- 
- extension=ctype.so 
- extension=curl.so 
- extension=dom.so 
- extension=gd.so 
- extension=hash.so 
- extension=iconv.so 
- extension=json.so 
- extension=pdo.so 
- extension=pdo_sqlite.so 
- extension=session.so 
- extension=sqlite3.so 
- extension=xml.so 
memory_limit = 32M memory_limit = 32M
 +
 +Check that the extensions are enabled:
 +
 +/etc/php5/<extension>.ini should contains extension=<extension>.ini
Play around with memory_limit, I reduced the value form 8MB to 4MB ... but maybe 50MB might be better with 64MB RAM. Play around with memory_limit, I reduced the value form 8MB to 4MB ... but maybe 50MB might be better with 64MB RAM.
Line 200: Line 202:
) )
-Add "index.php" to the List of index-file.names:+Add "index.php" to the list of index-file.names:
index-file.names = ( "index.php", "index.html", "default.html", "index.htm", "default.htm" ) index-file.names = ( "index.php", "index.html", "default.html", "index.htm", "default.htm" )
static-file.exclude-extensions = (".php, ".pl", ".fcgi") static-file.exclude-extensions = (".php, ".pl", ".fcgi")
-include php by using fast-cgi (gample against max-procs for performance):+Include php by using fast-cgi (gample against max-procs for performance):
fastcgi.server = ( fastcgi.server = (
".php" => (( ".php" => ((
- "bin-path" => "/usr/bin/php-cgi",+ "bin-path" => "/usr/bin/php-fcgi",
"socket" => "/tmp/php.socket", "socket" => "/tmp/php.socket",
"max-procs" => 1 "max-procs" => 1
Line 215: Line 217:
) )
-Only if your using normal cgi mode for PHP, your need the following line+Only if you are using normal cgi mode for PHP, you'll need the following line
cgi.assign = (".php" => "/usr/bin/php-cgi") cgi.assign = (".php" => "/usr/bin/php-cgi")
-ReStart the webserver with+Restart the webserver with
/etc/init.d/lighttpd restart /etc/init.d/lighttpd restart
-Now point your browser to http://yourhost/index.php (first create a helpful content to this file) and see if this manual missed something. If so; please contact the author (see details below) or get an account for this wiki and fix the how-to yourself +Now point your browser to http://yourhost/index.php (first create a helpful content to this file) and see if this manual missed something. If so, please contact the author (see details below) or get an account for this wiki and fix the how-to yourself.
===== Get SSL (optional) ===== ===== Get SSL (optional) =====
Line 248: Line 250:
===== unleash OwnCloud ===== ===== unleash OwnCloud =====
-download and unpack the newest revision:+Download and unpack the newest revision:
| ''cd /tmp | ''cd /tmp
Line 277: Line 279:
'' | '' |
-Open your Website http://192.168.1.1/ and configure your first steps then wait for a loooonnnnngggg time and you'll see the result+Open your Website http://192.168.1.1/ and configure your first steps, then wait for a loooonnnnngggg time and you'll see the result.
=====The easiest way to install owncloud ===== =====The easiest way to install owncloud =====
Line 289: Line 291:
''sh web_for_openwrt.sh'' ''sh web_for_openwrt.sh''
-the script will download, install and configure all necessary web server components automatically. All software are installed onto the external USB storage.+The script will download, install and configure all necessary web server components automatically. All software will be installed onto the external USB storage. 
 + 
 + 
 +=====Owncloud on alternative destination ===== 
 + 
 +If you don't want to set up a extroot, you can install owncloud on a different location (http://wiki.openwrt.org/doc/techref/opkg#mount.point) 
 + 
 +Install php on another location, then 
 +| ''ln -s /opt/etc/php.ini /etc/php.ini 
 +ln -s /opt/etc/php5 /etc/php5 
 +'' | 
 + 
 +If you still get errors related timezones and calls to undefined functions: 
 +| ''opkg -dest usb install zoneinfo-core zoneinfo-[your region] 
 +ln -s /opt/usr/lib/php /usr/lib/php 
 +ln -s /opt/usr/share/zoneinfo/ /usr/share/zoneinfo/ 
 +'' | 
 + 
 +TODO
-===== Know bugs =====+===== Known bugs =====
-  * Even php5-mod-xml (and php5-mod-simplexml, -xmlreader and -xmlwriter) are installed, ownCloud lists php-xml as a missing dependency. Anyone an idea? +  * Even if php5-mod-xml (and php5-mod-simplexml, -xmlreader and -xmlwriter) are installed, ownCloud lists php-xml as a missing dependency. Anyone an idea? 
-  * It can be fix if select php5-mod-xml when you make php5. If you not, libxml will not be loaded, even phh5-mod-xml is installed later. +  * It can be fixed by selecting php5-mod-xml when you make php5. If you don't, libxml will not be loaded, even if phh5-mod-xml is installed later.
===== Written by ===== ===== Written by =====

Back to top

doc/howto/owncloud.1393682141.txt.bz2 · Last modified: 2014/03/01 14:55 by nomailing