[How-To] ownCloud using NGINX, PHP-FPM, and MySQL

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
How do I change it back to www and why would this happen?
Code:
chown -R www:www /mnt/files

you can check if that UID corresponds to a user in your FreeNAS, since it shows a number in the jail it doesn't correspond to a jail user.
I'm guessing you or someone changed the owner on the FreeNAS Storage tab.

you may want to double check your db dataset didnt get changed from it's user 'mysql' (UID 88).
ls -l /var/mysql
 

tamilmad

Dabbler
Joined
Oct 20, 2015
Messages
36
Hi.
I followed this tutorial last year and set up ssl using this method by cyberJock. I have been enjoying excellent performance since then. I have to manually install upgrades as the ownCloud WebGUI upgrade tool doesn't seem to work for me, but that's OK.

First of all... Thank you to Josh and all the other contributors to this thread and this forum. It has been awesome to have my family's data synced with all our devices and computers, and stored centrally in a device under my control.

Ok, that said, the reason I'm writing this post is to ask if anyone knows how to obtain and install a Let'sEncrypt certificate now that the public beta is open to obtain free certificates. I've tried multiple times, but sadly unsuccessfully. Now I'm to the point where I think I might break my ownCloud Jail if I keep trying different variations of the Let'sEncrypt tutorial instructions.

If anyone has done this successfully, please share!

Thanks,

Sean
I have been using owncloud using the tutorial of Joshua without ssl. Now I wanted to have ssl. So I tried to follow the patch of cyberJock. But I am getting a error at the make /usr/ports/www/nginx install .

Please help.
upload_2015-12-14_17-29-53.png
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I have been using owncloud using the tutorial of Joshua without ssl. Now I wanted to have ssl. So I tried to follow the patch of cyberJock. But I am getting a error at the make /usr/ports/www/nginx install .

Please help.
View attachment 9571
something's wrong with that command you're running. either 'cd' to the directory and run "make install". or that path needs to be passed as a parameter to the -C flag
 

dedeaux

Dabbler
Joined
Jun 16, 2015
Messages
34
My setup is running well and I am quite happy with the performance.

I only intend to use owncloud locally as I don't yet need to access anything while away. That said, would there be a valid reason to enable SSL at this point?

Finally, if I were to explore making this available outside my local network, where do I start? I am totally ignorant of how this would work. I use ADSL to connect to the Internet and I am guessing I don't have a static ip.

Sent from my SM-T800 using Tapatalk
 

ArgaWoW

Patron
Joined
Jul 4, 2015
Messages
444
My setup is running well and I am quite happy with the performance.

I only intend to use owncloud locally as I don't yet need to access anything while away. That said, would there be a valid reason to enable SSL at this point?

Finally, if I were to explore making this available outside my local network, where do I start? I am totally ignorant of how this would work. I use ADSL to connect to the Internet and I am guessing I don't have a static ip.

Sent from my SM-T800 using Tapatalk
Hi,
first you will need a dyn-dns-adress to reach your server from outside. For installation and configuration i followed the post #58 in this tread. To solve the problem with the untrusted domain i registers my own domain and use a certificate from startssl for free.

I hope this will help you for your first steps to set up ssl
 

tamilmad

Dabbler
Joined
Oct 20, 2015
Messages
36
Th
something's wrong with that command you're running. either 'cd' to the directory and run "make install". or that path needs to be passed as a parameter to the -C flag

Thanks for four help. I manually went to the directory as per your advice and was able to complete make install and the subsequent steps as mentioned in the cyberjocks tutorial to create the certificates etc., Everything went on well without any errors.

But when I access the owncloud using "https://192.168.2.3/owncloud" it comes out with 404 Not found error.

I have already updated the address in the config.php file as trusted domain and I am able to access as "http://192.168.2.3/owncloud" without problems.

I am attaching herewith a txt file containing details of my config.php, nginx.conf and the location of the certificates.

Please suggest where I should look to solve the issue
 

Attachments

  • owncloud-details.txt
    6.8 KB · Views: 477
Last edited:

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Th


Thanks for four help. I manually went to the directory as per your advice and was able to complete make install and the subsequent steps as mentioned in the cyberjocks tutorial to create the certificates etc., Everything went on well without any errors.

But when I access the owncloud using "https://192.168.2.3/owncloud" it comes out with 404 Not found error.

I have already updated the address in the config.php file as trusted domain and I am able to access as "http://192.168.2.3/owncloud" without problems.

I am attaching herewith a txt file containing details of my config.php, nginx.conf and the location of the certificates.

Please suggest where I should look to solve the issue
sorry I don't know much about the SSL part through nginx since I do it a different way. did you restart nginx so it is using the updated config? does 'sockstat' in the jail show nginx listening on port 443?
 

tamilmad

Dabbler
Joined
Oct 20, 2015
Messages
36
sorry I don't know much about the SSL part through nginx since I do it a different way. did you restart nginx so it is using the updated config? does 'sockstat' in the jail show nginx listening on port 443?

Thanks for your reply.

1. Did restart nginx with updated config.. When I access (using https://192.168.2.3/owncloud) it throws up the certificate validation screen also and when I opt for exception it throws up the 404 Not found screen.

2. I guess nginx is listening on 443. I am attaching the file herewith. Please check to confirm.

If you have a different method can you please share the same. Would try the same. I need this badly as I connect my files, outside of my network, from the internet. I have already sorted out that part and even now I am able to access from outside using http://mystatic-ip/owncloud. I want to make it more secure.
 

Attachments

  • sockstat-16dec2015.txt
    1.8 KB · Views: 449
Last edited:

tamilmad

Dabbler
Joined
Oct 20, 2015
Messages
36
Ok, so once the system is up and running without SSL, here's how I added SSL. As a bonus, Owncloud 6.0.2 came out, so I did an upgrade too!


Thanks to Joshua for starting this thread with his guide!

I followed your method. But while connecting to owncloud using https://myip/owncloud, first it shows up the certificate validation screen and once I make the exception, it throws up 404 Not Found screen.

I am attaching herewith txt file with config.php, nginx.conf details and the sockstat also.

Your suggestions / help would be appreciated.
 

Attachments

  • owncloud-https.config-details-16dec2015.txt
    6.8 KB · Views: 364
  • sockstat-16dec2015.txt
    1.8 KB · Views: 386

ArgaWoW

Patron
Joined
Jul 4, 2015
Messages
444
I followed your method. But while connecting to owncloud using https://myip/owncloud, first it shows up the certificate validation screen and once I make the exception, it throws up 404 Not Found screen.

I am attaching herewith txt file with config.php, nginx.conf details and the sockstat also.

Your suggestions / help would be appreciated.

Have you insert the following in your nginx.conf? If so, it should work.

ssl_certificate /usr/local/etc/nginx/server.crt;
ssl_certificate_key /usr/local/etc/nginx/server.key;
listen 443 ssl;
 
Last edited:

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
sorry I can't tell your particular issue unless I dive into this more and don't have the time at the moment. I personally use a SSL certificate (issued for free by StartSSL) for a domain that I own.

so maybe the issues you are hitting are related to using a self-signed certificate?
 

tamilmad

Dabbler
Joined
Oct 20, 2015
Messages
36
sorry I can't tell your particular issue unless I dive into this more and don't have the time at the moment. I personally use a SSL certificate (issued for free by StartSSL) for a domain that I own.

so maybe the issues you are hitting are related to using a self-signed certificate?
Thanks for your help. Sure it seems to be self signed certificate issue. When I access the owncloud with https://my.staticip/owncloud, it shows the certificate exception screen. When I add to the exception, it shows error 451, which I believe is

""
Error 451 is a new error code that we want ISPs to show when people visit websites blocked for legal reasons. Courts can require ISPs to block access to certain websites. Showing the Error 451 message makes it clear when a website has been blocked after a court order.
451 Unavailable | What is Error 451?
www.451unavailable.org/what-is-error-451/ ""

I am trying for a SSL certificate from Start SSL.

Thanks for your assistance.
 

tamilmad

Dabbler
Joined
Oct 20, 2015
Messages
36
Have you insert the following in your nginx.conf? If so, it should work.

ssl_certificate /usr/local/etc/nginx/server.crt;
ssl_certificate_key /usr/local/etc/nginx/server.key;
listen 443 ssl;

Yes Sir. These lines are included. The issue seems to be related to self signed certificate.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Thanks for your help. Sure it seems to be self signed certificate issue. When I access the owncloud with https://my.staticip/owncloud, it shows the certificate exception screen. When I add to the exception, it shows error 451, which I believe is

""
Error 451 is a new error code that we want ISPs to show when people visit websites blocked for legal reasons. Courts can require ISPs to block access to certain websites. Showing the Error 451 message makes it clear when a website has been blocked after a court order.
451 Unavailable | What is Error 451?
www.451unavailable.org/what-is-error-451/ ""

I am trying for a SSL certificate from Start SSL.

Thanks for your assistance.
interesting, never actually seen that error code. I doubt it's something wrong with cyberjock's steps and probably something weird going on when you make your cetificate.
 

dedeaux

Dabbler
Joined
Jun 16, 2015
Messages
34
I do hold to the value of 'If it isn't broken, don't fix it.' That said, I have seen the posts in here about updating owncloud and I think that process is straight forward.

However, I'd like to ask... How often should I consider updating the jail? What caveats would exist with this particular setup? Would it just simply be the pkg update & upgrade route?

Sent from my SM-T800 using Tapatalk
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I do hold to the value of 'If it isn't broken, don't fix it.' That said, I have seen the posts in here about updating owncloud and I think that process is straight forward.

However, I'd like to ask... How often should I consider updating the jail? What caveats would exist with this particular setup? Would it just simply be the pkg update & upgrade route?

Sent from my SM-T800 using Tapatalk
That would update installed dependencies like php/nginx/mysql but I don't know the best way to update the underlying system. Possibly with freebsd-update
 
Top