Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
| docs:user-guide:services:nas:owncloud [2018/03/03 19:57] – ↷ Page moved from docs:user-guide:services:owncloud to docs:user-guide:services:nas:owncloud bobafetthotmail | docs:guide-user:services:nas:owncloud [2020/04/26 15:13] – links fixed tmomas | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== ownCloud | + | ====== ownCloud |
| - | Owncloud | + | ownCloud/ |
| - | It's recommended to have at least a dualcore ARMv7 processor | + | It's recommended to have at least a dualcore ARMv7 processor |
| - | I've installed | + | I've installed |
| --- //unknown// | --- //unknown// | ||
| - | I've also installed it on a more powerful TP_Link [[toh/tp-link/tl-wdr3500|TL-WDR3500]] but it's still very slow, 4-5 secs per page... | + | I've also installed it on a more powerful TP_Link [[toh:tp-link:tl-wdr3500|TL-WDR3500]] but it's still very slow, 4-5 secs per page... |
| --- // | --- // | ||
| - | |||
| - | ===== Get OpenWrt ===== | ||
| - | 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. | ||
| - | |||
| - | | {{: | ||
| ===== Get USB-support ===== | ===== Get USB-support ===== | ||
| Line 47: | Line 42: | ||
| ===== If <= 8MB flash: Get extroot ===== | ===== If <= 8MB flash: Get extroot ===== | ||
| - | 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 [[docs:user-guide: | + | 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 [[docs: |
| ===== Install & configure webserver ===== | ===== Install & configure webserver ===== | ||
| - | ==== use luci with httpd (default web server for luci) ==== | ||
| - | 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 | + | ownCloud can't be installed on uhttpd (default web server on OpenWrt). You need to install |
| - | opkg install uhttpd luci | + | |
| - | You're able to start uhttpd | + | I had trouble moving Luci from uhttpd to lighttpd so I recommend keeping uhttpd running for Luci on a different |
| - | |'' | + | ==== Change uhttpd port ==== |
| - | config uhttpd | + | Edit '' |
| - | list listen_http | + | |
| - | list listen_http | + | |
| - | option home / | + | config uhttpd main |
| + | list listen_http | ||
| + | list listen_http | ||
| - | list interpreter | + | list listen_https |
| + | list listen_https | ||
| - | option index_page | + | Restart uhhtpd. |
| - | ... | + | /etc/init.d/uhttpd restart |
| - | config uhttpd config | + | You should be able to reach luci under e.g. http://192.168.1.1: |
| - | list listen_https | + | |
| - | list listen_https | + | |
| - | option home /www | + | ==== Install lighttpd ==== |
| - | '' | + | |
| - | after a restart of uhhtp | + | Install lighttpd packages: |
| - | / | + | opkg install lighttpd lighttpd-mod-cgi lighttpd-mod-fastcgi lighttpd-mod-access |
| - | you should be able to reach luci under e.g. http://192.168.1.1:81 | + | Now configure lighttpd for ownCloud. Edit the config-file '' |
| - | ==== disable httpd and use luci on lighttpd ==== | + | Set www-root for ownCloud: |
| - | Somewhere I got the hint to use lighttpd for running ownCloud. I tried out uhttpd simultaneously | + | server.document-root = "/ |
| - | If you don't want to run two web servers simultaneously: | + | see errors on syslog: |
| - | Disable uhttpd even after reboot | ||
| - | |||
| - | / | ||
| - | / | ||
| - | |||
| - | Remember, at this point you can't use luci. So install lighttpd: | ||
| - | |||
| - | 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 wasting space by doing this (learn more about SquashFS!). Otherwise you're able to remove httpd by typing | ||
| - | |||
| - | opkg --force-depends remove uhttpd | ||
| - | |||
| - | |||
| - | Now configure lighttpd, to be able to use luci again. | ||
| - | |||
| - | Edit the config-file / | ||
| - | |||
| - | Uncomment the mod_cgi: | ||
| - | |||
| - | server.modules = ( | ||
| - | " | ||
| - | ) | ||
| - | |||
| - | see errors on syslog: | ||
| server.error-log-use-syslog = " | server.error-log-use-syslog = " | ||
| - | assign luci to lua | + | Uncomment |
| - | cgi.assign = ( " | + | |
| - | + | ||
| - | At this point it's possible to start the server... | + | |
| - | + | ||
| - | / | + | |
| - | / | + | |
| - | + | ||
| - | ...and access luci again. Use e.g. http:// | + | |
| - | + | ||
| - | ==== Configure lighttpd for OwnCloud ==== | + | |
| server.modules = ( | server.modules = ( | ||
| " | " | ||
| - | " | + | |
| ) | ) | ||
| + | Assign port 80 for the ownCloud Server: | ||
| - | cause, we'll move the Luci-Server to the Port 81; we need the port 80 for the OwnCloud-Server: | ||
| server.port = 80 | server.port = 80 | ||
| - | |||
| - | Set www-root for OwnCloud (We will add a new server for Luci later.): | ||
| - | server.document-root = "/ | ||
| Add these lines to secure the access to the data according to ownCloud WebServer-notes[3], | Add these lines to secure the access to the data according to ownCloud WebServer-notes[3], | ||
| Line 145: | Line 97: | ||
| $HTTP[" | $HTTP[" | ||
| url.access-deny = ("" | url.access-deny = ("" | ||
| - | } | + | } |
| $HTTP[" | $HTTP[" | ||
| Line 151: | Line 103: | ||
| } | } | ||
| - | And append a new server | + | Start the server: |
| - | $SERVER[" | + | |
| - | server.document-root = "/ | + | |
| - | cgi.assign = (" | + | |
| - | } | + | |
| - | Due to this, remember to remove the line we have added before: | + | /etc/init.d/lighttpd start |
| - | # | + | |
| - | Restart the webserver with | + | Enable server for next boots: |
| - | / | + | / |
| - | + | ||
| - | And make sure it's enabled for next boots: | + | |
| - | + | ||
| - | / | + | |
| - | + | ||
| - | Now point your browser to http:// | + | |
| ===== Install & configure PHP ===== | ===== Install & configure PHP ===== | ||
| Get the dirty part: php and sqlite. I am not sure if really all of 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 | + | |
| + | | ||
| Those packages are also suggested: | Those packages are also suggested: | ||
| - | opkg install | + | opkg install |
| Configure / | Configure / | ||
| Line 193: | Line 135: | ||
| Play around with memory_limit, | Play around with memory_limit, | ||
| - | run php | + | Run php: |
| - | / | + | |
| - | / | + | / |
| + | / | ||
| ==== activate PHP in lighttpd.conf ==== | ==== activate PHP in lighttpd.conf ==== | ||
| - | Uncomment to enable the fastcgi module | + | Uncomment to enable the fastcgi |
| server.modules = ( | server.modules = ( | ||
| " | " | ||
| Line 231: | Line 174: | ||
| ===== Get SSL (optional) ===== | ===== Get SSL (optional) ===== | ||
| - | Probably you want to run lighttpd with SSL/https to get your traffic crypted. These instructions are taken from [4]. For generating a key you need to install libopenssl and the openssl-utils | + | Probably you want to run lighttpd with SSL/https to get your traffic crypted. These instructions are taken from [4]. For generating a key you need to install libopenssl and the openssl-util |
| - | opkg install libopenssl | + | opkg install libopenssl openssl-util |
| - | (or openssl-util | + | |
| Now you can create a folder for your key like this | Now you can create a folder for your key like this | ||
| Line 252: | Line 194: | ||
| / | / | ||
| - | ===== unleash OwnCloud | + | ===== MySQL Installation (Optional) ===== |
| + | |||
| + | ownCloud is installed with SQLite by default. However SQLite is only good for testing and lightweight single user setups. It has no client synchronisation support, so other devices will not be able to synchronise with the data stored in an ownCloud SQLite database. MariaDB is the ownCloud recommended database. | ||
| + | |||
| + | Install the recommended MySQL/ | ||
| + | |||
| + | opkg update | ||
| + | opkg install mysql-server mariadb-client-extra php7-mod-pdo-mysql | ||
| + | |||
| + | Configure the database server: | ||
| + | |||
| + | sed -i ' | ||
| + | sed -i ' | ||
| + | |||
| + | mkdir -p / | ||
| + | mysql_install_db --force | ||
| + | |||
| + | Start MySQL: | ||
| + | |||
| + | / | ||
| + | / | ||
| + | |||
| + | Set password for root user: | ||
| + | |||
| + | mysqladmin -u root password ' | ||
| + | |||
| + | Connect to MySQL database: | ||
| + | |||
| + | mysql -uroot -p | ||
| + | |||
| + | Create user for web server and set its password: | ||
| + | |||
| + | CREATE USER ' | ||
| + | |||
| + | Create database for ownCloud and set privileges: | ||
| + | |||
| + | CREATE DATABASE IF NOT EXISTS owncloud; | ||
| + | GRANT ALL PRIVILEGES ON owncloud.* TO ' | ||
| + | FLUSH PRIVILEGES; | ||
| + | |||
| + | For more information, | ||
| + | |||
| + | ===== Unleash ownCloud | ||
| Download and unpack the newest revision: | Download and unpack the newest revision: | ||
| - | | '' | + | |
| - | wget http://mirrors.owncloud.org/ | + | wget https://download.owncloud.org/ |
| - | opkg update | + | opkg update |
| - | opkg install tar | + | opkg install tar |
| - | cd /www | + | cd /www |
| - | tar -xjf / | + | tar -xjf / |
| - | '' | + | |
| Now you should cleanup: | Now you should cleanup: | ||
| - | | '' | + | |
| - | opkg remove --autoremove tar | + | opkg remove --autoremove tar |
| - | '' | + | |
| You have to configure the rights of the / | You have to configure the rights of the / | ||
| - | | '' | + | |
| - | chmod 770 -R / | + | |
| - | '' | + | chmod 770 -R / |
| - | | '' | + | |
| - | mkdir owncloud | + | mkdir owncloud |
| - | cd owncloud | + | cd owncloud |
| - | mkdir data | + | mkdir data |
| - | chown -R root: | + | chown -hR http / |
| - | chmod 770 -R / | + | chmod 770 -R / |
| - | '' | + | |
| + | create the following folder after installation and change its permissions: | ||
| + | cd / | ||
| + | mkdir apps-external | ||
| + | chmod 777 apps-external | ||
| Open your Website http:// | Open your Website http:// | ||
| - | =====The easiest way to install owncloud | + | ===== Enable Background Jobs ===== |
| - | Format your USB drive as ext3 or ext4 and plug it into your Openwrt router | + | ownCloud requires background jobs like database cleanup. For best performance, |
| - | download the script from gizfun.com, run it and you are good to go | + | Enable Cron job: |
| - | '' | + | opkg install sudo |
| + | crontab -u http -e | ||
| + | * * * * * /usr/ | ||
| - | '' | + | For more information, |
| - | 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 alternative destination ===== | + | |
| - | + | ||
| - | If you don't want to set up a extroot, you can install | + | |
| Install php on another location, then | Install php on another location, then | ||
| | '' | | '' | ||
| - | ln -s /opt/etc/php5 /etc/php5 | + | ln -s /opt/etc/php7 /etc/php7 |
| '' | '' | ||
| Line 312: | Line 297: | ||
| ln -s / | ln -s / | ||
| '' | '' | ||
| - | |||
| - | TODO | ||
| - | |||
| - | ===== Known bugs ===== | ||
| - | |||
| - | * Even if php5-mod-xml (and php5-mod-simplexml, | ||
| - | * 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 ===== | ||
| Line 332: | Line 310: | ||
| * [0] [[http:// | * [0] [[http:// | ||
| - | * [1] [[doc/howto/usb.essentials]] | + | * [1] [[docs: |
| - | * [2] [[docs/user-guide/storage/usb-drives]] | + | * [2] [[docs:guide-user:storage:usb-drives|Using storage devices]] |
| * [3] [[http:// | * [3] [[http:// | ||
| * [4] [[http:// | * [4] [[http:// | ||
| * [5] [[http:// | * [5] [[http:// | ||