Install ownCloud in your Jail on Nas4Free

Now that we have a working jail we’ll go through and install ownCloud inside this jail

Click here to see how to create a jail in Nas4free.

Click here for video tutorial of this post.

To do this we’ll need to make use of putty again.

Start by logging into the jail from putty

  • jexec 1 csh
    • (note that the 1 indicates the jail number so if you have more than one jail make a note of this number)

1 Log into jail from putty small

Move to local user directory inside the jail

/usr/local

1c usr local directory small

Download the script to install and configure both MySql and ownCloud

  • fetch https://www.xenopsyche.com/mkempe/oc/owncloud_injail.sh

1d fetch owncloud_install small

Make the file executable

  • chmod a+x owncloud_injail.sh

Before we install owncloud now is a good time to make a few little changes inside the script but before we do that lets install a text editor called nano

  • pkg_add -r nano
  • nano owncloud_injail.sh

1e nano crop

Customise IP and Port to suit your own requirements inside the script before executing particularly the network settings

  • Change owncloud version to “7.0.2” at the top and also the bottom

1f port and ip change

  • Change ligthttpd “start” to “onestart”

1f cloud version and onestart

 

Now run the script

  • ./owncloud_injail.sh (note the period “.” in front of the “/”)

1g owncloud_injail fetching

MySql

 

  • Since we don’t have a password just press enter to continue

1h mysql config

  • Follow all the prompts and press “y”

1i set root password

  • Once you get to the RSA Keys there’s a few things to note
    • Obviously don’t forget your password created here
    • The common name is important especially at the beginning so I always use the IP I set for ownCloud or set here the FQDN you are planning to use

1j yes to all

  • Once you get to the end its time to log into ownCloud for the first time

1m finished

ownCloud

 

Open up your browser and put in the IP you set for ownCloud in the jail with the port number set as follows remembering to use https

  • https://192.168.1.35:81 (make sure to use the IP and port that you chose)
  • There will be an error or warning telling you it’s an unknown site. Ignore these warnings as it’s a self-signed certificate we created before so we know it’s safe to proceed
  • At the first login screen you’ll be prompted for a few very important things
  • Create an admin account – it’s preferable to choose a username other than “admin” but anything will do
  • Create a secure password
  • If you want to move the data folder to another location now is the time to do it as it can be difficult to do it later especially if you have lots of data default location is /usr/local/www/owncloud/data
  • Select MySql Database and it’ll open up and ask for your MySql information that you created earlier

2b owncloud

  • Database user is “root
  • Put in the password you chose earlier
  • Database name can be anything
  • Leave localhost

2c mysql

  • Click log in and it should come up with welcome screen

2d first login

Increasing ownCloud Upload Limit

 

One last thing before you finish by default php sets an upload limit of 2 MB which is obviously way too small to be practical so we’ll go and change that

  • Log into your NAS with putty and enter the jail
  • jexec 1 csh

1 Log into jail from putty small

  • Create a new file using the following command exactly
    • nano /usr/local/www/owncloud/.user.ini (Note the dot user dot ini -> the dot infront of the user is deliberate)
  • Enter these commands exactly and put whatever size file limit you wish
    • Note that if you are using a 32 bit system you will be limited to 2GB no matter what size you put in here

upload_max_filesize = “5G”
post_max_size = “5G”

  • Exit and save the new file

3b create userini crop

Now we need to give it the correct permissions and then restart the webserver for it to stick

  • chown www:www /usr/local/www/owncloud/.user.ini

3d chown userini

Restart the web server

  • /usr/local/etc/rc.d/lighttpd stop
  • /usr/local/etc/rc.d/lighttpd onestart

3c Restart webserver crop

 

Refresh the web browser and now you should be able to upload larger files.

3e New upload limit

 

Sample

 

Video Streaming inside ownCloud

4 video streaming

 

Sample Picture Gallery inside ownCloud

5 photo streaming

 

Congratulations on your very own Personal Cloud Server!

Tags: