In this article we’ll go through installing ownCloud inside a jail.
In this particular example I’m going to use a script to setup our jail known as TheBrig.
Click here for video tutorial of this post.
We’ll need the following before we get started:
- Putty – a windows application that allows us to log into our NAS remotely and run commands
- Enable SSH on our NAS
- Some scripts to install TheBrig from the Nas4Free forums
Putty
Before we can log into our Nas4Free using putty we need to enable ssh.
Services -> SSH
- Back on our Windows Desktop run putty that we just downloaded.
- Put in your Nas4Free IP address in the “Host Name or IP” address then click “Open”
- First time it will pop up with a security alert click yes to continue
SSH (Secure SHell)
- First we’ll navigate to our home directory to download the install scripts instead of installing into the root home path
- cd /mnt/PoolData/cloud
- Fetch the script to install TheBrig into the current location with the following
- fetch -o thebrig_install.sh https://github.com/fsbruva/thebrig/raw/working/thebrig_install.sh
- Make the file executable
- chmod a+x thebrig_install.sh
- Run the script using the following commands replacing your pool and dataset name but also note the trailing number 2. It’s important otherwise it’ll most likely fail
- /bin/sh thebrig_install.sh /mnt/your_pool_name_here/your_dataset_name_here 2
- Installation success
Creating the Jail
Now that we’ve installed the script we need to go back to the NAS4Free GUI and create the jail from there
- Before we can see TheBrig we need to refresh the page then you will see a new tab called “Extensions“
- On first run you’ll see lots of red alerting you that you need to confirm the installation directory so lets go ahead and do that by clicking on the blue writing which says “Rudimentary Config“
- On this page check the installation folder then click “Save” and it will automatically fill in the Advanced section
- Click “Tarball Management” and click “Query”
- Tick “base.txz” and if you have installed your NAS on a 64bit system you’ll also need the “lib32.txz”, select the release the click “Fetch!”
- Click ok then wait a while for it to download the required files if you refresh the page you’ll see the download status
- Once it’s finished downloading Go back to “Current Jails” and click the “+” to create a new jail
- Through trial and error there are a few options here that seem irrelevant but will cause you much headaches so I’ve highlighted each item that I had to use to get the jail to work trouble free for me
- Jail number obviously you have have many jails but leave 1 if its your only one
- Jail name – give it a short but descriptive name
- Choose the Jail Type – click on the help button to read more about the different types – I’ve always used “Full”
- Jail IP – choose an IP address for your jail this will also be the IP for your owncloud and for most change the “32” after the slash to “24”
- Click “enable” for the jail to start on boot
- Click on “Enable automount devfs”
- In “User command 1” put in this text “/bin/sh /usr/local/etc/rc.d/lighttpd onestart“
- This script will force the webserver to autostart on boot for the jail to work properly
- There is a bug in “User command 0” so don’t use it
- Official FreeBSD Flavor – these must be ticked for the jail to get created and easily missed!
- Check that everything has been ticked and then click “Add”
- It will take a few moments then it will take you back to the jail page click “Apply changes”
- Click the green button to activate the jail
Congratulations on your first jail!
Click here to see how to install ownCloud inside your jail.