Instruction: Owncloud on Netgear R7000 (lighttpd & mysql

Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware
Goto page 1, 2  Next
Author Message
mircor
DD-WRT Novice


Joined: 26 Jun 2011
Posts: 2

PostPosted: Wed Mar 16, 2016 18:40    Post subject: Instruction: Owncloud on Netgear R7000 (lighttpd & mysql Reply with quote
Hi,

since there was no detailed instruction for installing owncloud on dd-wrt, I decided to share my knowledge.
I hope it will help someone.

Here it is:

0. Move default httpd away from port 80:
Code:

nvram set http_lanport=81
nvram commit
reboot


1. Preparations

- activate jffs in dd-wrt-gui
- mount usb-memory on /opt in gui by UUID
- activate ssh


2. get entware-ngu-setup-sh script: (cause this device has an arm-cpu)


Code:

cd /jffs
wget -c -O entware-ngu-setup.sh http://goo.gl/hshQkA
chmod +x ./entware-ngu-setup.sh
mkdir /jffs/scripts
./entware-ngu-setup.sh


follow the instruction and dont forget to create swap file

3. get the 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 php5-mod-xmlwriter php5-mod-ldap php5-mod-openssl openssl-util


4. For mysql support and redirection to https


Code:

opkg install mysql-server php5-mod-pdo-mysql lighttpd-mod-redirect
mysql_install_db
/opt/etc/init.d/S70mysqld start
/opt/etc/init.d/S80lighttpd start
mysqladmin -u root password mysecretpassword



5. get owncloud:

Code:

cd /opt/share/www
wget http://download.owncloud.org/community/owncloud-8.2.3.tar.bz2 
bzip2 -cd owncloud-8.2.3.tar.bz2 | tar -xv
rm ./owncloud-8.2.3.tar.bz2


6. prepare lighthttpd & php:

Code:

vi /opt/etc/lighttpd/lighttpd.conf


Add “mod_fastcgi” and "mod_redirect" to server.module that it looks like:


Code:

server.modules = (
        "mod_fastcgi",
        "mod_redirect"
)


Add the following at the end of the file:
Code:

fastcgi.server = ( ".php" => ((
                     "bin-path" => "/opt/bin/php-cgi",
                     "socket" => "/tmp/php.socket"
                 )))



And this, if you want to have https and redirection from http to https:

Code:

$SERVER["socket"] == ":443" {                     
        ssl.engine = "enable"                         
        ssl.pemfile = "/opt/etc/lighttpd/certs/lighttpd.pem"
}                                                 
                                                           
                                                           
$SERVER["socket"] == ":80" {                     
        $HTTP["host"] =~ "(.*)" {                           
                url.redirect = ( "^/(.*)" => "https://%1/$1" )
        }                                         
}


Save it.

Then

Code:

vi /opt/etc/php.ini


change
post_max_size = 8M
to
post_max_size = 2000M

and
change
upload_max_filesize = 2M
to
upload_max_filesize = 2000M

Save end exit

7. SSL Certificate(for https):
Code:

mkdir /opt/etc/lighttpd/certs
cd /opt/etc/lighttpd/certs
openssl req -config /opt/etc/ssl/openssl.cnf -new -x509 -days 1095 -nodes -keyout lighttpd.pem -out lighttpd.pem


8. Make th server autostart:

Code:

mkdir /jffs/startup
cd /jffs/startup/
vi /jffs/startup/myStartup.sh


Paste the following code:
Code:

#!/bin/sh
n=1

while true
do
  sleep 5
  [ -d /opt/etc/init.d ] && break
  [ $n -gt 50 ] && break
  let n+=1
done
sleep 2

if [ -d /opt/etc/init.d ]; then
 for f in /opt/etc/init.d/S* ; do
  [ -x $f ] && $f start
 done
fi

swapon /opt/swap



Then make the file executable and autostart:

Code:

chmod +x myStartup.sh

nvram set rc_startup="/jffs/startup/myStartup.sh”
nvram commit

reboot;exit;



8. Configure Owncloud
Wait for reboot and then
use your webbrowser to configure Owncloud

mysql-hint: you need to use 127.0.0.1 instead of localhost


Sources:
Sponsor
<Kong>
DD-WRT Guru


Joined: 15 Dec 2010
Posts: 4339
Location: Germany

PostPosted: Wed Mar 16, 2016 21:13    Post subject: Re: Instruction: Owncloud on Netgear R7000 (lighttpd & m Reply with quote
mircor wrote:
Hi,

since there was no detailed instruction for installing owncloud on dd-wrt, I decided to share my knowledge.


Not for owncloud, but pydio:

http://tips.desipro.de/2014/03/04/using-the-integrated-webserver/

and it works the sme way for owncloud. All you have to do is, enable lighttpd, copy owncloud to /jffs/www
connect to the server and setup owncloud, the whole thing takes about 2min.

Of course owncloud will use sqlite as db, since we don't ship mysql in the build, but I don't mysql is overkill, those who need mysql probably don't want to run it on the router:-)

_________________
KONG PB's: http://www.desipro.de/ddwrt/
KONG Info: http://tips.desipro.de/
trancekat
DD-WRT Novice


Joined: 22 Dec 2016
Posts: 15

PostPosted: Tue Dec 31, 2019 14:17    Post subject: Re: Instruction: Owncloud on Netgear R7000 (lighttpd & m Reply with quote
<Kong> wrote:
mircor wrote:
Hi,

since there was no detailed instruction for installing owncloud on dd-wrt, I decided to share my knowledge.


Not for owncloud, but pydio:

http://tips.desipro.de/2014/03/04/using-the-integrated-webserver/

and it works the sme way for owncloud. All you have to do is, enable lighttpd, copy owncloud to /jffs/www
connect to the server and setup owncloud, the whole thing takes about 2min.

Of course owncloud will use sqlite as db, since we don't ship mysql in the build, but I don't mysql is overkill, those who need mysql probably don't want to run it on the router:-)


Hi Kong,
Thank you for the fantastic build first of all.

I see that the link you posted is dead. Is there an updated link for that install, please?

I'm looking to run a personal cloud service on my R7000 and would love to see what you had in your instructions, please.

Thank you.
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14125
Location: Texas, USA

PostPosted: Tue Dec 31, 2019 14:31    Post subject: Reply with quote
Kong's DD-WRT stuff no longer exists on that server since he no longer does anything with DD-WRT. You may get lucky and search the web archive wayback machine for that URL.
_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
trancekat
DD-WRT Novice


Joined: 22 Dec 2016
Posts: 15

PostPosted: Tue Dec 31, 2019 14:45    Post subject: Reply with quote
kernel-panic69 wrote:
Kong's DD-WRT stuff no longer exists on that server since he no longer does anything with DD-WRT. You may get lucky and search the web archive wayback machine for that URL.


:O
Thank you, Kernel-panic69. I'm a casual user, and had no idea Kong stopped supporting his build for DDWRT. Appreciate your heads up!
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14125
Location: Texas, USA

PostPosted: Tue Dec 31, 2019 16:39    Post subject: Reply with quote
https://web.archive.org/web/20180713084903/http://tips.desipro.de/2014/03/04/using-the-integrated-webserver <--- here's the web archive of the page Cool
_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
trancekat
DD-WRT Novice


Joined: 22 Dec 2016
Posts: 15

PostPosted: Tue Dec 31, 2019 17:26    Post subject: Reply with quote
kernel-panic69 wrote:
https://web.archive.org/web/20180713084903/http://tips.desipro.de/2014/03/04/using-the-integrated-webserver <--- here's the web archive of the page Cool


Thank you. I've almost got it working.

Out of curiosity, what happened that Kong is no longer part of the DD-WRT project?

Thanks again!
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14125
Location: Texas, USA

PostPosted: Tue Dec 31, 2019 17:35    Post subject: Reply with quote
trancekat wrote:
Out of curiosity, what happened that Kong is no longer part of the DD-WRT project?


I don't know the entire 100% factual reasons. I know what I've seen, I have my thoughts and speculations, but that is it. And it's probably not a good idea to mull around about it in the forum.

_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
trancekat
DD-WRT Novice


Joined: 22 Dec 2016
Posts: 15

PostPosted: Thu Jan 02, 2020 3:11    Post subject: Reply with quote
d0ug wrote:
On the topic of owncloud, one might want to try and adapt these instructions to nextcloud which forked from owncloud and is generally more supported now. I imagine the install wouldn't be too different

https://en.wikipedia.org/wiki/Nextcloud


It's like you read my mind, man. Smile

I did try nextcloud and have a similar php issue.
Quote:


PHP module OpenSSL not installed.

Please ask your server administrator to install the module.

PHP modules have been installed, but they are still listed as missing?

Please ask your server administrator to restart the web server.


A snippet from my opkg list-installed:

    opkg list-installed | grep php
    php7 - 7.1.12-3
    php7-cgi - 7.1.12-3
    php7-cli - 7.1.12-3
    php7-fastcgi - 7.1.12-3
    php7-fpm - 7.1.12-3
    php7-mod-calendar - 7.1.12-3
    php7-mod-ctype - 7.1.12-3
    php7-mod-curl - 7.1.12-3
    php7-mod-dom - 7.1.12-3
    php7-mod-exif - 7.1.12-3
    php7-mod-fileinfo - 7.1.12-3
    php7-mod-gd - 7.1.12-3
    php7-mod-gettext - 7.1.12-3
    php7-mod-gmp - 7.1.12-3
    php7-mod-hash - 7.1.12-3
    php7-mod-iconv - 7.1.12-3
    php7-mod-intl - 7.1.12-3
    php7-mod-json - 7.1.12-3
    php7-mod-mbstring - 7.1.12-3
    php7-mod-mcrypt - 7.1.12-3
    php7-mod-openssl - 7.1.12-3
    php7-mod-pcntl - 7.1.12-3
    php7-mod-pdo - 7.1.12-3
    php7-mod-pdo-sqlite - 7.1.12-3
    php7-mod-session - 7.1.12-3
    php7-mod-shmop - 7.1.12-3
    php7-mod-simplexml - 7.1.12-3
    php7-mod-sockets - 7.1.12-3
    php7-mod-sqlite3 - 7.1.12-3
    php7-mod-sysvsem - 7.1.12-3
    php7-mod-tokenizer - 7.1.12-3
    php7-mod-xml - 7.1.12-3
    php7-mod-xmlreader - 7.1.12-3
    php7-mod-xmlwriter - 7.1.12-3
    php7-mod-zip - 7.1.12-3
gjkrisa
DD-WRT Novice


Joined: 15 Apr 2021
Posts: 9

PostPosted: Sun Apr 18, 2021 7:23    Post subject: Re: Instruction: Owncloud on Netgear R7000 (lighttpd & m Reply with quote
mircor wrote:

hi im trying to follow this and your command
wget -c -O entware-ngu-setup.sh http://goo.gl/hshQkA
returns 404
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14125
Location: Texas, USA

PostPosted: Sun Apr 18, 2021 11:32    Post subject: Reply with quote
Not sure if reading all the links in the OP will give you any pointers, but this is likely done via Entware:

https://wiki.dd-wrt.com/wiki/index.php/Installing_Entware

_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
gjkrisa
DD-WRT Novice


Joined: 15 Apr 2021
Posts: 9

PostPosted: Sun Apr 18, 2021 20:00    Post subject: Reply with quote
Ok thank you. Think your right I did try reading the links a bit.
I think to get past that before I did do that have lots going on so you will see me again.
Trying to post here following so others know as well.
gjkrisa
DD-WRT Novice


Joined: 15 Apr 2021
Posts: 9

PostPosted: Mon Apr 19, 2021 4:43    Post subject: Reply with quote
ok having an issue installing entware to my partition part of it seems read only
so i tried creating all this on the beginning of the drive 1tb partition so i cd to mnt/sda1 installed there also to make it opt i used ddwrt gui uuid opt this partition



directory perissions.png
 Description:
directory permissions
 Filesize:  10.88 KB
 Viewed:  4292 Time(s)

directory perissions.png



usb.png
 Description:
myusb settings
 Filesize:  762.33 KB
 Viewed:  4295 Time(s)

usb.png



Screenshot 2021-04-18 203452.png
 Description:
mkdir cant create read only
 Filesize:  230.41 KB
 Viewed:  4303 Time(s)

Screenshot 2021-04-18 203452.png


gjkrisa
DD-WRT Novice


Joined: 15 Apr 2021
Posts: 9

PostPosted: Thu Apr 22, 2021 14:39    Post subject: Reply with quote
Can anyone tell me why I’m getting can not write permission?
Alozaros
DD-WRT Guru


Joined: 16 Nov 2015
Posts: 6410
Location: UK, London, just across the river..

PostPosted: Thu Apr 22, 2021 15:41    Post subject: Reply with quote
gjkrisa wrote:
Can anyone tell me why I’m getting can not write permission?


no idea, what you are doing and if you read https://forum.dd-wrt.com/wiki/index.php/Installing_Entware

Entware needs an opt mount, and you dont have it...your partition must be named "opt"...
where UUID is add UUID number, not the path....follow the instructions in the link above...

_________________
Atheros
TP-Link WR740Nv1 ---DD-WRT 55179 WAP
TP-Link WR1043NDv2 -DD-WRT 55303 Gateway/DoT,Forced DNS,Ad-Block,Firewall,x4VLAN,VPN
TP-Link WR1043NDv2 -Gargoyle OS 1.15.x AP,DNS,QoS,Quotas
Qualcomm-Atheros
Netgear XR500 --DD-WRT 55460 Gateway/DoH,Forced DNS,AP Isolation,4VLAN,Ad-Block,Firewall,Vanilla
Netgear R7800 --DD-WRT 55460 Gateway/DoT,AD-Block,Forced DNS,AP&Net Isolation,x3VLAN,Firewall,Vanilla
Netgear R9000 --DD-WRT 55363 Gateway/DoT,AD-Block,AP Isolation,Firewall,Forced DNS,x2VLAN,Vanilla
Broadcom
Netgear R7000 --DD-WRT 55460 Gateway/SmartDNS/DoH,AD-Block,Firewall,Forced DNS,x3VLAN,VPN
NOT USING 5Ghz ANYWHERE
------------------------------------------------------
Stubby DNS over TLS I DNSCrypt v2 by mac913
Goto page 1, 2  Next Display posts from previous:    Page 1 of 2
Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum