NextCloud through Lighttpd Entware

Tested on RT-AC86U running firmware v384.17 on 30.04.2020


1
 - Setup Entware-NG from this guide

2 - Install Lighttpd Web Server from this guide

3 - Install necessary packages:

opkg install bzip2 coreutils-stat lighttpd-mod-access lighttpd-mod-expire lighttpd-mod-setenv \
php7-cgi php7-cli php7-mod-ctype php7-mod-curl php7-mod-dom php7-mod-fileinfo \
php7-mod-filter php7-mod-gd php7-mod-iconv php7-mod-intl php7-mod-json \
php7-mod-mbstring php7-mod-mysqli php7-mod-openssl php7-mod-pcntl php7-mod-pdo \
php7-mod-pdo-mysql php7-mod-pdo-sqlite php7-mod-session php7-mod-simplexml \
php7-mod-sqlite3 php7-mod-xml php7-mod-xmlreader php7-mod-xmlwriter \
php7-mod-zip openssl-util lighttpd-mod-redirect php7-mod-opcache

4 - Download and install latest version of NextCloud

cd /opt/share/www
wget https://download.nextcloud.com/server/releases/nextcloud-18.0.4.tar.bz2 --no-check-certificate
bzip2 -cd nextcloud-18.0.4.tar.bz2 | tar -xv
rm ./nextcloud-18.0.4.tar.bz2
chown admin:root /opt/share/www/nextcloud/apps/*

5 - Modify lighttpd configuration file, just copy/paste all following lines in terminal

cat >> /opt/etc/lighttpd/lighttpd.conf << 'EOF'
$HTTP["url"] =~ "^/nextcloud/data/" {
url.access-deny = ("")
}
$HTTP["url"] =~ "^/nextcloud($|/)" {
dir-listing.activate = "disable"
}
url.redirect += ( "^/.well-known/caldav" => "/nextcloud/remote.php/dav" )
url.redirect += ( "^/.well-known/carddav" => "/nextcloud/remote.php/dav" )
EOF

Press Enter

6 - Increase upload max filesize, post max size and limit memory to 128Mb by modifying php configuration file

sed -i "/upload_max_filesize =*/cupload_max_filesize = 5G" "/opt/etc/php.ini"
sed -i "/post_max_size =*/cpost_max_size = 5G" "/opt/etc/php.ini"
sed -i "/memory_limit =*/cmemory_limit = 128M" "/opt/etc/php.ini"

7 - Restart Lighttpd

/opt/etc/init.d/S80lighttpd restart

8 - Now access nextcloud through router default ip address and port 81 www.asusrouter.com:81/nextcloud

9 - Chose a username & a strong password, then press "Finish Setup"

10 - Access OwnCloud from lanwan or https-lan, https-wan ip address

Source SNB

Thanks @ryzhov_al & @zyxmon

REVIEW (CLICK ON THE STARS TO RATE!)
5
Sending
User Review
4.75 (8 votes)