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)
Move to local user directory inside the jail
/usr/local
Download the script to install and configure both MySql and ownCloud
- fetch https://www.xenopsyche.com/mkempe/oc/owncloud_injail.sh
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
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
- Change ligthttpd “start” to “onestart”
Now run the script
- ./owncloud_injail.sh (note the period “.” in front of the “/”)
MySql
- Since we don’t have a password just press enter to continue
- Follow all the prompts and press “y”
- 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
- Once you get to the end its time to log into ownCloud for the first time
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
- Database user is “root“
- Put in the password you chose earlier
- Database name can be anything
- Leave localhost
- Click log in and it should come up with welcome screen
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
- 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
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
Restart the web server
- /usr/local/etc/rc.d/lighttpd stop
- /usr/local/etc/rc.d/lighttpd onestart
Refresh the web browser and now you should be able to upload larger files.
Sample
Video Streaming inside ownCloud
Sample Picture Gallery inside ownCloud