Latest News:
*New 11.2 series Release:
2019-06-20: XigmaNAS 11.2.0.4.6766 - released!

*New 12.0 series Release:
2019-06-20: XigmaNAS 12.0.0.4.6766 - released!

We really need "Your" help on XigmaNAS https://translations.launchpad.net/xigmanas translations. Please help today!

Producing and hosting XigmaNAS cost money, please consider a donation to our project so we can continue to offer you the best.
We need your support! eg: PAYPAL

[HOWTO] Install NextCloud/ownCloud inside a Jail NAS4Free 11.x/10.x

Jails with XigmaNAS
Forum rules
Set-Up GuideFAQsForum Rules
jistme
Status: Offline

Re: [HOWTO] Install Owncloud inside a Jail NAS4Free 10.x

#121

Post by jistme » 30 Mar 2016 10:15

In the lower range I have some devices myself that I have fixed ip's for, so I have now set dhcp to start at .110
So all I have to do now, is just remember that in case I ever become a jail-junkie and create lots of them...

jistme
Status: Offline

Re: [HOWTO] Install Owncloud inside a Jail NAS4Free 10.x

#122

Post by jistme » 02 Apr 2016 10:02

hey Nozza,
I gave it a new shot today, and it all went well without any noticeable problem.
Also the password this time presented no problems.
When trying to enter the owncloud webinterface, I got the 'untrusted domain' error, but I then chose your 'option 4: fix known errors', and that fixed it perfectly.

The only minor hiccup I had that the first time I ran the commands, I didn't succeed, and at a moment got some 'not found' error. (If I recall correctly something related to tmp nano, sorry, didn't write it down or remember exactly)
But that is probably an issue with the fetching protocols of freebsd itself or something? There doesn't seem to be some clear explanation or warning for newbees o understand when fetching stuff didn't complete successfully?

The second time I ran the commands everything went smoothly, so this is really great!

I will probably remove both jails and the brig, and give it a whole new run from start to finish soon.
If I run into any noticeable issues I will let you know again.

Thnx a million!

User avatar
Nostalgist92
experienced User
experienced User
Posts: 100
Joined: 09 Feb 2013 00:04
Status: Offline

Re: [HOWTO] Install Owncloud inside a Jail NAS4Free 10.x

#123

Post by Nostalgist92 » 03 Apr 2016 04:16

That's great to hear! I will eventually get around to testing it myself haha
All my spare time has been taken up by writing that "all in one" script so haven't even considered testing the owncloud v2 script myself lol
Good news is though that the owncloud v2 script was imported in to the AIO script so that means that part of it should work without an issue! :P
(Haven't been testing this one either outside of ensuring the menus work correctly, do the installers/updaters actually work? No bloody idea xD)

If you're interested in following the AIO script progress though it's all on my github (Slowly migrating all my work over to git)
There is a LOT unfinished and i know for sure already without testing it that parts of it won't work as intended but hey, it's progress!

Most of the installers should work correctly minus "deluge" and maybe the web server and definitely don't try the "thebrig" installer (guide is fine) so if anyone attempts to use the AIO script BE SURE TO TEST IT ON A CLEAN NAS4FREE INSIDE A VIRTUAL MACHINE, please don't use it on a working system (Inside a jail should be fine - minus trying to install thebrig inside of a thebrig jail... lol). You've been warned :P
11.0.0.4 - Sayyadina (revision 3330) x64-full on Intel(R) Core(TM) i7-4820K CPU @ 4.20GHz | Corsair Vengeance Pro 64GB (4x8GB) CMY16GX3M2A1600C9 | 12 x 6TB WD RED RAIDZ2 + 2 x 256GB SSD Drives

durakotherealj
NewUser
NewUser
Posts: 4
Joined: 04 Feb 2016 23:15
Status: Offline

Re: [HOWTO] Install Owncloud inside a Jail NAS4Free 10.x

#124

Post by durakotherealj » 13 May 2016 16:29

hello i need help please I have installed version8.2 but i want to upgrade to 9 how i can do it without lost any information because, i am using like 2TB rght now, or if i use 8.2 until the end of the days is ok??
thnks i ssorry my english is not good
gretti ng from LA habana CUBA

User avatar
Nostalgist92
experienced User
experienced User
Posts: 100
Joined: 09 Feb 2013 00:04
Status: Offline

Re: [HOWTO] Install Owncloud inside a Jail NAS4Free 10.x

#125

Post by Nostalgist92 » 13 May 2016 22:33

Hey durakotherealj, it's quite fine to keep using version 8.2 for as long as you wish. The downfall to it is you won't get any great new features or updates. This includes security updates along with bug fixes and the rest.

I'm guessing you installed your version 8.2 using my script seeing as you are here? If you did it is pretty easy to update.
I've literally only just gotten out of bed after a solid 16 hour sleep (Holy hell did i need that) but i'll try posting some backup + update instructions before the end of the day for you.

Edit: Sorry, didn't have as much time as i thought i would have today. Will try to post as soon as possible but for now just stick to version 8.2 until you get instructions for safely updating :)
11.0.0.4 - Sayyadina (revision 3330) x64-full on Intel(R) Core(TM) i7-4820K CPU @ 4.20GHz | Corsair Vengeance Pro 64GB (4x8GB) CMY16GX3M2A1600C9 | 12 x 6TB WD RED RAIDZ2 + 2 x 256GB SSD Drives

durakotherealj
NewUser
NewUser
Posts: 4
Joined: 04 Feb 2016 23:15
Status: Offline

Re: [HOWTO] Install Owncloud inside a Jail NAS4Free 10.x

#126

Post by durakotherealj » 17 May 2016 14:24

yes i istalled using your scrip bay the way is working fine without problem,
thnks, i was searching online how to make the backup and upgrade and have idea how to do but first i goint to make the backuo all data and after that o going to "kill" my server, so i think is better if a wait 4 your post i believe will be more easy to me thank a lot
Muchas gracias.
saludos

iicee
NewUser
NewUser
Posts: 1
Joined: 30 Jun 2016 14:51
Status: Offline

Re: [HOWTO] Install Owncloud inside a Jail NAS4Free 10.x

#127

Post by iicee » 01 Jul 2016 13:49

Hi,

good instructions, got owncloud working, BUT:

Can not access jail/owncloud from remote address, from local 192.xxxx network everything works.
I have try nat/port forwarding to jail ip, testing ports between 8000 to 9000 and "default" 81, but nothing works. There is no conflict with router dhcp clients, nas has static ip address and normal webserver is working from remote address (Dynamic DNS enabled).

Can someone help, there is no point to have cloud working only in our local network.

supermllr
NewUser
NewUser
Posts: 1
Joined: 26 Jul 2016 03:47
Status: Offline

Re: [HOWTO] Install Owncloud inside a Jail NAS4Free 10.x

#128

Post by supermllr » 26 Jul 2016 10:21

I apologize if this is a "Noob" question but its more of a curiousity thing. I followed this guide and it work perfectly i believe. I can access owncloud and upload/download just fine. However my browser is saying the connection to the site is not private and gives 2 certificate errors. Im not sure if i messed up during the prompts somehow or not.

Image

Another thing i noticed is that the jail owncloud is running in does not show and processes running or sleeping even though i can access owncloud. Ive restarted N4F to see if that updated the jail somehow but still not showing anything. Is this normal or is something wrong with my owncloud install?

Image

Any pointers would greatly be appreciated as I am still very new to all of this.

User avatar
Nostalgist92
experienced User
experienced User
Posts: 100
Joined: 09 Feb 2013 00:04
Status: Offline

Re: [HOWTO] Install Owncloud inside a Jail NAS4Free 10.x

#129

Post by Nostalgist92 » 30 Jul 2016 17:14

@supermllr Those certificate errors are normal as it is a self signed certificate. Everything is still through https and secured but those warnings are just your browser saying "Hey, this site MAY be insecure/untrusted as the certificate was created by somebody rather than purchased from a trusted certificate authority"

TL;DR of that: It's safe and secure, you can ignore the warnings, your browser is just trying to be helpful :)

As for the running processes, mine does the same. I've got around 10 jails running with a bunch of stuff in each one and it doesn't always show the processes properly. I haven't looked in to why it does it though



@iicee I'm honestly not sure why you aren't able to access it via WAN, i haven't updated the script recently but as it is it should be working fine.
Without any more information about your setup i guess the only advice i can provide right now would be to triple check that the ports you have opened point to the jails ip and not the nas ip. I know you mentioned it was but doesn't hurt to be sure.
For example:
NAS IP = 192.168.1.3
Owncloud Jail IP = 192.168.1.4
Owncloud Local URL: 192.168.1.4:81
Router Port Forward = Port 8181 directs to 192.168.1.4:81
https://myinternetip:8181

Also make sure you are using the https:// in the url and not http://
It sounds silly, but i've made the mistake a couple times myself.

If i remember after i get some sleep i'll set up a fresh jail and test to make sure it still works properly.
11.0.0.4 - Sayyadina (revision 3330) x64-full on Intel(R) Core(TM) i7-4820K CPU @ 4.20GHz | Corsair Vengeance Pro 64GB (4x8GB) CMY16GX3M2A1600C9 | 12 x 6TB WD RED RAIDZ2 + 2 x 256GB SSD Drives

Emeds
Starter
Starter
Posts: 24
Joined: 26 Sep 2015 19:46
Status: Offline

Re: [HOWTO] Install Owncloud inside a Jail NAS4Free 10.x

#130

Post by Emeds » 23 Sep 2016 01:24

What is everyone's opinion on the owncloud/nextcloud split? I've read most of the developers have moved onto nextcloud, and the reason for the split was to focus more on community integration. Which project shows the most promise in the long run? The US office shutdown seems like a significant hit.
Setup:
-Old Desktop + 3x WD RED 3TB NAS DRIVES in RAIDZ1

mekonghigh
Starter
Starter
Posts: 39
Joined: 13 Oct 2013 18:03
Status: Offline

Re: [HOWTO] Install Owncloud inside a Jail NAS4Free 10.x

#131

Post by mekonghigh » 07 Jan 2017 13:56

I changed a few things to the script from http://vengefulsyndicate.com/download/12097/.
This wil install nextcloud 11.0.0 stable in jail on NAS4Free 11.0.0.4.3330.

Code: Select all

#!/bin/sh
# Script Version: 1.13 (March 21, 2016)
###########################################################################
##### START OF CONFIGURATION SECTION #####
#
#   In order to use this script, the following variables must be defined by the user:
#
#   server_port:  This value is used to specify which port nextcloud will be
#                 listening to. This is necessary because some installations of 
#                 N4F have had trouble with the administrative webgui showing up,
#                 even when browsing to the jail's IP.
#     
#   server_ip:    This value is used to specify which ip address nextcloud will be
#                 listening to. This is necessary because it keeps the jail from
#                 listening on all ip's
#
#   nextcloud_version:  This is the version of nextcloud you would like to download.
#                       You can replace this with "latest" but it isn't recommended
#                       as updates to nextcloud may require an updated script
#                       This script has only been tested on most 8.x.x versions
#                       up to version 9.0.0
#
#
###! IMPORTANT ! DO NOT IGNORE ! ###
server_port="81"
server_ip="192.168.1.200"
nextcloud_version="11.0.0"
### No need to edit below here ###
##### END OF CONFIGURATION SECTION #####
###########################################################################



###
#	This is a simple script to automate the installation of NextCloud within a 
#	jailed environment.
#   Maintainer: Nostalgist92 as Matthew Kempe's old script hadn't been updated
#   for NAS4Free 10.x (This should work fine for 9.x versions if you have the
#   new package management tool installed)
###



confirm () 
{
# Confirm with the user
read -r -p "   Continue? [y/N] " response
case "$response" in
    [yY][eE][sS]|[yY]) 
              # If yes, then continue
              echo -e "${url} Great! Moving on..${nc}"
               ;;
    *)
              # Otherwise exit...
              echo " "
              echo -e "${alt}Stopping script..${nc}"
              echo " "
              exit
              ;;
esac
}

trusteddomainerror ()
{
# Confirm with the user
echo " "
echo -e "${emp} Please finish the nextcloud setup before continuing${nc}"
echo -e "${msg} Head to ${url}https://$server_ip:$server_port ${msg}to do this.${nc}"
echo -e "${msg} Fill out the page you are presented with and hit finish${nc}"
echo " "
echo -e "${msg} Admin username & password = whatever you choose${nc}"
echo " "
echo -e "${emp} Make sure you click 'Storage & database'${nc}"
echo " "
echo -e "${msg} Database user = ${qry}root${nc} | Database password = ${nc}"
echo -e "${msg} the ${qry}mysql password${msg} you chose earlier during the script.${nc}"
echo -e "${msg} Database name = your choice (just ${qry}nextcloud${msg} is fine)${nc}"
echo " "
echo " Once the page reloads,"
read -r -p "   do you have a 'untrusted domain' error? [y/N] " response
case "$response" in
    [yY][eE][sS]|[yY])
              # If yes, let's fix that.
              echo " "
              echo -e "${url} Doing some last second changes to fix that..${nc}"
              echo " "
              # Prevent "Trusted Domain" error
              echo "    '${server_ip}'," >> /usr/local/www/nextcloud/config/trusted.txt
              cp /usr/local/www/nextcloud/config/config.php /usr/local/www/nextcloud/config/old_config.bak
              cat "/usr/local/www/nextcloud/config/old_config.bak" | \
                sed '8r /usr/local/www/nextcloud/config/trusted.txt' > \
                "/usr/local/www/nextcloud/config/config.php"
              echo -e " Done, continuing with the rest of the script"
               ;;
    *)
              # If no, just continue like normal.
              echo " "
              echo -e "${qry} Great!, no need to do anything, continuing with script..${nc}"
              echo " "
              ;;
esac
}

# Add some colour!
nc='\033[0m'        # No Color
alt='\033[0;31m'    # Alert Text
emp='\033[1;31m'    # Emphasis Text
msg='\033[1;37m'    # Message Text
url='\033[1;32m'    # URL
qry='\033[0;36m'    # Query Text
sep='\033[1;30m-------------------------------------------------------\033[0m'    # Line Seperator
cmd='\033[1;35m'    # Command to be entered



# define our bail out shortcut function anytime there is an error - display 
# the error message, then exit returning 1.
exerr () { echo -e "$*" >&2 ; exit 1; }



## Begin sanity checks
# None, as this script is intended to be run from the command line
## End sanity checks



echo " "
echo -e "${sep}"
echo -e "${msg}   Welcome to the nextcloud installer!${nc}"
echo -e "${sep}"
echo " "
echo " "
echo " " 
echo -e "${sep}"
echo -e "${msg}   Let's start with double checking some things${nc}"
echo -e "${sep}"
echo " "

echo -e "${msg} Is this script running ${alt}INSIDE${msg} of a jail?${nc}"
confirm
echo " "
echo -e "${msg} Checking to see if you need to modify the script${nc}"
echo -e "${msg} If ${emp}ANY${msg} of these ${emp}DON'T${msg} match YOUR setup, answer with ${emp}no${nc}."
echo -e " "
echo -e "      #1: ${msg}Is this your jails IP? ${qry}$server_ip${nc}"
echo -e "      #2: ${msg}Is this the port you want to use? ${qry}$server_port${nc}"
echo -e "      #3: ${msg}Is this the nextcloud version you want to install? ${qry}$nextcloud_version${nc}"
echo -e " "
echo -e "${emp} If #1 or #2 are incorrect you will encounter issues!${nc}"
confirm
echo " "
echo -e "${url} Awesome, now we are ready to get on with it!${nc}"

echo " " 
echo -e "${sep}"
echo -e "${msg}   Let's get to installing some stuff!!${nc}"
echo -e "${sep}"
echo " "

# Install packages
pkg install -y lighttpd php56-openssl php56-ctype php56-curl php56-dom php56-fileinfo php56-filter php56-gd php56-hash php56-iconv php56-json php56-mbstring php56-mysql php56-pdo php56-pdo_mysql php56-pdo_sqlite php56-session php56-simplexml php56-sqlite3 php56-xml php56-xmlrpc php56-xmlwriter php56-xmlreader php56-gettext php56-mcrypt php56-zip php56-zlib php56-posix mp3info mysql56-server pecl-apcu

echo " " 
echo -e "${sep}"
echo -e "${msg} Packages installed - now configuring MySQL${nc}"
echo -e "${sep}"
echo " "

echo 'mysql_enable="YES"' >> /etc/rc.conf
echo '[mysqld]' >> /var/db/mysql/my.cnf 
echo 'skip-networking' >> /var/db/mysql/my.cnf

# Start MySQL Server
/usr/local/etc/rc.d/mysql-server start

echo " " 
echo -e "${sep}"
echo -e "${msg} Securing the install. Default root password is blank,${nc}"
echo -e "${msg} you want to provide a strong root password, remove the${nc}" 
echo -e "${msg} anonymous accounts, disallow remote root access,${nc}"
echo -e "${msg} remove the test database, and reload privilege tables${nc}"
echo -e "${sep}"
echo " "

mysql_secure_installation

echo " " 
echo -e "${sep}"
echo -e "${msg} Done hardening MySQL - Performing key operations now${nc}"
echo -e "${sep}"
echo " "

cd ~
openssl genrsa -des3 -out server.key 1024

echo " " 
echo -e "${sep}"
echo -e "${msg} Removing password from key${nc}"
echo -e "${sep}"
echo " "

openssl rsa -in server.key -out no.pwd.server.key

echo " " 
echo -e "${sep}"
echo -e "${msg} Creating cert request. The Common Name should match${nc}"
echo -e "${msg} the URL you want to use${nc}"
echo -e "${sep}"
echo " "

openssl req -new -key no.pwd.server.key -out server.csr

echo " " 
echo -e "${sep}"
echo -e "${msg} Creating cert & pem file & moving to proper location${nc}"
echo -e "${sep}"
echo " "

openssl x509 -req -days 365 -in /root/server.csr -signkey /root/no.pwd.server.key -out /root/server.crt
cat no.pwd.server.key server.crt > server.pem
mkdir /usr/local/etc/lighttpd/ssl
cp server.crt /usr/local/etc/lighttpd/ssl
chown -R www:www /usr/local/etc/lighttpd/ssl/
chmod 0600 server.pem

echo " " 
echo -e "${sep}"
echo -e "${msg} Creating backup of lighttpd config${nc}"
echo -e "${sep}"
echo " " 

cp /usr/local/etc/lighttpd/lighttpd.conf /usr/local/etc/lighttpd/old_config.bak

echo " " 
echo -e "${sep}"
echo -e "${msg} Modifying lighttpd.conf file${nc}"
echo -e "${sep}"
echo " "

cat "/usr/local/etc/lighttpd/old_config.bak" | \
	sed -r '/^var.server_root/s|"(.*)"|"/usr/local/www/nextcloud"|' | \
	sed -r '/^server.use-ipv6/s|"(.*)"|"disable"|' | \
	sed -r '/^server.document-root/s|"(.*)"|"/usr/local/www/nextcloud"|' | \
	sed -r '/^#server.bind/s|(.*)|server.bind = "'"${server_ip}"'"|' | \
	sed -r '/^\$SERVER\["socket"\]/s|"0.0.0.0:80"|"'"${server_ip}"':'"${server_port}"'"|' | \
	sed -r '/^server.port/s|(.*)|server.port = '"${server_port}"'|' > \
	"/usr/local/etc/lighttpd/lighttpd.conf"

echo " " 
echo -e "${sep}"
echo -e "${msg} Adding stuff to lighttpd.conf file${nc}"
echo -e "${sep}"
echo " "

echo 'ssl.engine = "enable"' >> /usr/local/etc/lighttpd/lighttpd.conf
echo 'ssl.pemfile = "/root/server.pem"' >> /usr/local/etc/lighttpd/lighttpd.conf
echo 'ssl.ca-file = "/usr/local/etc/lighttpd/ssl/server.crt"' >> /usr/local/etc/lighttpd/lighttpd.conf
echo 'ssl.cipher-list  = "ECDHE-RSA-AES256-SHA384:AES256-SHA256:RC4-SHA:RC4:HIGH:!MD5:!aNULL:!EDH:!AESGCM"' >> /usr/local/etc/lighttpd/lighttpd.conf
echo 'ssl.honor-cipher-order = "enable"' >> /usr/local/etc/lighttpd/lighttpd.conf
echo 'ssl.disable-client-renegotiation = "enable"' >> /usr/local/etc/lighttpd/lighttpd.conf
echo '$HTTP["url"] =~ "^/data/" {' >> /usr/local/etc/lighttpd/lighttpd.conf
echo 'url.access-deny = ("")' >> /usr/local/etc/lighttpd/lighttpd.conf
echo '}' >> /usr/local/etc/lighttpd/lighttpd.conf
echo '$HTTP["url"] =~ "^($|/)" {' >> /usr/local/etc/lighttpd/lighttpd.conf
echo 'dir-listing.activate = "disable"' >> /usr/local/etc/lighttpd/lighttpd.conf
echo '}' >> /usr/local/etc/lighttpd/lighttpd.conf
echo 'cgi.assign = ( ".php" => "/usr/local/bin/php-cgi" )' >> /usr/local/etc/lighttpd/lighttpd.conf
echo 'server.modules += ( "mod_setenv" )' >> /usr/local/etc/lighttpd/lighttpd.conf
echo '$HTTP["scheme"] == "https" {' >> /usr/local/etc/lighttpd/lighttpd.conf
echo '    setenv.add-response-header  = ( "Strict-Transport-Security" => "max-age=15768000")' >> /usr/local/etc/lighttpd/lighttpd.conf
echo '}' >> /usr/local/etc/lighttpd/lighttpd.conf

echo " " 
echo -e "${sep}"
echo -e "${msg} Enabling the fastcgi module${nc}"
echo -e "${sep}"
echo " "

cp /usr/local/etc/lighttpd/modules.conf /usr/local/etc/lighttpd/old_modules.bak
cat "/usr/local/etc/lighttpd/old_modules.bak" | \
	sed -r '/^#include "conf.d\/fastcgi.conf"/s|#||' > \
	"/usr/local/etc/lighttpd/modules.conf"

echo " " 
echo -e "${sep}"
echo -e "${msg} Adding stuff to fastcgi.conf file${nc}"
echo -e "${sep}"
echo " "
echo 'fastcgi.server = ( ".php" =>' >> /usr/local/etc/lighttpd/conf.d/fastcgi.conf
echo '((' >> /usr/local/etc/lighttpd/conf.d/fastcgi.conf
echo '"socket" => "/tmp/php.socket",' >> /usr/local/etc/lighttpd/conf.d/fastcgi.conf
echo '"bin-path" => "/usr/local/bin/php-cgi",' >> /usr/local/etc/lighttpd/conf.d/fastcgi.conf
echo '"allow-x-send-file" => "enable",' >> /usr/local/etc/lighttpd/conf.d/fastcgi.conf
echo '"bin-environment" => (' >> /usr/local/etc/lighttpd/conf.d/fastcgi.conf
echo '"MOD_X_SENDFILE2_ENABLED" => "1",' >> /usr/local/etc/lighttpd/conf.d/fastcgi.conf
echo '"PHP_FCGI_CHILDREN" => "16",' >> /usr/local/etc/lighttpd/conf.d/fastcgi.conf
echo '"PHP_FCGI_MAX_REQUESTS" => "10000"' >> /usr/local/etc/lighttpd/conf.d/fastcgi.conf
echo '),' >> /usr/local/etc/lighttpd/conf.d/fastcgi.conf
echo '"min-procs" => 1,' >> /usr/local/etc/lighttpd/conf.d/fastcgi.conf
echo '"max-procs" => 1,' >> /usr/local/etc/lighttpd/conf.d/fastcgi.conf
echo '"idle-timeout" => 20' >> /usr/local/etc/lighttpd/conf.d/fastcgi.conf
echo '))' >> /usr/local/etc/lighttpd/conf.d/fastcgi.conf
echo ' )' >> /usr/local/etc/lighttpd/conf.d/fastcgi.conf

echo " " 
echo -e "${sep}"
echo -e "${msg} Obtaining corrected MIME.conf file for lighttpd to use${nc}"
echo -e "${sep}"
echo " "

mv /usr/local/etc/lighttpd/conf.d/mime.conf /usr/local/etc/lighttpd/conf.d/mime_conf.bak
fetch -o /usr/local/etc/lighttpd/conf.d/mime.conf http://www.xenopsyche.com/mkempe/oc/mime.conf

echo " "
echo -e "${sep}"
echo -e "${msg} Creating www folder and downloading nextcloud${nc}"
echo -e "${sep}"
echo " "

mkdir -p /usr/local/www
# Get nextcloud, extract it, copy it to the webserver
# and have the jail assign proper permissions
cd "/tmp"
fetch "https://download.nextcloud.com/server/releases/nextcloud-${nextcloud_version}.tar.bz2"
tar xf "nextcloud-${nextcloud_version}.tar.bz2" -C /usr/local/www
chown -R www:www /usr/local/www/

echo " " 
echo -e "${sep}"
echo -e "${msg} Adding lighttpd to rc.conf${nc}"
echo -e "${sep}"
echo " "

echo 'lighttpd_enable="YES"' >> /etc/rc.conf

echo " " 
echo -e "${sep}"
echo -e "${msg}  Done, lighttpd should start up automatically!${nc}"
echo -e "${sep}"
echo " "

echo " "
echo -e "${sep}"
echo -e "${msg} Attempting to start webserver.${nc}"
echo -e "${msg} If you get a Cannot 'start' lighttpd error, add:${nc}"
echo -e "\033[1;33m     lighttpd_enable="YES"${nc}   to   \033[1;36m/etc/rc.conf${nc}"
echo -e "${msg} Command being run here is:"
echo -e "${cmd}     /usr/local/etc/rc.d/lighttpd start${nc}"
echo -e "${sep}"
echo " "

/usr/local/etc/rc.d/lighttpd start

echo " "
echo -e "${sep}"
echo -e "${msg} Now to finish nextcloud setup${nc}"
echo -e "${sep}"
echo " "

trusteddomainerror

echo " " 
echo -e "${sep}"
echo -e "${msg} It looks like we finished here!!! NICE${nc}"
echo -e "${msg} Now you can head to ${url}https://$server_ip:$server_port${nc}"
echo -e "${msg} to use your nextcloud whenever you wish!${nc}"
echo " "
echo " "
echo " "
echo -e "${emp} Memory Caching ${msg}will have to be enabled manually.${nc}"
echo -e "${msg} This is entirely optional. Head to this file:${nc}"
echo -e "\033[1;36m    /usr/local/www/nextcloud/config/config.php${nc} ${msg}and add:${nc}"
echo -e "\033[1;33m    'memcache.local' => '\OC\Memcache\APCu',${nc}"
echo -e "${msg} right above the last line.${nc}"
echo -e "${msg} Once you've edited this file, restart the server with:${nc}" 
echo -e "${cmd}   /usr/local/etc/rc.d/lighttpd restart${nc}"
echo " "
echo " "
echo " "
echo -e "${msg} If you need any help, visit the forums here:${nc}"
echo -e "${url} http://forums.nas4free.org/viewtopic.php?f=79&t=9383${nc}"
echo -e "${msg} Or jump on my Discord server${nc}"
echo -e "${url} https://discord.gg/0bXnhqvo189oM8Cr${nc}"
echo -e "${sep}"
echo " "
After the script in jail:

Code: Select all

mysql -u root -p 
CREATE DATABASE nextcloud;
exit;
Last edited by mekonghigh on 07 Jan 2017 17:33, edited 1 time in total.

User avatar
Nostalgist92
experienced User
experienced User
Posts: 100
Joined: 09 Feb 2013 00:04
Status: Offline

Re: [HOWTO] Install NextCloud/ownCloud inside a Jail NAS4Free 10.x

#132

Post by Nostalgist92 » 07 Jan 2017 15:34

mekonghigh wrote:I changed a few things to the script from http://vengefulsyndicate.com/download/12097/.
This wil install nextcloud 11.0.0 stable in jail on NAS4Free 11.0.0.4.3330.
What you posted is on the right track but a couple things to note:
  • "mysql70" & php70-mysql don't exist, this would cause the entire thing to not work.
  • php56 is still more than enough for nextcloud though php70 is fine also (Newest script is on php70).
  • Don't need to create a database with the updated script, script takes care of it by creating the database before the mysql root password is set (Change the database name where you change the IP/version if you desire but default is just "nextcloud" for the DB name).
This bit:

Code: Select all

fetch "https://download.nextcloud.com/server/releases/nextcloud-11.0.0.zip"
tar xf "nextcloud-11.0.0.zip" -C /usr/local/www
Should be

Code: Select all

fetch "https://download.nextcloud.com/server/releases/nextcloud-${nextcloud_version}.tar.bz2"
tar xf "nextcloud-${nextcloud_version}.tar.bz2" -C /usr/local/www
That way we only have to modify the "nextcloud_version="11.0.0"" near the top of the script (less effort trying to find this line as it's near the top rather than changing 2 lines way down near the bottom).



I did update the script to NextCloud i just forgot to add the link to it here. (Even the script you modified was an old version, had it on github but not vengefulsyndicate.com, woops hehe - even had a "v2" script i never uploaded that was even more user friendly ha! maybe i should get around to fixing that)

I've left links to the old owncloud scripts in the OP though i've changed the post to be more based around NextCloud.
Regardless, thanks for your post mekonghigh, the email notification reminded me to update this forum post!
Following the instructions with the latest links provided in the original post will give you nextcloud in a jail!
11.0.0.4 - Sayyadina (revision 3330) x64-full on Intel(R) Core(TM) i7-4820K CPU @ 4.20GHz | Corsair Vengeance Pro 64GB (4x8GB) CMY16GX3M2A1600C9 | 12 x 6TB WD RED RAIDZ2 + 2 x 256GB SSD Drives

mekonghigh
Starter
Starter
Posts: 39
Joined: 13 Oct 2013 18:03
Status: Offline

Re: [HOWTO] Install NextCloud/ownCloud inside a Jail NAS4Free 10.x

#133

Post by mekonghigh » 07 Jan 2017 17:49

Nostalgist92 wrote: What you posted is on the right track but a couple things to note:
  • "mysql70" & php70-mysql don't exist, this would cause the entire thing to not work.

I forgot to change te php70 to php56.
[*]php56 is still more than enough for nextcloud though php70 is fine also (Newest script is on php70).

[*]Don't need to create a database with the updated script, script takes care of it by creating the database before the mysql root password is set (Change the database name where you change the IP/version if you desire but default is just "nextcloud" for the DB name).[/list]

This bit:

Code: Select all

fetch "https://download.nextcloud.com/server/releases/nextcloud-11.0.0.zip"
tar xf "nextcloud-11.0.0.zip" -C /usr/local/www
Should be

Code: Select all

fetch "https://download.nextcloud.com/server/releases/nextcloud-${nextcloud_version}.tar.bz2"
tar xf "nextcloud-${nextcloud_version}.tar.bz2" -C /usr/local/www
That way we only have to modify the "nextcloud_version="11.0.0"" near the top of the script (less effort trying to find this line as it's near the top rather than changing 2 lines way down near the bottom).



I did update the script to NextCloud i just forgot to add the link to it here. (Even the script you modified was an old version, had it on github but not vengefulsyndicate.com, woops hehe - even had a "v2" script i never uploaded that was even more user friendly ha! maybe i should get around to fixing that)

I've left links to the old owncloud scripts in the OP though i've changed the post to be more based around NextCloud.
Regardless, thanks for your post mekonghigh, the email notification reminded me to update this forum post!
Following the instructions with the latest links provided in the original post will give you nextcloud in a jail!
Thanks, had it working with php56. Now i'm going to try your script with php70.

User avatar
Nostalgist92
experienced User
experienced User
Posts: 100
Joined: 09 Feb 2013 00:04
Status: Offline

Re: [HOWTO] Install NextCloud/ownCloud inside a Jail NAS4Free 11.x/10.x

#134

Post by Nostalgist92 » 07 Jan 2017 17:51

No problem, let me know how it goes. I tested it a couple times in fresh jails and it worked fine but let me know if you encounter any issues!
11.0.0.4 - Sayyadina (revision 3330) x64-full on Intel(R) Core(TM) i7-4820K CPU @ 4.20GHz | Corsair Vengeance Pro 64GB (4x8GB) CMY16GX3M2A1600C9 | 12 x 6TB WD RED RAIDZ2 + 2 x 256GB SSD Drives

mekonghigh
Starter
Starter
Posts: 39
Joined: 13 Oct 2013 18:03
Status: Offline

Re: [HOWTO] Install NextCloud/ownCloud inside a Jail NAS4Free 11.x/10.x

#135

Post by mekonghigh » 07 Jan 2017 18:06

Nostalgist92 wrote:No problem, let me know how it goes. I tested it a couple times in fresh jails and it worked fine but let me know if you encounter any issues!
Your script works well. :D

edit:

Code: Select all

Memcache \OC\Memcache\APCu not available for local cache Is the matching PHP module installed and enabled?
After i changed:

Code: Select all

Memory Caching will have to be enabled manually.
 This is entirely optional. Head to this file:
    /usr/local/www/nextcloud/config/config.php and add:
    'memcache.local' => '\OC\Memcache\APCu',
 right above the last line.
 Once you've edited this file, restart the server with:
   /usr/local/etc/rc.d/lighttpd restart

StanEsmith
Starter
Starter
Posts: 29
Joined: 13 Mar 2015 16:13
Status: Offline

Re: [HOWTO] Install NextCloud/ownCloud inside a Jail NAS4Free 11.x/10.x

#136

Post by StanEsmith » 14 Jan 2017 02:57

Loved the script you created! It works out fantastically. I had to redo my server these past two days and rebuild all my data but your script made it so easy to get nextcloud setup. I had only gotten it working and installed all from scratch when something crazy hit my install and I couldn't fix it by hand.

One thing I did have to install by hand though was the proper package php7-apc (can't remember the name exactly) in order to get memcache working correctly.

Other than that it's great and I love your design and the way you walk people through. Makes me want to have a look inside the script and try and create one for Emby and Subsonic install I do on my server. Nice job!

User avatar
Nostalgist92
experienced User
experienced User
Posts: 100
Joined: 09 Feb 2013 00:04
Status: Offline

Re: [HOWTO] Install NextCloud/ownCloud inside a Jail NAS4Free 11.x/10.x

#137

Post by Nostalgist92 » 14 Jan 2017 03:59

mekonghigh wrote:
07 Jan 2017 18:06
Nostalgist92 wrote:No problem, let me know how it goes. I tested it a couple times in fresh jails and it worked fine but let me know if you encounter any issues!
Your script works well. :D

edit:

Code: Select all

Memcache \OC\Memcache\APCu not available for local cache Is the matching PHP module installed and enabled?
After i changed:

Code: Select all

Memory Caching will have to be enabled manually.
 This is entirely optional. Head to this file:
    /usr/local/www/nextcloud/config/config.php and add:
    'memcache.local' => '\OC\Memcache\APCu',
 right above the last line.
 Once you've edited this file, restart the server with:
   /usr/local/etc/rc.d/lighttpd restart

Oops yeah forgot to make sure the APCu package was installed, updated the script!


StanEsmith wrote:
14 Jan 2017 02:57
Makes me want to have a look inside the script and try and create one for Emby and Subsonic install I do on my server. Nice job!

I actually have one for Emby also ;) I can't remember if i ever ended up doing Subsonic in it or not but i remember wanting to add it.

Code: Select all

https://vengefulsyndicate.com/download/12730/
or

Code: Select all

https://github.com/Nostalgist92/misc-code/blob/master/NAS4Free/aioscript.sh
11.0.0.4 - Sayyadina (revision 3330) x64-full on Intel(R) Core(TM) i7-4820K CPU @ 4.20GHz | Corsair Vengeance Pro 64GB (4x8GB) CMY16GX3M2A1600C9 | 12 x 6TB WD RED RAIDZ2 + 2 x 256GB SSD Drives

StanEsmith
Starter
Starter
Posts: 29
Joined: 13 Mar 2015 16:13
Status: Offline

Re: [HOWTO] Install NextCloud/ownCloud inside a Jail NAS4Free 11.x/10.x

#138

Post by StanEsmith » 14 Jan 2017 20:41

Wow that's pretty extensive stuff. How long did it take you to develop that script? I looked it over and you have quite a few different programs all baked into one script, even Subsonic was in there.

User avatar
Nostalgist92
experienced User
experienced User
Posts: 100
Joined: 09 Feb 2013 00:04
Status: Offline

Re: [HOWTO] Install NextCloud/ownCloud inside a Jail NAS4Free 11.x/10.x

#139

Post by Nostalgist92 » 14 Jan 2017 20:51

A bunch of it isn't finished, didn't take too long to get it together though. But because of how much is in it, it is definitely a lengthy work in progress. Especially due to only working on it for an hour or two a week when i get the chance.
I mainly use it to update my Emby so the rest hasn't been much of a high priority. I haven't even really tested much outside Emby so it's definitely a "use at your own risk" type of thing right now for anything other than listed under "Completed / fully functional"

Code: Select all

################################################
##### Completed / Almost Complete but fully functional
################################################
# Emby
# OwnCloud
# NextCloud
At the bottom it has a LOT of things i want to add but again, not a high priority :P
11.0.0.4 - Sayyadina (revision 3330) x64-full on Intel(R) Core(TM) i7-4820K CPU @ 4.20GHz | Corsair Vengeance Pro 64GB (4x8GB) CMY16GX3M2A1600C9 | 12 x 6TB WD RED RAIDZ2 + 2 x 256GB SSD Drives

StanEsmith
Starter
Starter
Posts: 29
Joined: 13 Mar 2015 16:13
Status: Offline

Re: [HOWTO] Install NextCloud/ownCloud inside a Jail NAS4Free 11.x/10.x

#140

Post by StanEsmith » 15 Jan 2017 03:28

Have you tried or had success running any of the collabora online stuff with Nextcloud? I've been very intrigued as making this a Google drive/storage replacement where I am in control of my own data.

Side note, I'll take a look at the script and see if I can get the subsonic portion working. I'd love to try this out when rebuilding my server. It'd make things run so smoothly.

User avatar
Nostalgist92
experienced User
experienced User
Posts: 100
Joined: 09 Feb 2013 00:04
Status: Offline

Re: [HOWTO] Install NextCloud/ownCloud inside a Jail NAS4Free 11.x/10.x

#141

Post by Nostalgist92 » 15 Jan 2017 06:36

Never tried Collabora with nextcloud. We'd need to have it in the packages or in the ports tree at the very least if we want it alongside nextcloud in a jail though. I think i vaguely remember trying to set up libreoffice with owncloud or pydio some time ago and having some problems but i could just be imagining that. I think for now if you're looking to use the collabora integration i'd have to say you're on your own with that one. I'd definitely try and integrate it in the script if you get it going though.

Ever considered madsonic? I haven't used either since i got Emby going but i remember madsonic having some extra features/benefits over subsonic a while back. Just throwing it out there as i was adding madsonic to the script earlier :P
11.0.0.4 - Sayyadina (revision 3330) x64-full on Intel(R) Core(TM) i7-4820K CPU @ 4.20GHz | Corsair Vengeance Pro 64GB (4x8GB) CMY16GX3M2A1600C9 | 12 x 6TB WD RED RAIDZ2 + 2 x 256GB SSD Drives

StanEsmith
Starter
Starter
Posts: 29
Joined: 13 Mar 2015 16:13
Status: Offline

Re: [HOWTO] Install NextCloud/ownCloud inside a Jail NAS4Free 11.x/10.x

#142

Post by StanEsmith » 17 Jan 2017 14:23

I've looked at Madsonic before but not set it up as Subsonic offers a dns/domain for my server that makes it easier to access outside the house. Probably could do the same thing and set all service accessible from a main website easier. Just haven't had the time to look into it yet.

adamvnz
NewUser
NewUser
Posts: 7
Joined: 12 May 2013 11:39
Status: Offline

Re: [HOWTO] Install NextCloud/ownCloud inside a Jail NAS4Free 11.x/10.x

#143

Post by adamvnz » 14 Apr 2017 07:50

Hi there,
I have already got owncloud installed on my nas4free. Which I had no issue installing.
Having a go at putting in Nextcloud and running into issues
Please help!
This is a copy of what happens durring install.
as you will see directories are not being created


Code: Select all

 Let's start with double checking some things
-------------------------------------------------------
 
 Is this script running INSIDE of a jail?
   Continue? [y/N] y
 Great! Moving on..
 
 Checking to see if you need to modify the script
 If ANY of these DON'T match YOUR setup, answer with no.
 
      #1: Is this your jails IP? 192.168.1.210
      #2: Is this the port you want to use? 443
      #3: Is this the NextCloud version you want to install? 11.0.0
      #4: Is this the NextCloud database name you want to use? nextcloud
 
 If #1 or #2 are incorrect you will encounter issues!
   Continue? [y/N] y
 Great! Moving on..
 
 Awesome, now we are ready to get on with it!
 
-------------------------------------------------------
   Let's get to installing some stuff!!
-------------------------------------------------------
 
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
pkg: No packages available to install matching 'php70-APCu' have been found in the repositories
 
-------------------------------------------------------
 Packages installed - now configuring MySQL
-------------------------------------------------------
 
/tmp/nextcloud_injail.sh: cannot create /var/db/mysql/my.cnf: No such file or directory
/tmp/nextcloud_injail.sh: cannot create /var/db/mysql/my.cnf: No such file or directory
/tmp/nextcloud_injail.sh: /usr/local/etc/rc.d/mysql-server: not found
 
-------------------------------------------------------
 Creating database for nextcloud
-------------------------------------------------------
 
/tmp/nextcloud_injail.sh: mysql: not found
 Database was created: nextcloud.
 
-------------------------------------------------------
 Securing the install. Default root password is blank,
 you want to provide a strong root password, remove the
 anonymous accounts, disallow remote root access,
 remove the test database, and reload privilege tables
-------------------------------------------------------
 
/tmp/nextcloud_injail.sh: mysql_secure_installation: not found
 
-------------------------------------------------------
 Done with MySQL - Performing key operations now
-------------------------------------------------------
 
Generating RSA private key, 1024 bit long modulus
..............................++++++
.....++++++
e is 65537 (0x10001)
Enter pass phrase for server.key:
Verifying - Enter pass phrase for server.key:
 
-------------------------------------------------------
 Removing password from key
-------------------------------------------------------
 
Enter pass phrase for server.key:
writing RSA key
 
-------------------------------------------------------
 Creating cert request. The Common Name should match
 the URL you want to use
-------------------------------------------------------
 
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:NZ
State or Province Name (full name) [Some-State]:xxx
Locality Name (eg, city) []:xxx
Organization Name (eg, company) [Internet Widgits Pty Ltd]:
Organizational Unit Name (eg, section) []:
Common Name (e.g. server FQDN or YOUR name) []:
Email Address []:

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
 
-------------------------------------------------------
 Creating cert & pem file & moving to proper location
-------------------------------------------------------
 
Signature ok
subject=/C=NZ/ST=xxx/L=xxx/O=Internet Widgits Pty Ltd/CN=
Getting Private key
mkdir: /usr/local/etc/lighttpd: No such file or directory
cp: /usr/local/etc/lighttpd/ssl: No such file or directory
chown: /usr/local/etc/lighttpd/ssl/: No such file or directory
 
-------------------------------------------------------
 Creating backup of lighttpd config
-------------------------------------------------------
 
cp: /usr/local/etc/lighttpd/lighttpd.conf: No such file or directory
 
-------------------------------------------------------
 Modifying lighttpd.conf file
-------------------------------------------------------
 
cat: /tmp/nextcloud_injail.sh: cannot create /usr/local/etc/lighttpd/lighttpd.conf: No such file or directory
/usr/local/etc/lighttpd/old_config.bak: No such file or directory
 
-------------------------------------------------------
 Adding stuff to lighttpd.conf file
-------------------------------------------------------
 
/tmp/nextcloud_injail.sh: cannot create /usr/local/etc/lighttpd/lighttpd.conf: No such file or directory
/tmp/nextcloud_injail.sh: cannot create /usr/local/etc/lighttpd/lighttpd.conf: No such file or directory
/tmp/nextcloud_injail.sh: cannot create /usr/local/etc/lighttpd/lighttpd.conf: No such file or directory
/tmp/nextcloud_injail.sh: cannot create /usr/local/etc/lighttpd/lighttpd.conf: No such file or directory
/tmp/nextcloud_injail.sh: cannot create /usr/local/etc/lighttpd/lighttpd.conf: No such file or directory
/tmp/nextcloud_injail.sh: cannot create /usr/local/etc/lighttpd/lighttpd.conf: No such file or directory
/tmp/nextcloud_injail.sh: cannot create /usr/local/etc/lighttpd/lighttpd.conf: No such file or directory
/tmp/nextcloud_injail.sh: cannot create /usr/local/etc/lighttpd/lighttpd.conf: No such file or directory
/tmp/nextcloud_injail.sh: cannot create /usr/local/etc/lighttpd/lighttpd.conf: No such file or directory
/tmp/nextcloud_injail.sh: cannot create /usr/local/etc/lighttpd/lighttpd.conf: No such file or directory
/tmp/nextcloud_injail.sh: cannot create /usr/local/etc/lighttpd/lighttpd.conf: No such file or directory
/tmp/nextcloud_injail.sh: cannot create /usr/local/etc/lighttpd/lighttpd.conf: No such file or directory
/tmp/nextcloud_injail.sh: cannot create /usr/local/etc/lighttpd/lighttpd.conf: No such file or directory
/tmp/nextcloud_injail.sh: cannot create /usr/local/etc/lighttpd/lighttpd.conf: No such file or directory
/tmp/nextcloud_injail.sh: cannot create /usr/local/etc/lighttpd/lighttpd.conf: No such file or directory
/tmp/nextcloud_injail.sh: cannot create /usr/local/etc/lighttpd/lighttpd.conf: No such file or directory
/tmp/nextcloud_injail.sh: cannot create /usr/local/etc/lighttpd/lighttpd.conf: No such file or directory
 
-------------------------------------------------------
 Enabling the fastcgi module
-------------------------------------------------------
 
cp: /usr/local/etc/lighttpd/modules.conf: No such file or directory
/tmp/nextcloud_injail.sh: cannot create /usr/local/etc/lighttpd/modules.conf: No such file or directory
cat: /usr/local/etc/lighttpd/old_modules.bak: No such file or directory
 
-------------------------------------------------------
 Adding stuff to fastcgi.conf file
-------------------------------------------------------
 
/tmp/nextcloud_injail.sh: cannot create /usr/local/etc/lighttpd/conf.d/fastcgi.conf: No such file or directory
/tmp/nextcloud_injail.sh: cannot create /usr/local/etc/lighttpd/conf.d/fastcgi.conf: No such file or directory
/tmp/nextcloud_injail.sh: cannot create /usr/local/etc/lighttpd/conf.d/fastcgi.conf: No such file or directory
/tmp/nextcloud_injail.sh: cannot create /usr/local/etc/lighttpd/conf.d/fastcgi.conf: No such file or directory
/tmp/nextcloud_injail.sh: cannot create /usr/local/etc/lighttpd/conf.d/fastcgi.conf: No such file or directory
/tmp/nextcloud_injail.sh: cannot create /usr/local/etc/lighttpd/conf.d/fastcgi.conf: No such file or directory
/tmp/nextcloud_injail.sh: cannot create /usr/local/etc/lighttpd/conf.d/fastcgi.conf: No such file or directory
/tmp/nextcloud_injail.sh: cannot create /usr/local/etc/lighttpd/conf.d/fastcgi.conf: No such file or directory
/tmp/nextcloud_injail.sh: cannot create /usr/local/etc/lighttpd/conf.d/fastcgi.conf: No such file or directory
/tmp/nextcloud_injail.sh: cannot create /usr/local/etc/lighttpd/conf.d/fastcgi.conf: No such file or directory
/tmp/nextcloud_injail.sh: cannot create /usr/local/etc/lighttpd/conf.d/fastcgi.conf: No such file or directory
/tmp/nextcloud_injail.sh: cannot create /usr/local/etc/lighttpd/conf.d/fastcgi.conf: No such file or directory
/tmp/nextcloud_injail.sh: cannot create /usr/local/etc/lighttpd/conf.d/fastcgi.conf: No such file or directory
/tmp/nextcloud_injail.sh: cannot create /usr/local/etc/lighttpd/conf.d/fastcgi.conf: No such file or directory
/tmp/nextcloud_injail.sh: cannot create /usr/local/etc/lighttpd/conf.d/fastcgi.conf: No such file or directory
 
-------------------------------------------------------
 Obtaining corrected MIME.conf file for lighttpd to use
-------------------------------------------------------
 
mv: rename /usr/local/etc/lighttpd/conf.d/mime.conf to /usr/local/etc/lighttpd/conf.d/mime_conf.bak: No such file or directory
fetch: /usr/local/etc/lighttpd/conf.d/mime.conf: open(): No such file or directory
 
-------------------------------------------------------
 Modifying php.ini
-------------------------------------------------------
 
 
-------------------------------------------------------
 Creating www folder and downloading NextCloud
-------------------------------------------------------
 
Certificate verification failed for /C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3
34374329608:error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed:/usr/src/secure/lib/libssl/../../../crypto/openssl/ssl/s3_clnt.c:1264:
fetch: https://download.nextcloud.com/server/releases/nextcloud-11.0.0.tar.bz2: Authentication error
tar: Error opening archive: Failed to open 'nextcloud-11.0.0.tar.bz2'
 
-------------------------------------------------------
 Adding lighttpd to rc.conf
-------------------------------------------------------
 
 
-------------------------------------------------------
  Done, lighttpd should start up automatically!
-------------------------------------------------------
 
 
-------------------------------------------------------
 Attempting to start webserver.
 If you get a Cannot 'start' lighttpd error, add:
     lighttpd_enable=YES   to   /etc/rc.conf
 Command being run here is:
     /usr/local/etc/rc.d/lighttpd start
-------------------------------------------------------
 
/tmp/nextcloud_injail.sh: /usr/local/etc/rc.d/lighttpd: not found
 
-------------------------------------------------------
 Now to finish nextcloud setup
-------------------------------------------------------
 
 
 Please finish the nextcloud setup before continuing
 Head to https://192.168.1.210:443 to do this.
 Fill out the page you are presented with and hit finish
 
 Admin username & password = whatever you choose
 
 Make sure you click 'Storage & database'
 
 Database user = root |  Database password = 
 the mysql password you chose earlier during the script.
 Database name = nextcloud 
 
 Once the page reloads,
   do you have a 'untrusted domain' error? [y/N] y
 
 Doing some last second changes to fix that..
 
/tmp/nextcloud_injail.sh: cannot create /usr/local/www/nextcloud/config/trusted.txt: No such file or directory
cp: /usr/local/www/nextcloud/config/config.php: No such file or directory
/tmp/nextcloud_injail.sh: cannot create /usr/local/www/nextcloud/config/config.php: No such file or directory
cat: /usr/local/www/nextcloud/config/old_config.bak: No such file or directory
rm: /usr/local/www/nextcloud/config/trusted.txt: No such file or directory
 Done, continuing with the rest of the script
 
-------------------------------------------------------
 It looks like we finished here!!! NICE
 Now you can head to https://192.168.1.210:443
 to use your nextcloud whenever you wish!
 
 
 
 Memory Caching will have to be enabled manually.
 This is entirely optional. Head to this file:
    /usr/local/www/nextcloud/config/config.php and add:
    'memcache.local' => '\OC\Memcache\APCu',
 right above the last line.
 Once you've edited this file, restart the server with:
   /usr/local/etc/rc.d/lighttpd restart
 
 
 
 If you need any help, visit the forums here:
 http://forums.nas4free.org/viewtopic.php?f=79&t=9383
 Or jump on my Discord server
 https://discord.gg/0bXnhqvo189oM8Cr
-------------------------------------------------------

I'm not sure why the directories are not being created?
I have created them manually and changed
fetch "https://download.nextcloud.com/server/r ... n}.tar.bz2"
to
fetch --no-verify-peer "https://download.nextcloud.com/server/r ... n}.tar.bz2"
Now I get this result

Code: Select all

root@nextCloud:/ # /tmp/nextcloud_injail.sh
 
-------------------------------------------------------
   Welcome to the NextCloud installer!
-------------------------------------------------------
 
 
 
-------------------------------------------------------
   Let's start with double checking some things
-------------------------------------------------------
 
 Is this script running INSIDE of a jail?
   Continue? [y/N] y
 Great! Moving on..
 
 Checking to see if you need to modify the script
 If ANY of these DON'T match YOUR setup, answer with no.
 
      #1: Is this your jails IP? 192.168.1.210
      #2: Is this the port you want to use? 443
      #3: Is this the NextCloud version you want to install? 11.0.2
      #4: Is this the NextCloud database name you want to use? nextcloud
 
 If #1 or #2 are incorrect you will encounter issues!
   Continue? [y/N] y
 Great! Moving on..
 
 Awesome, now we are ready to get on with it!
 
-------------------------------------------------------
   Let's get to installing some stuff!!
-------------------------------------------------------
 
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
pkg: No packages available to install matching 'php70-APCu' have been found in the repositories
 
-------------------------------------------------------
 Packages installed - now configuring MySQL
-------------------------------------------------------
 
/tmp/nextcloud_injail.sh: /usr/local/etc/rc.d/mysql-server: Permission denied
 
-------------------------------------------------------
 Creating database for nextcloud
-------------------------------------------------------
 
/tmp/nextcloud_injail.sh: mysql: not found
 Database was created: nextcloud.
 
-------------------------------------------------------
 Securing the install. Default root password is blank,
 you want to provide a strong root password, remove the
 anonymous accounts, disallow remote root access,
 remove the test database, and reload privilege tables
-------------------------------------------------------
 
/tmp/nextcloud_injail.sh: mysql_secure_installation: not found
 
-------------------------------------------------------
 Done with MySQL - Performing key operations now
-------------------------------------------------------
 
Generating RSA private key, 1024 bit long modulus
......++++++
.................................................................................++++++
e is 65537 (0x10001)
Enter pass phrase for server.key:
Verifying - Enter pass phrase for server.key:
 
-------------------------------------------------------
 Removing password from key
-------------------------------------------------------
 
Enter pass phrase for server.key:
writing RSA key
 
-------------------------------------------------------
 Creating cert request. The Common Name should match
 the URL you want to use
-------------------------------------------------------
 
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:NZ
State or Province Name (full name) [Some-State]:
Locality Name (eg, city) []:
Organization Name (eg, company) [Internet Widgits Pty Ltd]:
Organizational Unit Name (eg, section) []:
Common Name (e.g. server FQDN or YOUR name) []:
Email Address []:

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
 
-------------------------------------------------------
 Creating cert & pem file & moving to proper location
-------------------------------------------------------
 
Signature ok
subject=/C=NZ/ST=Some-State/O=Internet Widgits Pty Ltd
Getting Private key
mkdir: /usr/local/etc/lighttpd/ssl: File exists
 
-------------------------------------------------------
 Creating backup of lighttpd config
-------------------------------------------------------
 
 
-------------------------------------------------------
 Modifying lighttpd.conf file
-------------------------------------------------------
 
 
-------------------------------------------------------
 Adding stuff to lighttpd.conf file
-------------------------------------------------------
 
 
-------------------------------------------------------
 Enabling the fastcgi module
-------------------------------------------------------
 
 
-------------------------------------------------------
 Adding stuff to fastcgi.conf file
-------------------------------------------------------
 
 
-------------------------------------------------------
 Obtaining corrected MIME.conf file for lighttpd to use
-------------------------------------------------------
 
/usr/local/etc/lighttpd/conf.d/mime.conf      100% of 3132  B 9323 kBps 00m00s
 
-------------------------------------------------------
 Modifying php.ini
-------------------------------------------------------
 
 
-------------------------------------------------------
 Creating www folder and downloading NextCloud
-------------------------------------------------------
 
nextcloud-11.0.2.tar.bz2                      100% of   36 MB  985 kBps 00m38s
 
-------------------------------------------------------
 Adding lighttpd to rc.conf
-------------------------------------------------------
 
 
-------------------------------------------------------
  Done, lighttpd should start up automatically!
-------------------------------------------------------
 
 
-------------------------------------------------------
 Attempting to start webserver.
 If you get a Cannot 'start' lighttpd error, add:
     lighttpd_enable=YES   to   /etc/rc.conf
 Command being run here is:
     /usr/local/etc/rc.d/lighttpd start
-------------------------------------------------------
 
/tmp/nextcloud_injail.sh: /usr/local/etc/rc.d/lighttpd: Permission denied
 
-------------------------------------------------------
 Now to finish nextcloud setup
-------------------------------------------------------
 
 
 Please finish the nextcloud setup before continuing
 Head to https://192.168.1.210:443 to do this.
 Fill out the page you are presented with and hit finish
 
 Admin username & password = whatever you choose
 
 Make sure you click 'Storage & database'
 
 Database user = root |  Database password = 
 the mysql password you chose earlier during the script.
 Database name = nextcloud 
 
 Once the page reloads,
   do you have a 'untrusted domain' error? [y/N] y
 
 Doing some last second changes to fix that..
 
cp: /usr/local/www/nextcloud/config/config.php: No such file or directory
cat: /usr/local/www/nextcloud/config/old_config.bak: No such file or directory
 Done, continuing with the rest of the script
 
-------------------------------------------------------
 It looks like we finished here!!! NICE
 Now you can head to https://192.168.1.210:443
 to use your nextcloud whenever you wish!
 
 
 
 Memory Caching will have to be enabled manually.
 This is entirely optional. Head to this file:
    /usr/local/www/nextcloud/config/config.php and add:
    'memcache.local' => '\OC\Memcache\APCu',
 right above the last line.
 Once you've edited this file, restart the server with:
   /usr/local/etc/rc.d/lighttpd restart
 
 
 
 If you need any help, visit the forums here:
 http://forums.nas4free.org/viewtopic.php?f=79&t=9383
 Or jump on my Discord server
 https://discord.gg/0bXnhqvo189oM8Cr
Permission denied look like the only error now.
Ideas how fix plz

User avatar
Nostalgist92
experienced User
experienced User
Posts: 100
Joined: 09 Feb 2013 00:04
Status: Offline

Re: [HOWTO] Install NextCloud/ownCloud inside a Jail NAS4Free 11.x/10.x

#144

Post by Nostalgist92 » 14 Apr 2017 08:11

Seems like none of the packages were installed. Hence the mysql/lighttpd not being found + directory errors. Looks like APCu is no longer available in the repository? (which broke everything, if say 'package2' package isn't found when doing a 'pkg install package1 package2 package3', it won't install any of them) I'll have to take a look at what happened to the APCu package.

A downside to the script failing is running it a 2nd time in the same jail isn't ideal. I've removed "php70-APCu" from the script for the time being. Have another try in a FRESH jail to ensure the trail of errors from the previous attempt don't interfere.
11.0.0.4 - Sayyadina (revision 3330) x64-full on Intel(R) Core(TM) i7-4820K CPU @ 4.20GHz | Corsair Vengeance Pro 64GB (4x8GB) CMY16GX3M2A1600C9 | 12 x 6TB WD RED RAIDZ2 + 2 x 256GB SSD Drives

User avatar
Nostalgist92
experienced User
experienced User
Posts: 100
Joined: 09 Feb 2013 00:04
Status: Offline

Re: [HOWTO] Install NextCloud/ownCloud inside a Jail NAS4Free 11.x/10.x

#145

Post by Nostalgist92 » 14 Apr 2017 08:35

Oops, seems pecl-apcu also needed to be changed to pecl-apcu4, fixed that up and pushed to github!
11.0.0.4 - Sayyadina (revision 3330) x64-full on Intel(R) Core(TM) i7-4820K CPU @ 4.20GHz | Corsair Vengeance Pro 64GB (4x8GB) CMY16GX3M2A1600C9 | 12 x 6TB WD RED RAIDZ2 + 2 x 256GB SSD Drives

adamvnz
NewUser
NewUser
Posts: 7
Joined: 12 May 2013 11:39
Status: Offline

Re: [HOWTO] Install NextCloud/ownCloud inside a Jail NAS4Free 11.x/10.x

#146

Post by adamvnz » 14 Apr 2017 08:50

Thanks will give it a try

adamvnz
NewUser
NewUser
Posts: 7
Joined: 12 May 2013 11:39
Status: Offline

Re: [HOWTO] Install NextCloud/ownCloud inside a Jail NAS4Free 11.x/10.x

#147

Post by adamvnz » 14 Apr 2017 09:10

@Nostalgist92 Thank You Very much!!!
All up and running now

papaschlumpf88
Starter
Starter
Posts: 20
Joined: 25 Apr 2017 19:43
Status: Offline

Re: [HOWTO] Install NextCloud/ownCloud inside a Jail NAS4Free 11.x/10.x

#148

Post by papaschlumpf88 » 27 Apr 2017 11:36

Hello, I´m changed a couple of days from a other NAS software to nas4free and I´m verry happy now. Nas4free is a awesome projekt and the Forum is geat. I´m sorry for my bad englisch but I try to get better ;).

I try your script from

fetch --no-verify-peer -o /tmp/nextcloud_injail.sh "https://raw.githubusercontent.com/Nosta ... _injail.sh"

everything workes fine I still get the message from the memcache and if I enable it with this 'memcache.local' => '\OC\Memcache\APCu', I get the error
Memcache \OC\Memcache\APCu not available for local cache Is the matching PHP module installed and enabled?

Did I forget something?

After this I try the Script ......nextcloud_injailv2.sh. It looks realy awesome. But at the end I get the Error 404 not found after I try to got to the webif nextcloud installation.

I always create a new jail and start from the beginning.
How can I create a ssl certificate with a longer time for example 10... years?

Can someone help me please?
Thanks
11.2.0.4 - Omnius (Revision 6315) RootOnZFS | x64-full auf Intel(R) Core(TM) i3-7100 CPU @ 3.90GHz | ASRockRack C236 WSI | 16223MiB ECC Kingston RAM | APC BackUPS Pro | 6 x 6TB WD RED RAIDZ2 | 2 x 1TB SSD Mirror

User avatar
Nostalgist92
experienced User
experienced User
Posts: 100
Joined: 09 Feb 2013 00:04
Status: Offline

Re: [HOWTO] Install NextCloud/ownCloud inside a Jail NAS4Free 11.x/10.x

#149

Post by Nostalgist92 » 27 Apr 2017 11:48

Welcome to N4F! It definitely is an amazing project.

I think that the error message you are seeing has something to do with the last couple of posts: switching to pecl-apcu4 as php70-APCu was removed from the repository
I'll have to take a look at it over the next day or 2, probably something else I need to adjust to get it going again but caching isn't REQUIRED so it's fine to ignore the error message for now. (Also, just to double check, make sure you have restarted the web server using: /usr/local/etc/rc.d/lighttpd restart)

I've been rather lazy with the "nextcloud_injailv2.sh", haven't updated it in a while. I'll see what's going on with that when I check out the APCu problem.

As for the SSL certificate, it may be worth looking into LetsEncrypt. You can install a package in your jail called "certbot" to set up the SSL certificate. It won't last 10 years but you can also set a cron job to run once every couple of weeks to renew the certificate easily enough.
Might look into adding LetsEncrypt to the script also at a later point but until then I'd check out these sites to try and find out how to get started with it:
https://letsencrypt.org/getting-started/
https://certbot.eff.org/#freebsd-nginx
Last edited by Nostalgist92 on 27 Apr 2017 12:09, edited 1 time in total.
11.0.0.4 - Sayyadina (revision 3330) x64-full on Intel(R) Core(TM) i7-4820K CPU @ 4.20GHz | Corsair Vengeance Pro 64GB (4x8GB) CMY16GX3M2A1600C9 | 12 x 6TB WD RED RAIDZ2 + 2 x 256GB SSD Drives

User avatar
raulfg3
Site Admin
Site Admin
Posts: 4901
Joined: 22 Jun 2012 22:13
Location: Madrid (ESPAÑA)
Contact:
Status: Offline

Re: [HOWTO] Install NextCloud/ownCloud inside a Jail NAS4Free 11.x/10.x

#150

Post by raulfg3 » 27 Apr 2017 11:49

papaschlumpf88 wrote:
27 Apr 2017 11:36
Hello, I´m changed a couple of days from a other NAS software to nas4free and I´m verry happy now. Nas4free is a awesome projekt and the Forum is geat. I´m sorry for my bad englisch but I try to get better ;).

I try your script from

fetch --no-verify-peer -o /tmp/nextcloud_injail.sh "https://raw.githubusercontent.com/Nosta ... _injail.sh"

everything workes fine I still get the message from the memcache and if I enable it with this 'memcache.local' => '\OC\Memcache\APCu', I get the error
Memcache \OC\Memcache\APCu not available for local cache Is the matching PHP module installed and enabled?

Did I forget something?

After this I try the Script ......nextcloud_injailv2.sh. It looks realy awesome. But at the end I get the Error 404 not found after I try to got to the webif nextcloud installation.

I always create a new jail and start from the beginning.
How can I create a ssl certificate with a longer time for example 10... years?

Can someone help me please?
Thanks
please try to install using OBI is better ( easy to install).

viewtopic.php?f=71&t=11189
12.0.0.4 - BETA (revision 6625)+OBI on SUPERMICRO X8SIL-F 8GB of ECC RAM, 12x3TB disk in 3 vdev in RaidZ1 = 32TB Raw size only 22TB usable

Wiki
Last changes
Old Wiki

Post Reply

Return to “Jails”