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

zaggynl

Dabbler
Joined
Jan 22, 2016
Messages
17
I am reproducing the error I get as below after I cloned letsencrypt.
----------------------------------------------------------------------------------------
root@owncloud:/letsencrypt # ./letsencrypt-auto
WARNING: FreeBSD support is very experimental at present...
if you would like to work on improving it, please ensure you have backups
and then run this script again with the --debug flag!
root@owncloud:/letsencrypt # ./letsencrypt-auto --debug
Bootstrapping dependencies via FreeBSD...
./letsencrypt-auto: : Permission denied
-------------------------------------------------------------------------------------------
Am I doing correctly or did you follow a different procedure. Thanks for your efforts.

I used the script like so:
./letsencrypt-auto certonly -d example.com -d example.com
 

statik

Explorer
Joined
Sep 8, 2013
Messages
71
Josh and Cyber, thank you.

I have followed both of your guides and everything seemes to be succesfull except (i have searched through 20 pages of this thread, and dont want to keep searching through the rest hoping to find this same issue), when I try to log in with my credentials it does not take my password, and i know its right. when i swap my nginx.conf with one that is not for SSL it works fine, but with the SSL configured nginx.conf I can not log on, no errors. Any one have any idea with the SSL is breaking this, or should do I need to start over on my initial Owncloud configuration?
 

statik

Explorer
Joined
Sep 8, 2013
Messages
71
Ok, I've tweaked the nginx.conf file to make it easier to go straight to the IP without having to put in /owncloud

Just add /owncloud to the end of this line:

root /usr/local/www/owncloud;

Then remove /owncloud in the lines below it.

Well this fixed my issue with Owncloud not taking my password while using SSL. I am running Owncloud 8.2.2 with no probs so far.
 

adrianwi

Guru
Joined
Oct 15, 2013
Messages
1,231
I thought I'd change my root folder to include /usr/local/www/owncloud as it would avoid entering /owncloud after my url and it works fine with the exception of the standard icons disappearing from the menu bars.

Any idea what needs changing to fix this?

Cheers
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I thought I'd change my root folder to include /usr/local/www/owncloud as it would avoid entering /owncloud after my url and it works fine with the exception of the standard icons disappearing from the menu bars.

Any idea what needs changing to fix this?

Cheers
you should have also removed /owncloud from the try_files line. id check with a fresh browser to make sure it's not a caching issue.
 

statik

Explorer
Joined
Sep 8, 2013
Messages
71
I did not find a post about this.

Has anyone run into the problem when trying to connect to their Owncloud via the Owncloud App on Android, getting the error "Unknown error occurred!" after putting in your servers address? works fine for me via a windows web browser.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I did not find a post about this.

Has anyone run into the problem when trying to connect to their Owncloud via the Owncloud App on Android, getting the error "Unknown error occurred!" after putting in your servers address? works fine for me via a windows web browser.
android app works fine for me
 

adrianwi

Guru
Joined
Oct 15, 2013
Messages
1,231
you should have also removed /owncloud from the try_files line. id check with a fresh browser to make sure it's not a caching issue.

Thanks, but I've tried this configuration too and it just breaks more! I've changed it back, as it was more than a few icons that disappeared, and it's not really much of a problem adding the /owncloud on the end :D
 

LarsHalbauer

Cadet
Joined
Feb 28, 2015
Messages
7
Joshua,

Thanks so much for your help! I was successful in getting ownCloud up and running. Has anyone asked about .mov files? I followed your optional guide for video preview; works for standard mp4 files but not mov. Is there an additional package that would pick these up? Thanks again!

Hello jcbergqu,

I'm experiencing the exact same problems while trying to get mysql running with freenas 9.3.1.
How did you fix the problem?

oc_error.PNG
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Hello jcbergqu,

I'm experiencing the exact same problems while trying to get mysql running with freenas 9.3.1.
How did you fix the problem?

View attachment 10671
'sockstat' and 'service mysql-server status' would show if mysql is running and bound to the right socket.
 

LarsHalbauer

Cadet
Joined
Feb 28, 2015
Messages
7
sockstat confirms, that mysql isn't bound to any sockets.
The mysql-server is not running.

When I try to start it, I get no error code.

mysql-error.PNG


Is there any installation log or something like this?

EDIT:

I found an entry in the system messages:
Code:
/usr/local/etc/rc.d/mysql-server: WARNING: failed precmd routine for mysql


Has this something to do with the problem?
 
Last edited:

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
sockstat confirms, that mysql isn't bound to any sockets.
The mysql-server is not running.

When I try to start it, I get no error code.

View attachment 10683

Is there any installation log or something like this?

EDIT:

I found an entry in the system messages:
Code:
/usr/local/etc/rc.d/mysql-server: WARNING: failed precmd routine for mysql


Has this something to do with the problem?
not sure what the error means specifically. did you create /var/db/mysql/my.cnf as prescribed?
 

LarsHalbauer

Cadet
Joined
Feb 28, 2015
Messages
7
Yes,
I followed the steps exactly, but the error remains.
I read through various threads and reinstalled mysql as well as I tried to change the permissions on /tmp or /var/db/mysql.
I'm a little bit out of ideas, because I also tried everything in a new jail and it also didn't work.
'service mysql-server start' won't start the mysql-server...

EDIT:
Now the server starts! (Don't ask me why, because I was not doing anything with the jail.)

But now it gets weird:
When I try to do the secure installation for the first time, and the password should be blank, I get the following error:
Code:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)


Some people say, it should help to skip the secure installation and do just mysql -u root -p, but the error occures anyway.
 
Last edited:

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Yes,
I followed the steps exactly, but the error remains.
I read through various threads and reinstalled mysql as well as I tried to change the permissions on /tmp or /var/db/mysql.
I'm a little bit out of ideas, because I also tried everything in a new jail and it also didn't work.
'service mysql-server start' won't start the mysql-server...

EDIT:
Now the server starts! (Don't ask me why, because I was not doing anything with the jail.)

But now it gets weird:
When I try to do the secure installation for the first time, and the password should be blank, I get the following error:
Code:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)


Some people say, it should help to skip the secure installation and do just mysql -u root -p, but the error occures anyway.
you get that error from running "mysql_secure_installation"?
that makes it seem like you tried entering a password which shouldn't be needed.

 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I also tried it without the password and got the same error.
if you want you can stop mysql, clear out /var/db/mysql (which stores your database), recreate your my.cnf, start mysql-server and try it again.
 

kawertz

Cadet
Joined
Oct 20, 2015
Messages
5
i will first admit i have no idea what i'm doing.
I made it through your guide right up until; the webui stuff (jailip/owncloud) when i put in my owncloud ip/owncloud (192.168.1.12/owncloud) it returns a 502 Bad gateway. there are so many places up to this point i could have screwed up so i'm not sure which part of the code to post. can you suggest where i might have gone wrong to be getting a 502 page???
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
i will first admit i have no idea what i'm doing.
I made it through your guide right up until; the webui stuff (jailip/owncloud) when i put in my owncloud ip/owncloud (192.168.1.12/owncloud) it returns a 502 Bad gateway. there are so many places up to this point i could have screwed up so i'm not sure which part of the code to post. can you suggest where i might have gone wrong to be getting a 502 page???
I think 502 means bad gateway, so check 'sockstat' to see if php is listening at the listen directive from the php-fpm.conf
 

Joshua Parker Ruehlig

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