OwnCloud through Lighttpd Optware-NG

1 - Setup Optware-NG from this guide
2 - Install Lighttpd from here
3 - Install necessary packages:

ipkg install php-xmlrpc php-gd php-curl php-zip php-mbstring php-memcached

4 - Enable xmlreader extension

echo "extension=xmlreader.so" >> /opt/etc/php.d/xmlreader.ini

5 - Download and install latest version of OwnCloud

cd /opt/share/www
wget https://download.owncloud.org/community/owncloud-9.1.3.tar.bz2 --no-check-certificate
bzip2 -cd owncloud-9.1.3.tar.bz2 | tar -xv
rm ./owncloud-9.1.3.tar.bz2

6 - Create lighttpd configuration for owncloud, just copy/paste all following lines in terminal

cat >> /opt/etc/lighttpd/conf.d/owncloud.conf << 'EOF'
$HTTP["url"] =~ "^/owncloud/data/" {
url.access-deny = ("")
}
$HTTP["url"] =~ "^/owncloud($|/)" {
dir-listing.activate = "disable"
}
$SERVER["socket"] == ":443" {
ssl.engine = "enable"
ssl.pemfile = "/opt/etc/lighttpd/certs/lighttpd.pem"
ssl.use-sslv2 = "disable"
ssl.cipher-list = "TLSv1+HIGH !SSLv2 RC4+MEDIUM !aNULL !eNULL !3DES @STRENGTH"
}
$HTTP["scheme"] == "http" {
$HTTP["host"] == "OwnCloud" {url.redirect = (".*" => "https://%0$0")}
}
server.modules += ( "mod_setenv" )
$HTTP["scheme"] == "https" {
setenv.add-response-header = ( "Strict-Transport-Security" => "max-age=15768000; includeSubdomains; preload")
}
EOF

Press Enter

7 - Create ssl certificate (replace values in red if you want)

mkdir -p /opt/etc/lighttpd/certs
cd /opt/etc/lighttpd/certs
openssl req -new -x509 -days 1095 -nodes \
-subj "/C=RO/ST=Timis/L=Timisoara/O=HQT/CN=www.asusrouter.com" \
-keyout lighttpd.pem -out lighttpd.pem
chmod 400 lighttpd.pem

8 - Tweak some settings in php configuration file

sed -i "/upload_max_filesize =*/cupload_max_filesize = 512M" "/opt/etc/php.ini"
sed -i "/post_max_size =*/cpost_max_size = 512M" "/opt/etc/php.ini"
sed -i "/memory_limit =*/cmemory_limit = 32M" "/opt/etc/php.ini"
sed -i "/max_execution_time ==*/cmax_execution_time = 0" "/opt/etc/php.ini"
sed -i "/max_input_time ==*/cmax_input_time = -1" "/opt/etc/php.ini"

9 - Restart Lighttpd

/opt/etc/init.d/S80lighttpd restart

10 - Go to default router ip address and port :81/owncloud or www.asusrouter.com:81/owncloud
To access owncloud secure go to https://default-router-ip-address/owncloud, ex. https://192.168.1.1/owncloud or https://www.asusrouter.com/owncloud

owncloud-optware

11 - Choose a username and a password then press Finish setup

To access OwnCloud from wan you don't need to input port 81 anymore, use www.your-wan-ip-address/owncloud


Tested successfully on RT-AC68U, firmware v380.59, 1Tb usb hdd WD & on RT-AC56U, firmware v380.59, 32Gb usb flash Kingston

If you need a professional cloud service, visit www.cloudwards.net and read recommendations 
Source
SNB

Thanks @ryzhov_al@zyxmon & @alllexx

REVIEW (CLICK ON THE STARS TO RATE!)
4
Sending
User Review
4.78 (9 votes)