Installing ownCloud?

Status
Not open for further replies.

Brian Buchanan

Dabbler
Joined
Aug 14, 2013
Messages
17
I've been reading a lot about installing ownCloud on FreeNAS, and I've been trying a lot of different solutions.

It seems that with FreeNAS 9.1.0-Release-x64 that I should use pkg_add to add the relevant packages.

So far I have:
Code:
In Jails, Configuration, set Jail Root to a path
Jails, add Jail; name the new jail "ownCloud"
Start a Shell
jls
jexec {jail#} csh
pkg_add -r nginx
pkg_add -r owncloud


My first attempts were with 'portsnap fetch extract' and that just took forever and seemed to be doing a lot of stuff that had nothing to do with just ownCloud requirements. pkg_add seems simpler.

I want to know if I am on the right track here?

Thanks.

*edit: it appears nginx installed this way is missing ssl support.
 
D

dlavigne

Guest
Well, these are three different things: pkg_add (traditional FreeBSD pkg management--DO NOT use on 9.x!), pkg install (pkgng pkg management), and pbi_add (PC-BSD PBI system). pbi_add is another software method described in the "Installing a PC-BSD PBI" section of the 9.1 Users Guide.

pkg_add can not be used on a pkgng system (like 9.x FreeNAS). It will mess up your pkg database!

FreeNAS uses the PC-BSD pkgng repository. FreeBSD does not provide a pkgng repo and will likely not do so before 10.x. The PC-BSD pkgng repository has its own build servers and was not affected by the FreeBSD breach.
 

Brian Buchanan

Dabbler
Joined
Aug 14, 2013
Messages
17
I am using a FreeNAS jail to install ownCloud, if that makes any difference.

In the jail's /usr/local/etc/pkg.conf I only have this line:
Code:
packagesite: http://pkgbeta.FreeBSD.org/freebsd:9:x86:64/latest


and since that is using freebsd's repository, I thought that pkgng doesn't work.

I will try http://wiki.pcbsd.org/index.php/Convert_a_FreeBSD_System_to_PC-BSD%C2%AE and change the jail's pkg.conf and try pkg again.

Since I've used pkg_add in this jail, has it been damaged and do I have to delete and recreate it? using pkg_add in the jail wouldn't have done anything to the FreeNAS system, would it?
 

Brian Buchanan

Dabbler
Joined
Aug 14, 2013
Messages
17
I present; How to install ownCloud on FreeNAS in 28 27 Steps (Illustrated) by: Me!

Edit: the jail's root password is the FreeNAS root password. I had a step that tried to set the jail's root password.
Edit 2: Apparently the jail's root password is indeed different from the FreeNAS password, so after switching into the jail (jexec {#} csh) type passwd and set a root password. That's the password you will use after ssh'ing to the jail directly and typing "su -"
 

calgarychris

Contributor
Joined
Aug 27, 2011
Messages
124
Brian,

Thank you - your guide is awesome! The illustrated steps make it super easy (and I'm a total noob!). My only comment would be if you can somehow provide a text version to save carefully typing what's in the screen caps, but frankly it works! You're a *ing legend! I've been trying various ways to get this working but this was soooo easy!

Congrats on writing a concise, easy to follow guide - beer's on me!
 

Brian Buchanan

Dabbler
Joined
Aug 14, 2013
Messages
17
Thanks for the Kudos! I posted it mostly to find out if it was right :) as I figured if it was wrong that I'd get shot down pretty quick.

Since I posted the guide I have figured out how to get SSL enabled. Its a dozen more steps. Generating the Private/Public keys and a Certificate Signing Request with openssl, opening an account with a free ssl signer (I used smartssl.com but that site needs it's own guide!), getting the crt signed and downloading the certificate signing chain, enabling mod_ssl in apache and creating a ssl virtual host. I don't have clear instructions in my head, I just searched on enabling ssl in apache (ignoring the FreeNAS aspect of it)
 

calgarychris

Contributor
Joined
Aug 27, 2011
Messages
124
Hmmm, I thought you could use the self-signed SSL certificates?

Also, do you know how to increase the max upload size - I've been searching for php.ini (which other posts reference to make changes to) but cannot seem to find it!
 

calgarychris

Contributor
Joined
Aug 27, 2011
Messages
124
nm, got the max size increased using Solution 2 here
 

Brian Buchanan

Dabbler
Joined
Aug 14, 2013
Messages
17
glad to hear you got that working. Within the Jail you should copy /usr/local/etc/php.ini-production to /usr/local/etc/php.ini and then make the changes.
 

jmasterj

Cadet
Joined
Sep 16, 2013
Messages
5
Hey Brian,

thank you for that nice tutorial! I had a few problems but at last I managed to install owncloud on my freenas.

But I need to set up SSL too and I don´t understand the tutorials I found or they were not especially for my needs.

You wrote:
Since I posted the guide I have figured out how to get SSL enabled. Its a dozen more steps. Generating the Private/Public keys and a Certificate Signing Request with openssl, opening an account with a free ssl signer (I used smartssl.com but that site needs it's own guide!), getting the crt signed and downloading the certificate signing chain, enabling mod_ssl in apache and creating a ssl virtual host. I don't have clear instructions in my head, I just searched on enabling ssl in apache (ignoring the FreeNAS aspect of it)

Please write another tutorial for enabling SSL like you did on setting up freenas & owncloud! I tried to set up SSL from other tutorials but I even don´t know what the code I enter does or where to enter it...

...I NEED YOU :) So please help me out with another of your perfect tutorials!
 

calgarychris

Contributor
Joined
Aug 27, 2011
Messages
124
Hi,

I'm a total noob, however I got this to work

SSL
Create a self-signed certificate (you can change the key size and the number of days of validity):

Code:
cd /usr/local/etc/apache22
openssl genrsa -out server.key 2048
chmod 600 server.key
openssl req -new -key server.key -out server.csr
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt


Then, in /usr/local/etc/apache22/httpd.conf, uncomment the line containing:
Code:
Include conf/extra/httpd-ssl.conf


Restart apache to apply any changes.
Code:
service apache restart


In the admin tab of owncloud I believe you need to check the box saying to use SSL

Good luck!
 

jmasterj

Cadet
Joined
Sep 16, 2013
Messages
5
Thank you for your fast answer calgarychris! I´ll try that tonight.

Where do i enter the code you posted? In the freenas shell? Which user do i need -> root?

Do i have to change to owncloud-path using
Code:
jexec 3 csh
first and the enter the code there?

How can I open the "httpd.conf"? Can´t save the edited file when using windows editor...

Thank you!
 

panz

Guru
Joined
May 24, 2013
Messages
556
Did you apply Diffie-Hellman parameters to the public key? If not, then you should add:

Code:
openssl gendh 2048 >> server.crt
 

jmasterj

Cadet
Joined
Sep 16, 2013
Messages
5
Hello panz,

thanks for your comment, i don´t know if i have the parameters applied... i even don´t know what they are for....I just copied every step in brian´s tut exactly to get owncloud running,...
i will try to enter the code you submitted!

Thanks!
 

calgarychris

Contributor
Joined
Aug 27, 2011
Messages
124
Thank you for your fast answer calgarychris! I´ll try that tonight.

Where do i enter the code you posted? In the freenas shell? Which user do i need -> root?

Do i have to change to owncloud-path using
Code:
jexec 3 csh
first and the enter the code there?

How can I open the "httpd.conf"? Can´t save the edited file when using windows editor...

Thank you!

Hi jmasterj,

Yes, go into the jail via the console (as root) where you have own cloud:

Code:
jls
jexec # /bin/csh


# - whatever jail ID corresponds to the owncloud jail

Go to the directory containing apache22 /usr/local/etc/apache22 and enter the code. Edit httpd.conf using ee or nano or your favourite console editor
 

calgarychris

Contributor
Joined
Aug 27, 2011
Messages
124
Did you apply Diffie-Hellman parameters to the public key? If not, then you should add:

Code:
openssl gendh 2048 >> server.crt

Hi Panz,

Thanks for that - whereabout in the code do I add that - sorry, as I said I'm a noob and certainly a noob when it comes to openssl. I gather (thank wiki!) that Diffie Hellman has something to do with encryption standards or starting seed or something...
 

jmasterj

Cadet
Joined
Sep 16, 2013
Messages
5
Good morning guys! I want to thank you very much for your help! It worked and now I have SSL enabled.

At first I changed to owncloud as calgarychris told me:
Code:
    jls
    jexec # /bin/csh


changed to directory /usr/local/etc/apache22
Code:
cd /usr/local/etc/apache22


then I entered his code - changed days to something about 3600
Code:
    cd /usr/local/etc/apache22
    openssl genrsa -out server.key 2048
    chmod 600 server.key
    openssl req -new -key server.key -out server.csr
    openssl x509 -req -days 3600 -in server.csr -signkey server.key -out server.crt


then panz piece of code
Code:
openssl gendh 2048 >> server.crt


and then uncommenting the line in /usr/local/etc/apache22/httpd.conf:
Code:
Include conf/extra/httpd-ssl.conf


while the code to restart the server didn´t work i changed to this:
Code:
service apache22 onerestart


That did the job! SSL was enabled. I went to router menu and deleted the forwarding of port 80 to owncloud i used before. Made a ne port forwarding from 443 to 443 on owncloud-ip.
Now i can reach owncloud by https://XXXXX.NOIP.COM/owncloud


Thank you very much! :D
 
Status
Not open for further replies.
Top