World Of Warcraft players interested in doing WoD raids, head over to here.
Players interested in being a part of the raid team for Legion, see this post.
If you're feeling generous enough to donate to help alleviate costs of the website/AMR subscription, head here
Donations for the new server build are more than welcome too! head to this link for that :)

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

Post Reply
User avatar

Topic author
Nozza
Admin / Guild Leader
Posts: 68
Joined: January 13th, 2014, 1:18 pm
Location: Brisbane (QLD), Australia
Contact:
Status: Offline

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

#1

Post by Nozza » September 25th, 2015, 11:26 am

This How-To will walk you through how to setup your own cloud service using OwnCloud!
It works for both Embedded and Full releases.
Using a jail for OwnCloud helps prevent unwanted problems when you upgrade NAS4Free as upgrading N4F generally breaks OwnCloud.
Installing packages such as OwnCloud is better off in a jail as it also reduces the risk of breaking your NAS4Free system and if something goes severely wrong with a package in a jail, just delete the jail and try again with a fresh one rather than reinstalling the entire N4F system.


Requirements:
  1. You need to have a fully working jail.
    It is best to do this in a completely fresh jail. This guide will not tell you how to set one up, i may post a new guide with how to do so at a later date but for now you can visit TheBrig jail manager thread over here: view topic
    Here is a video guide for TheBrig: https://www.youtube.com/watch?v=KYH3cOONpYQ


    You must now how to access your jails ssh.
    I highly recommend PuTTY or KiTTY for this, just google one or the other, they are both easy to find or use the links below.

    You will need the script attached to this post - 'owncloud_injail.sh'.
    You only need to download the script attached to this post if you use the WinSCP method.
    Thanks to fsbruva for the original script. I've just modified it to work with the new pkg install system.
    If, for some reason, you are using an older version of NAS4Free which still uses pkg_add, head over to the original OwnCloud topic.

Optional, but recommended:


A few other notes as posted by fsbruva:
  • Will use lighttpd
    Will use HTTPS only
    Will only serve Owncloud (no other virtual servers)
    Will use mysql (better)
    WIll use mysql sockets (much more secure)
    Will utilize fast-cgi (as per owncloud's recommendation)
    Will utilize fast-cgi sockets (much more efficient)
  • * This script must be run at the command line, because it is interactive. There is no way to make it not so.
    * You will need to supply some info during the install:
    a. A new SQL database root password
    b. A private key password (you will enter it, confirm it, then enter it a last time to remove it)
    c. The necessary data for your self-signed cert to use for HTTPS. This is up to you, and doesn't really matter.
I will update this post with screenshots at some point, for now use raulfg3's ones as a temporary reference in the original thread which is linked above.
Now that stuff is out of the way, let's get on with installing.
_________________________________________________________________________________________________________________________

Installing:

There are 2 methods to get the script and run it. Using a mix of WinSCP+PuTTY or just solely using PuTTY
Pick only one of the methods.

NOTE 1: You MUST make sure you edit the script BEFORE running it and modify the IP in the script to match your jails IP.
NOTE 2: When you are asked to define a password for MySQL, BE SURE TO REMEMBER IT. You will need this later.

WinSCP+PuTTY Method:

1. Firstly, download the attached script.
owncloud_injail.sh
2. Modify the file, editing the "server_ip" to match your jails IP.
3. Log in to the jail with WinSCP and copy the script to /tmp
4. Set execute permissions on the file
5. SSH in to your jail and run:

Code: Select all

/tmp/owncloud_injail.sh
6. Follow any prompts
7. After everything is complete head to https://192.168.1.200:81 (changing the IP to your own)
8. Finish the owncloud setup.

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------

PuTTY Only Method:
(The recommended way)


Video guide for owncloud install: https://www.youtube.com/watch?v=H5sdhtjXCU0

1. Log in to your jail (substitute "1" with your own jails id or name):

Code: Select all

jexec 1 csh
2. Install nano (If you are asked about updating the package management system at this point, choose yes)

Code: Select all

pkg install nano
3. Get the script:

Code: Select all

fetch -o /tmp/owncloud_injail.sh http://vengefulsyndicate.com/download/12097/
If the above link fails, here are alternatives (This goes for if you get an error about "file not found" when trying to run the script):

Code: Select all

fetch --no-verify-peer -o /tmp/owncloud_injail.sh "https://raw.githubusercontent.com/Nostalgist92/misc-code/master/NAS4Free/OwnCloud/owncloud_injail.sh"
4. Make it executable

Code: Select all

chmod a+x /tmp/owncloud_injail.sh
5. Edit the script (Press Ctrl+X then Y then Enter to save your changes)

Code: Select all

nano /tmp/owncloud_injail.sh
6. Run it

Code: Select all

/tmp/owncloud_injail.sh
7. Follow any prompts
8. After everything is complete head to https://192.168.1.200:81 (changing the IP to your own)
9. Finish the owncloud setup.

_________________________________________________________________________________________________________________________

This is what the console window should roughly look like without any errors:

Code: Select all

nas ~/ root~$ jexec owncloud csh
root@owncloud:/ # fetch --no-verify-peer -o /tmp/owncloud_injail.sh "https://raw.githubusercontent.com/Nostalgist92/misc-code/master/NAS4Free/OwnCloud/owncloud_injail.sh"
/tmp/owncloud_injail.sh      100% of   11 kB  154 MBps 00m00s
root@owncloud:/ # chmod a+x /tmp/owncloud_injail.sh
root@owncloud:/ # /tmp/owncloud_injail.sh
##################################################
#   Welcome to the owncloud installer!
##################################################

##################################################
#   Let's start by installing some stuff!!
##################################################

The package management tool is not yet installed on your system.
Do you want to fetch and install it now? [y/N]: y
Bootstrapping pkg from pkg+http://pkg.FreeBSD.org/FreeBSD:10:amd64/quarterly, please wait...
Verifying signature with trusted certificate pkg.freebsd.org.2013102301... done
[owncloud.local] Installing pkg-1.6.2...
[owncloud.local] Extracting pkg-1.6.2: 100%
Message from pkg-1.6.2:
If you are upgrading from the old package format, first run:

  # pkg2ng
Updating FreeBSD repository catalogue...
[owncloud.local] Fetching meta.txz: 100%    944 B   0.9kB/s    00:01
[owncloud.local] Fetching packagesite.txz: 100%    5 MiB 197.6kB/s    00:28
Processing entries: 100%
FreeBSD repository update completed. 24677 packages processed.
Updating database digests format: 100%
The following 67 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        lighttpd: 1.4.38
        php56-openssl: 5.6.17
        php56-ctype: 5.6.17
        php56-curl: 5.6.17
        php56-dom: 5.6.17
        php56-fileinfo: 5.6.17
        php56-filter: 5.6.17
        php56-gd: 5.6.17
        php56-hash: 5.6.17
        php56-iconv: 5.6.17
        php56-json: 5.6.17
        php56-mbstring: 5.6.17_1
        php56-mysql: 5.6.17
        php56-pdo: 5.6.17
        php56-pdo_mysql: 5.6.17
        php56-pdo_sqlite: 5.6.17
        php56-session: 5.6.17
        php56-simplexml: 5.6.17
        php56-sqlite3: 5.6.17
        php56-xml: 5.6.17
        php56-xmlrpc: 5.6.17
        php56-xmlwriter: 5.6.17
        php56-gettext: 5.6.17
        php56-mcrypt: 5.6.17
        php56-zip: 5.6.17
        php56-zlib: 5.6.17
        php56-posix: 5.6.17
        mp3info: 0.8.5
        mysql56-server: 5.6.27
        pecl-APCu: 4.0.10
        pcre: 8.37_4
        php56: 5.6.17
        libxml2: 2.9.3
        curl: 7.46.0_1
        ca_root_nss: 3.20.1
        libXpm: 3.5.11_4
        xproto: 7.0.28
        libXt: 1.1.5,1
        libSM: 1.2.2_3,1
        libICE: 1.0.9_1,1
        libX11: 1.6.3,1
        libXdmcp: 1.1.2
        libxcb: 1.11.1
        libpthread-stubs: 0.3_6
        libXau: 1.0.8_3
        kbproto: 1.0.7
        libXext: 1.3.3_1,1
        xextproto: 7.3.0
        gettext-runtime: 0.19.6
        indexinfo: 0.2.4
        png: 1.6.20
        t1lib: 5.1.2_4,1
        libXaw: 1.0.13,2
        printproto: 1.0.5
        libXmu: 1.1.2_3,1
        libXp: 1.0.3,1
        freetype2: 2.6.2
        jpeg-turbo: 1.4.2
        libiconv: 1.14_9
        oniguruma5: 5.9.6_1
        sqlite3: 3.9.2
        libltdl: 2.4.6
        libmcrypt: 2.5.8_3
        libzip: 1.0.1
        mysql56-client: 5.6.27
        libedit: 3.1.20150325_1
        perl5: 5.20.3_8

The process will require 252 MiB more space.
38 MiB to be downloaded.
[owncloud.local] Fetching lighttpd-1.4.38.txz: 100%  226 KiB  46.4kB/s    00:05
[owncloud.local] Fetching php56-openssl-5.6.17.txz:  69%   30 KiB  30.7kB/s    00:00 
[owncloud.local] Fetching php56-openssl-5.6.17.txz: 100%   43 KiB  44.2kB/s    00:01
[owncloud.local] Fetching php56-ctype-5.6.17.txz: 100%    6 KiB   6.5kB/s    00:01 
[owncloud.local] Fetching php56-curl-5.6.17.txz: 100%   26 KiB  27.0kB/s    00:01  
[owncloud.local] Fetching php56-dom-5.6.17.txz: 100%   54 KiB  55.2kB/s    00:01
[owncloud.local] Fetching php56-fileinfo-5.6.17.txz:  26%   50 KiB  51.2kB/s    00:04
[owncloud.local] Fetching php56-fileinfo-5.6.17.txz:  68%  130 KiB  81.9kB/s    00:03
[owncloud.local] Fetching php56-fileinfo-5.6.17.txz: 100%  191 KiB  97.9kB/s    00:02
[owncloud.local] Fetching php56-filter-5.6.17.txz: 100%   19 KiB  19.6kB/s    00:01
[owncloud.local] Fetching php56-gd-5.6.17.txz: 100%  132 KiB 135.5kB/s    00:01
[owncloud.local] Fetching php56-hash-5.6.17.txz:  26%   30 KiB  30.7kB/s    00:02 ET
[owncloud.local] Fetching php56-hash-5.6.17.txz:  95%  110 KiB  81.9kB/s    00:00 ET
[owncloud.local] Fetching php56-hash-5.6.17.txz: 100%  115 KiB  58.9kB/s    00:02  
[owncloud.local] Fetching php56-iconv-5.6.17.txz: 100%   18 KiB  18.2kB/s    00:01  
[owncloud.local] Fetching php56-json-5.6.17.txz: 100%   16 KiB  16.5kB/s    00:01  
[owncloud.local] Fetching php56-mbstring-5.6.17_1.txz:   9%   70 KiB  71.7kB/s    00
[owncloud.local] Fetching php56-mbstring-5.6.17_1.txz:  19%  140 KiB  71.7kB/s    00
[owncloud.local] Fetching php56-mbstring-5.6.17_1.txz:  33%  240 KiB 102.4kB/s    00
[owncloud.local] Fetching php56-mbstring-5.6.17_1.txz:  49%  350 KiB 112.6kB/s    00
[owncloud.local] Fetching php56-mbstring-5.6.17_1.txz:  69%  490 KiB 143.4kB/s    00
[owncloud.local] Fetching php56-mbstring-5.6.17_1.txz:  90%  640 KiB 153.6kB/s    00
[owncloud.local] Fetching php56-mbstring-5.6.17_1.txz: 100%  707 KiB 120.7kB/s    00:06
[owncloud.local] Fetching php56-mysql-5.6.17.txz: 100%   17 KiB  17.5kB/s    00:01  
[owncloud.local] Fetching php56-pdo-5.6.17.txz: 100%   43 KiB  44.2kB/s    00:01
[owncloud.local] Fetching php56-pdo_mysql-5.6.17.txz: 100%   16 KiB  16.2kB/s    00:01
[owncloud.local] Fetching php56-pdo_sqlite-5.6.17.txz: 100%   12 KiB  12.3kB/s    00:01
[owncloud.local] Fetching php56-session-5.6.17.txz: 100%   30 KiB  30.5kB/s    00:01
[owncloud.local] Fetching php56-simplexml-5.6.17.txz: 100%   22 KiB  22.5kB/s    00:01
[owncloud.local] Fetching php56-sqlite3-5.6.17.txz: 100%   17 KiB  17.4kB/s    00:01
[owncloud.local] Fetching php56-xml-5.6.17.txz: 100%   19 KiB  19.7kB/s    00:01
[owncloud.local] Fetching php56-xmlrpc-5.6.17.txz:  69%   30 KiB  30.7kB/s    00:00
[owncloud.local] Fetching php56-xmlrpc-5.6.17.txz: 100%   43 KiB  44.3kB/s    00:01
[owncloud.local] Fetching php56-xmlwriter-5.6.17.txz: 100%   12 KiB  12.3kB/s    00:01
[owncloud.local] Fetching php56-gettext-5.6.17.txz: 100%    7 KiB   6.7kB/s    00:01
[owncloud.local] Fetching php56-mcrypt-5.6.17.txz: 100%   15 KiB  15.2kB/s    00:01
[owncloud.local] Fetching php56-zip-5.6.17.txz: 100%   19 KiB  19.8kB/s    00:01
[owncloud.local] Fetching php56-zlib-5.6.17.txz:  70%   10 KiB  10.2kB/s    00:00 ETA
[owncloud.local] Fetching php56-zlib-5.6.17.txz: 100%   14 KiB   7.2kB/s    00:02
[owncloud.local] Fetching php56-posix-5.6.17.txz: 100%   11 KiB  10.9kB/s    00:01  
[owncloud.local] Fetching mp3info-0.8.5.txz: 100%   34 KiB  34.7kB/s    00:01
[owncloud.local] Fetching mysql56-server-5.6.27.txz:   0%   70 KiB  71.7kB/s    01:5
[owncloud.local] Fetching mysql56-server-5.6.27.txz:   1%  150 KiB  81.9kB/s    01:4
[owncloud.local] Fetching mysql56-server-5.6.27.txz:   3%  250 KiB 102.4kB/s    01:2
[owncloud.local] Fetching mysql56-server-5.6.27.txz:   4%  350 KiB 102.4kB/s    01:2
[owncloud.local] Fetching mysql56-server-5.6.27.txz:   5%  470 KiB 122.9kB/s    01:2
[owncloud.local] Fetching mysql56-server-5.6.27.txz:   6%  570 KiB 102.4kB/s    01:2
[owncloud.local] Fetching mysql56-server-5.6.27.txz:   8%  670 KiB 102.4kB/s    01:1
[owncloud.local] Fetching mysql56-server-5.6.27.txz:   9%  790 KiB 122.9kB/s    01:1
[owncloud.local] Fetching mysql56-server-5.6.27.txz:  11%  930 KiB 143.4kB/s    01:1
[owncloud.local] Fetching mysql56-server-5.6.27.txz:  12%    1 MiB 133.1kB/s    01:0
[owncloud.local] Fetching mysql56-server-5.6.27.txz:  14%    1 MiB 184.3kB/s    01:0
[owncloud.local] Fetching mysql56-server-5.6.27.txz:  17%    1 MiB 194.6kB/s    00:5
[owncloud.local] Fetching mysql56-server-5.6.27.txz:  18%    2 MiB 112.6kB/s    00:5
[owncloud.local] Fetching mysql56-server-5.6.27.txz:  20%    2 MiB 133.1kB/s    00:5
[owncloud.local] Fetching mysql56-server-5.6.27.txz:  21%    2 MiB 153.6kB/s    00:5
[owncloud.local] Fetching mysql56-server-5.6.27.txz:  23%    2 MiB 153.6kB/s    00:5
[owncloud.local] Fetching mysql56-server-5.6.27.txz:  25%    2 MiB 184.3kB/s    00:4
[owncloud.local] Fetching mysql56-server-5.6.27.txz:  28%    2 MiB 184.3kB/s    00:4
[owncloud.local] Fetching mysql56-server-5.6.27.txz:  29%    2 MiB 122.9kB/s    00:4
[owncloud.local] Fetching mysql56-server-5.6.27.txz:  31%    3 MiB 143.4kB/s    00:4
[owncloud.local] Fetching mysql56-server-5.6.27.txz:  33%    3 MiB 153.6kB/s    00:4
[owncloud.local] Fetching mysql56-server-5.6.27.txz:  34%    3 MiB 163.8kB/s    00:3
[owncloud.local] Fetching mysql56-server-5.6.27.txz:  37%    3 MiB 215.0kB/s    00:3
[owncloud.local] Fetching mysql56-server-5.6.27.txz:  40%    3 MiB 225.3kB/s    00:3
[owncloud.local] Fetching mysql56-server-5.6.27.txz:  42%    3 MiB 215.0kB/s    00:2
[owncloud.local] Fetching mysql56-server-5.6.27.txz:  45%    4 MiB 276.5kB/s    00:2
[owncloud.local] Fetching mysql56-server-5.6.27.txz:  49%    4 MiB 286.7kB/s    00:2
[owncloud.local] Fetching mysql56-server-5.6.27.txz:  52%    4 MiB 307.2kB/s    00:2
[owncloud.local] Fetching mysql56-server-5.6.27.txz:  56%    5 MiB 297.0kB/s    00:1
[owncloud.local] Fetching mysql56-server-5.6.27.txz: 100%    8 MiB 154.3kB/s    00:55
[owncloud.local] Fetching pecl-APCu-4.0.10.txz: 100%   56 KiB  57.5kB/s    00:01
[owncloud.local] Fetching pcre-8.37_4.txz: 100%    1 MiB 126.9kB/s    00:09
[owncloud.local] Fetching php56-5.6.17.txz: 100%    2 MiB 134.1kB/s    00:15
[owncloud.local] Fetching libxml2-2.9.3.txz: 100%  789 KiB 134.6kB/s    00:06
[owncloud.local] Fetching curl-7.46.0_1.txz: 100%    1 MiB 123.4kB/s    00:12
[owncloud.local] Fetching ca_root_nss-3.20.1.txz: 100%  334 KiB  85.5kB/s    00:04
[owncloud.local] Fetching libXpm-3.5.11_4.txz: 100%   68 KiB  35.0kB/s    00:02
[owncloud.local] Fetching xproto-7.0.28.txz: 100%   58 KiB  59.7kB/s    00:01
[owncloud.local] Fetching libXt-1.1.5,1.txz: 100%  450 KiB  92.1kB/s    00:05
[owncloud.local] Fetching libSM-1.2.2_3,1.txz: 100%   22 KiB  22.8kB/s    00:01
[owncloud.local] Fetching libICE-1.0.9_1,1.txz: 100%   90 KiB  92.4kB/s    00:01
[owncloud.local] Fetching libX11-1.6.3,1.txz: 100%    2 MiB 140.5kB/s    00:12
[owncloud.local] Fetching libXdmcp-1.1.2.txz: 100%   14 KiB  14.1kB/s    00:01
[owncloud.local] Fetching libxcb-1.11.1.txz: 100%  971 KiB 142.0kB/s    00:07
[owncloud.local] Fetching libpthread-stubs-0.3_6.txz: 100%    3 KiB   2.9kB/s    00:01
[owncloud.local] Fetching libXau-1.0.8_3.txz: 100%   11 KiB  11.3kB/s    00:01
[owncloud.local] Fetching kbproto-1.0.7.txz: 100%  122 KiB  62.6kB/s    00:02
[owncloud.local] Fetching libXext-1.3.3_1,1.txz: 100%   91 KiB  92.7kB/s    00:01
[owncloud.local] Fetching xextproto-7.3.0.txz: 100%   21 KiB  21.9kB/s    00:01
[owncloud.local] Fetching gettext-runtime-0.19.6.txz: 100%  147 KiB 150.6kB/s    00:01
[owncloud.local] Fetching indexinfo-0.2.4.txz: 100%    5 KiB   5.0kB/s    00:01
[owncloud.local] Fetching png-1.6.20.txz: 100%  266 KiB  90.9kB/s    00:03
[owncloud.local] Fetching t1lib-5.1.2_4,1.txz: 100%  745 KiB  95.4kB/s    00:08
[owncloud.local] Fetching libXaw-1.0.13,2.txz: 100%  448 KiB  91.7kB/s    00:05
[owncloud.local] Fetching printproto-1.0.5.txz: 100%   14 KiB  14.2kB/s    00:01
[owncloud.local] Fetching libXmu-1.1.2_3,1.txz: 100%   95 KiB  97.0kB/s    00:01
[owncloud.local] Fetching libXp-1.0.3,1.txz: 100%   83 KiB  84.9kB/s    00:01
[owncloud.local] Fetching freetype2-2.6.2.txz: 100%  476 KiB  81.3kB/s    00:06
[owncloud.local] Fetching jpeg-turbo-1.4.2.txz: 100%  270 KiB  92.1kB/s    00:03
[owncloud.local] Fetching libiconv-1.14_9.txz: 100%  592 KiB  86.6kB/s    00:07
[owncloud.local] Fetching oniguruma5-5.9.6_1.txz: 100%  161 KiB  82.6kB/s    00:02
[owncloud.local] Fetching sqlite3-3.9.2.txz: 100%  598 KiB 122.4kB/s    00:05
[owncloud.local] Fetching libltdl-2.4.6.txz: 100%   36 KiB  36.5kB/s    00:01
[owncloud.local] Fetching libmcrypt-2.5.8_3.txz: 100%  108 KiB  55.5kB/s    00:02
[owncloud.local] Fetching libzip-1.0.1.txz: 100%  185 KiB  94.8kB/s    00:02
[owncloud.local] Fetching mysql56-client-5.6.27.txz: 100%    2 MiB 138.5kB/s    00:15
[owncloud.local] Fetching libedit-3.1.20150325_1.txz: 100%  121 KiB  30.9kB/s    00:04
[owncloud.local] Fetching perl5-5.20.3_8.txz: 100%   13 MiB 170.0kB/s    01:21
Checking integrity... done (0 conflicting)
[owncloud.local] [1/67] Installing xproto-7.0.28...
[owncloud.local] [1/67] Extracting xproto-7.0.28: 100%
[owncloud.local] [2/67] Installing libxml2-2.9.3...
[owncloud.local] [2/67] Extracting libxml2-2.9.3: 100%
[owncloud.local] [3/67] Installing libXdmcp-1.1.2...
[owncloud.local] [3/67] Extracting libXdmcp-1.1.2: 100%
[owncloud.local] [4/67] Installing libpthread-stubs-0.3_6...
[owncloud.local] [4/67] Extracting libpthread-stubs-0.3_6: 100%
[owncloud.local] [5/67] Installing libXau-1.0.8_3...
[owncloud.local] [5/67] Extracting libXau-1.0.8_3: 100%
[owncloud.local] [6/67] Installing libICE-1.0.9_1,1...
[owncloud.local] [6/67] Extracting libICE-1.0.9_1,1: 100%
[owncloud.local] [7/67] Installing libxcb-1.11.1...
[owncloud.local] [7/67] Extracting libxcb-1.11.1: 100%
[owncloud.local] [8/67] Installing kbproto-1.0.7...
[owncloud.local] [8/67] Extracting kbproto-1.0.7: 100%
[owncloud.local] [9/67] Installing libSM-1.2.2_3,1...
[owncloud.local] [9/67] Extracting libSM-1.2.2_3,1: 100%
[owncloud.local] [10/67] Installing libX11-1.6.3,1...
[owncloud.local] [10/67] Extracting libX11-1.6.3,1: 100%
[owncloud.local] [11/67] Installing xextproto-7.3.0...
[owncloud.local] [11/67] Extracting xextproto-7.3.0: 100%
[owncloud.local] [12/67] Installing indexinfo-0.2.4...
[owncloud.local] [12/67] Extracting indexinfo-0.2.4: 100%
[owncloud.local] [13/67] Installing libXt-1.1.5,1...
[owncloud.local] [13/67] Extracting libXt-1.1.5,1: 100%
[owncloud.local] [14/67] Installing libXext-1.3.3_1,1...
[owncloud.local] [14/67] Extracting libXext-1.3.3_1,1: 100%
[owncloud.local] [15/67] Installing gettext-runtime-0.19.6...
[owncloud.local] [15/67] Extracting gettext-runtime-0.19.6: 100%
[owncloud.local] [16/67] Installing printproto-1.0.5...
[owncloud.local] [16/67] Extracting printproto-1.0.5: 100%
[owncloud.local] [17/67] Installing pcre-8.37_4...
[owncloud.local] [17/67] Extracting pcre-8.37_4: 100%
[owncloud.local] [18/67] Installing libXpm-3.5.11_4...
[owncloud.local] [18/67] Extracting libXpm-3.5.11_4: 100%
[owncloud.local] [19/67] Installing libXmu-1.1.2_3,1...
[owncloud.local] [19/67] Extracting libXmu-1.1.2_3,1: 100%
[owncloud.local] [20/67] Installing libXp-1.0.3,1...
[owncloud.local] [20/67] Extracting libXp-1.0.3,1: 100%
[owncloud.local] [21/67] Installing php56-5.6.17...
[owncloud.local] [21/67] Extracting php56-5.6.17: 100%
[owncloud.local] [22/67] Installing ca_root_nss-3.20.1...
[owncloud.local] [22/67] Extracting ca_root_nss-3.20.1: 100%
[owncloud.local] [23/67] Installing libXaw-1.0.13,2...
[owncloud.local] [23/67] Extracting libXaw-1.0.13,2: 100%
[owncloud.local] [24/67] Installing libedit-3.1.20150325_1...
[owncloud.local] [24/67] Extracting libedit-3.1.20150325_1: 100%
[owncloud.local] [25/67] Installing php56-mysql-5.6.17...
[owncloud.local] [25/67] Extracting php56-mysql-5.6.17: 100%
[owncloud.local] [26/67] Installing php56-pdo-5.6.17...
[owncloud.local] [26/67] Extracting php56-pdo-5.6.17: 100%
[owncloud.local] [27/67] Installing php56-xml-5.6.17...
[owncloud.local] [27/67] Extracting php56-xml-5.6.17: 100%
[owncloud.local] [28/67] Installing curl-7.46.0_1...
[owncloud.local] [28/67] Extracting curl-7.46.0_1: 100%
[owncloud.local] [29/67] Installing png-1.6.20...
[owncloud.local] [29/67] Extracting png-1.6.20: 100%
[owncloud.local] [30/67] Installing t1lib-5.1.2_4,1...
[owncloud.local] [30/67] Extracting t1lib-5.1.2_4,1: 100%
[owncloud.local] [31/67] Installing freetype2-2.6.2...
[owncloud.local] [31/67] Extracting freetype2-2.6.2: 100%
[owncloud.local] [32/67] Installing jpeg-turbo-1.4.2...
[owncloud.local] [32/67] Extracting jpeg-turbo-1.4.2: 100%
[owncloud.local] [33/67] Installing libiconv-1.14_9...
[owncloud.local] [33/67] Extracting libiconv-1.14_9: 100%
[owncloud.local] [34/67] Installing oniguruma5-5.9.6_1...
[owncloud.local] [34/67] Extracting oniguruma5-5.9.6_1: 100%
[owncloud.local] [35/67] Installing sqlite3-3.9.2...
[owncloud.local] [35/67] Extracting sqlite3-3.9.2: 100%
[owncloud.local] [36/67] Installing libltdl-2.4.6...
[owncloud.local] [36/67] Extracting libltdl-2.4.6: 100%
[owncloud.local] [37/67] Installing libmcrypt-2.5.8_3...
[owncloud.local] [37/67] Extracting libmcrypt-2.5.8_3: 100%
[owncloud.local] [38/67] Installing libzip-1.0.1...
[owncloud.local] [38/67] Extracting libzip-1.0.1: 100%
[owncloud.local] [39/67] Installing mysql56-client-5.6.27...
[owncloud.local] [39/67] Extracting mysql56-client-5.6.27: 100%
[owncloud.local] [40/67] Installing perl5-5.20.3_8...
[owncloud.local] [40/67] Extracting perl5-5.20.3_8: 100%
[owncloud.local] [41/67] Installing lighttpd-1.4.38...
[owncloud.local] [41/67] Extracting lighttpd-1.4.38: 100%
[owncloud.local] [42/67] Installing php56-openssl-5.6.17...
[owncloud.local] [42/67] Extracting php56-openssl-5.6.17: 100%
[owncloud.local] [43/67] Installing php56-ctype-5.6.17...
[owncloud.local] [43/67] Extracting php56-ctype-5.6.17: 100%
[owncloud.local] [44/67] Installing php56-curl-5.6.17...
[owncloud.local] [44/67] Extracting php56-curl-5.6.17: 100%
[owncloud.local] [45/67] Installing php56-dom-5.6.17...
[owncloud.local] [45/67] Extracting php56-dom-5.6.17: 100%
[owncloud.local] [46/67] Installing php56-fileinfo-5.6.17...
[owncloud.local] [46/67] Extracting php56-fileinfo-5.6.17: 100%
[owncloud.local] [47/67] Installing php56-filter-5.6.17...
[owncloud.local] [47/67] Extracting php56-filter-5.6.17: 100%
[owncloud.local] [48/67] Installing php56-gd-5.6.17...
[owncloud.local] [48/67] Extracting php56-gd-5.6.17: 100%
[owncloud.local] [49/67] Installing php56-hash-5.6.17...
[owncloud.local] [49/67] Extracting php56-hash-5.6.17: 100%
[owncloud.local] [50/67] Installing php56-iconv-5.6.17...
[owncloud.local] [50/67] Extracting php56-iconv-5.6.17: 100%
[owncloud.local] [51/67] Installing php56-json-5.6.17...
[owncloud.local] [51/67] Extracting php56-json-5.6.17: 100%
[owncloud.local] [52/67] Installing php56-mbstring-5.6.17_1...
[owncloud.local] [52/67] Extracting php56-mbstring-5.6.17_1: 100%
[owncloud.local] [53/67] Installing php56-pdo_mysql-5.6.17...
[owncloud.local] [53/67] Extracting php56-pdo_mysql-5.6.17: 100%
[owncloud.local] [54/67] Installing php56-pdo_sqlite-5.6.17...
[owncloud.local] [54/67] Extracting php56-pdo_sqlite-5.6.17: 100%
[owncloud.local] [55/67] Installing php56-session-5.6.17...
[owncloud.local] [55/67] Extracting php56-session-5.6.17: 100%
[owncloud.local] [56/67] Installing php56-simplexml-5.6.17...
[owncloud.local] [56/67] Extracting php56-simplexml-5.6.17: 100%
[owncloud.local] [57/67] Installing php56-sqlite3-5.6.17...
[owncloud.local] [57/67] Extracting php56-sqlite3-5.6.17: 100%
[owncloud.local] [58/67] Installing php56-xmlrpc-5.6.17...
[owncloud.local] [58/67] Extracting php56-xmlrpc-5.6.17: 100%
[owncloud.local] [59/67] Installing php56-xmlwriter-5.6.17...
[owncloud.local] [59/67] Extracting php56-xmlwriter-5.6.17: 100%
[owncloud.local] [60/67] Installing php56-gettext-5.6.17...
[owncloud.local] [60/67] Extracting php56-gettext-5.6.17: 100%
[owncloud.local] [61/67] Installing php56-mcrypt-5.6.17...
[owncloud.local] [61/67] Extracting php56-mcrypt-5.6.17: 100%
[owncloud.local] [62/67] Installing php56-zip-5.6.17...
[owncloud.local] [62/67] Extracting php56-zip-5.6.17: 100%
[owncloud.local] [63/67] Installing php56-zlib-5.6.17...
[owncloud.local] [63/67] Extracting php56-zlib-5.6.17: 100%
[owncloud.local] [64/67] Installing php56-posix-5.6.17...
[owncloud.local] [64/67] Extracting php56-posix-5.6.17: 100%
[owncloud.local] [65/67] Installing mp3info-0.8.5...
[owncloud.local] [65/67] Extracting mp3info-0.8.5: 100%
[owncloud.local] [66/67] Installing mysql56-server-5.6.27...
===> Creating users and/or groups.
Creating group 'mysql' with gid '88'.
Creating user 'mysql' with uid '88'.
[owncloud.local] [66/67] Extracting mysql56-server-5.6.27: 100%
[owncloud.local] [67/67] Installing pecl-APCu-4.0.10...
[owncloud.local] [67/67] Extracting pecl-APCu-4.0.10: 100%
Message from ca_root_nss-3.20.1:
********************************* WARNING *********************************

FreeBSD does not, and can not warrant that the certification authorities
whose certificates are included in this package have in any way been
audited for trustworthiness or RFC 3647 compliance.

Assessment and verification of trust is the complete responsibility of the
system administrator.

*********************************** NOTE **********************************

This package installs symlinks to support root certificates discovery by
default for software that uses OpenSSL.

This enables SSL Certificate Verification by client software without manual
intervention.

If you prefer to do this manually, replace the following symlinks with
either an empty file or your site-local certificate bundle.

  * /etc/ssl/cert.pem
  * /usr/local/etc/ssl/cert.pem
  * /usr/local/openssl/cert.pem

***************************************************************************
Message from mysql56-client-5.6.27:
* * * * * * * * * * * * * * * * * * * * * * * *

Please be aware the database client is vulnerable
to CVE-2015-3152 - SSL Downgrade aka "BACKRONYM".
You may find more information at the following URL:

http://www.vuxml.org/freebsd/36bd352d-299b-11e5-86ff-14dae9d210b8.html

Although this database client is not listed as
"affected", it is vulnerable and will not be
receiving a patch. Please take note of this when
deploying this software.

* * * * * * * * * * * * * * * * * * * * * * * *
Message from perl5-5.20.3_8:
The /usr/bin/perl symlink has been removed starting with Perl 5.20.
For shebangs, you should either use:

#!/usr/local/bin/perl

or

#!/usr/bin/env perl

The first one will only work if you have a /usr/local/bin/perl,
the second will work as long as perl is in PATH.
Message from mysql56-server-5.6.27:
************************************************************************

Remember to run mysql_upgrade the first time you start the MySQL server
after an upgrade from an earlier version.

************************************************************************

##################################################
Packages installed - now configuring mySQL
##################################################

Starting mysql.

##################################################
Getting ready to secure the install. The root password is blank,
and you want to provide a strong root password, remove the anonymous accounts
disallow remote root access, remove the test database, and reload privilege tables
##################################################




NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MySQL to secure it, we'll need the current
password for the root user.  If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.

Set root password? [Y/n]
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
 ... Success!


By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n]
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n]
 ... Success!

By default, MySQL comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n]
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n]
 ... Success!




All done!  If you've completed all of the above steps, your MySQL
installation should now be secure.

Thanks for using MySQL!


Cleaning up...

##################################################
Done hardening mySQL - performing key operations
##################################################

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]:
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=AU/ST=Some-State/O=Internet Widgits Pty Ltd
Getting Private key

##################################################
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   20 MBps 00m00s

##################################################
Packages installed - creating www folder
##################################################


##################################################
www folder created - now downloading owncloud
##################################################

owncloud-8.2.2.tar.bz2       100% of   27 MB  181 kBps 02m35s

##################################################
Adding lighttpd to rc.conf
##################################################


##################################################
  Done, lighttpd should start up automatically!
##################################################


##################################################
Attempting to start webserver.
If it fails and says Cannot 'start' lighttpd, manually add
    lighttpd_enable=YES to /etc/rc.conf
Command being run here is:
    /usr/local/etc/rc.d/lighttpd start
##################################################

Starting lighttpd.

##################################################
It looks like we finished here!!! NICE
Now head to https://192.168.1.200:81 (as defined at the start of the script)
 via your browser and complete your OwnCloud setup!

To get Memory Caching to work you'll have to enable this manually.
Head to this file /usr/local/www/owncloud/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

Thanks to fsbruva for creating the original script
Modifications made by Nostalgist92
##################################################
root@owncloud:/ #
_________________________________________________________________________________________________________________________


Finishing Up:

Your owncloud can be accessed via a web browser using the following address:
https://192.168.1.200:81 obviously changing the ip above to reflect your jail IP.
Heading to this address you should be greeted with an OwnCloud page
Here you create the new user account and password to complete the installation.
Click on "Advanced", and click on "MySQL".
Type in root for the username, whatever root password you set during the database setup,
Pick a name for a database (doesn't matter), and leave the localhost part.
Click Finish Setup, and ENJOY!!!.

_________________________________________________________________________________________________________________________


If you didn't pay attention to the installation note above, owncloud will not work and will be inaccessible. You will have to modify lighttpd.conf which is located in '/usr/local/etc/lighttpd'. Find the line with "192.168.1.200" and modify it to reflect your jails IP.

If it's done right you should be able to run the following command and find that lighttpd starts and in turn, OwnCloud will be accessible.

Code: Select all

/usr/local/etc/rc.d/lighttpd start
You "shouldn't" get any errors about write access during the OwnCloud setup but if you do for some reason you can remedy this using the following command in your jails shell:

Code: Select all

chown -R www:www /usr/local/www/owncloud
While I do like to consider myself fairly knowledgeable, I am by no means an expert when it comes to this stuff but if you have any questions or problems feel free to post a reply and I, or someone else, will help wherever possible.
That should be it! Happy uhh, Ownclouding? :D

_________________________________________________________________________________________________________________________

Fixes for various problems if you encounter them:

Lighttpd startup error due to SSL:

Code: Select all

Starting lighttpd.
(network.c.542) SSL: couldn't read X509 certificate from '/root/server.pem'
/usr/local/etc/rc.d/lighttpd: WARNING: failed to start lighttpd
Ondalf wrote:Same happened me tonight as well. I have a great hunch, that is caused by not-enough-permissions-or-other-similar-stuff by jail manager. So, add "Enable mount devfs" (I assume urandom or similar is required for certificate creation, as openssl tended to crash by running the command myself from CLI). It was unable to ask for the password and that's why whole certificate -creation process in the install script will fail. Heh, seems I gave it "allow.chflags" as well, and now read, what it does from jail man page. After setting those things said, rebooted server, it surprised me and begun to work.

TL;DR OpenSSL bugs. More permissions, kthxbai.
See this post - http://forums.nas4free.org/viewtopic.ph ... 150#p61620

MySQL failing to startup because mysql user/group is lost:
http://forums.nas4free.org/viewtopic.ph ... 125#p57989
_________________________________________________________________________________________________________________________

Updating Using PuTTY:

NOTE: Always, ALWAYS try the built-in updater first. There's no reason it shouldn't work. This script is more of a "last resort" sort of thing.

1. Log in to your jail (substitute "1" with your own owncloud jails id or name):

Code: Select all

jexec 1 csh
2. Get the script:

Code: Select all

fetch -o /tmp/owncloud_update.sh https://vengefulsyndicate.com/download/12351/
If the above link fails, here are alternatives: (The above link is preferred as it will most likely be the only one that gets updating if needed)

Code: Select all

fetch --no-verify-peer -o /tmp/owncloud_update.sh "https://raw.githubusercontent.com/Nostalgist92/misc-code/master/NAS4Free/OwnCloud/owncloudupdate.sh"
3. Make it executable

Code: Select all

chmod a+x /tmp/owncloud_update.sh
4. Run it

Code: Select all

/tmp/owncloud_update.sh
And you should be done.
owncloud_update.sh
_________________________________________________________________________________________________________________________
You do not have the required permissions to view the files attached to this post.



User avatar

Topic author
Nozza
Admin / Guild Leader
Posts: 68
Joined: January 13th, 2014, 1:18 pm
Location: Brisbane (QLD), Australia
Contact:
Status: Offline

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

#2

Post by Nozza » February 28th, 2016, 12:42 pm

1 - Stop the jail and create Folder in Jail Image 2 - Add link in fstab Image 3 - Start the jail and add mount to owncloud Image 4 - Permission problem so add www to group Image 5 - Added www to the mediawrite group Image 6 - After jail restart permissions are fixed Image

Post Reply