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

Wade

Contributor
Joined
Feb 16, 2014
Messages
110
ok, i went to /mnt/tank/jails/owncloud_jail/usr/local/www/owncloud/config deleted config.php, then re-did these steps just replacing owncould with owncloud1 as database name, anyway.... im back in business
  1. mysql_secure_installation
  2. mysql -u root -p
  3. CREATE DATABASE owncloud;
  4. GRANT ALL PRIVILEGES ON owncloud.* TO 'ocuser'@'localhost' IDENTIFIED BY 'ocpass';
  5. FLUSH PRIVILEGES;
  6. quit;
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
@mcolinp
I'm not sure if you got your issue resolved trying to view pre-existing files in the /mnt/tank/files

I recommend tank/files be a fresh dataset for owncloud. it's not as simple as having files in /mint/files for the OC jail. OC stores files per user in /mnt/files/USER/files. if you have, for example files you want one, some, or all OC uses to have access to I recommend you
1) mount that dataset in the jail. (maybe to /mnt/data)
2) use OC external storage app to mount it for some or all users
Cavieats are..
1) the 'www' user will need to be able to read/write these files
2) I enabled X-sendfile in this guide. See http://doc.owncloud.org/server/7.0/admin_manual/configuration/xsendfile.html#nginx-x-accel-redirect
 

mcolinp

Explorer
Joined
Jan 30, 2013
Messages
84
Thanks Joshua.

I am really confused; because I have been using the PBI version of owncloud with a specific dataset as you described; with "www" as the user & owner. I had been simply putting files into mnt/media and it worked as expected. This worked well until recently when I was no longer able to get owncloud to display any of the files from the dataset. I have tried to "add storage" pointing the dataset to either "/media" or "/mnt/files", inside the jail as your guide instructed.

I have temporarily put this to the side; as I have work to do, and this already has taken up two weeks of my life which I will never get back. :(

I will eventually get back to this; as I was heavily relying on owncloud to sync all my relatively current projects. It seems strange to me that when using the Freenas GUI; it at times will show files are actually in the jail; but something causes owncloud not to show them.

Any suggestions to try are welcome.

P.S. The symptoms I have described are not exclusive to your guide only. I have the same problem with the newer PBI versions of owncloud as well. (6.0.3 & 7.0.2)
I have succeeded in get owncloud up and running using your guide; just not with an outside dataset. (I really don't want my jail to keep ballooning in size; and I want the data to be separate from a jail failure.
 
Last edited:

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
are the files showing up in the jail under /mnt/files? if so then the issue is with FN, if not the issue is with OC.

just speculation, but maybe the files aren't being indexed by OC. I personally just imported my old files through the sync client but this may not be an option for you.
 

mcolinp

Explorer
Joined
Jan 30, 2013
Messages
84
That is an interesting thought. When I say the files are there; it means that if you used the list command in the shell; the files would be there. (In the jail) But when I open owncloud; it only shows the default folders that are typical of owncloud with no files added. (Documents, Photos, Music, etc.)

When I get a chance; I will try re-uploading the files; instead of just adding the location through "add storage".
 

mcolinp

Explorer
Joined
Jan 30, 2013
Messages
84
I did upload some docs into owncloud (PBI version); and the files did show up in the external dataset. That is good news. Though it used to be that when I had a new version of owncloud; it would detect the existing owncloud items and migrate without issue. At any rate; I guess I can take another stab @ going thought this guide again and re-upload my files. Thanks for your help.
 

bkvamme

Dabbler
Joined
Jun 26, 2014
Messages
16
Hello,

When I run:

Code:
make install clean -C /usr/ports/devel/pecl-APCu


I get stuck when having to select a file to patch when installing m4. If I try to run pkg install m4, it installs it and lets the code above continue further, until it crashes when installing perl.

Code:
===> Fetching all distfiles required by perl5-5.16.3_11 for building
===>  Extracting for perl5-5.16.3_11
=> SHA256 Checksum OK for perl/perl-5.16.3.tar.bz2.
=> SHA256 Checksum OK for perl/BSDPAN-20111107.tar.bz2.
===>  Patching for perl5-5.16.3_11
===>  Applying FreeBSD patches for perl5-5.16.3_11
Ignoring previously applied (or reversed) patch.
1 out of 1 hunks ignored--saving rejects to cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Any.pm.rej
=> Patch patch-cpan__ExtUtils-MakeMaker__lib__ExtUtils__MM_Any.pm failed to apply cleanly.
=> Patch(es) patch-4d106cc5d8fd328d39b1db3c57572dd3dec915b5 patch-BigInt.pm patch-Configure patch-INST_PREFIX.t patch-MM_Any.pm applied cleanly.
*** [do-patch] Error code 1

Stop in /usr/ports/lang/perl5.16.
*** [install] Error code 1

Stop in /usr/ports/lang/perl5.16.
*** [build-depends] Error code 1

Stop in /usr/ports/devel/p5-Locale-gettext.
*** [build-depends] Error code 1

Stop in /usr/ports/misc/help2man.
*** [install] Error code 1

Stop in /usr/ports/misc/help2man.
*** [build-depends] Error code 1

Stop in /usr/ports/devel/autoconf.
*** [build-depends] Error code 1

Stop in /usr/ports/devel/pecl-APCu.


Any advice?
 

Joshua Parker Ruehlig

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

When I run:

Code:
make install clean -C /usr/ports/devel/pecl-APCu


I get stuck when having to select a file to patch when installing m4. If I try to run pkg install m4, it installs it and lets the code above continue further, until it crashes when installing perl.

Code:
===> Fetching all distfiles required by perl5-5.16.3_11 for building
===>  Extracting for perl5-5.16.3_11
=> SHA256 Checksum OK for perl/perl-5.16.3.tar.bz2.
=> SHA256 Checksum OK for perl/BSDPAN-20111107.tar.bz2.
===>  Patching for perl5-5.16.3_11
===>  Applying FreeBSD patches for perl5-5.16.3_11
Ignoring previously applied (or reversed) patch.
1 out of 1 hunks ignored--saving rejects to cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Any.pm.rej
=> Patch patch-cpan__ExtUtils-MakeMaker__lib__ExtUtils__MM_Any.pm failed to apply cleanly.
=> Patch(es) patch-4d106cc5d8fd328d39b1db3c57572dd3dec915b5 patch-BigInt.pm patch-Configure patch-INST_PREFIX.t patch-MM_Any.pm applied cleanly.
*** [do-patch] Error code 1

Stop in /usr/ports/lang/perl5.16.
*** [install] Error code 1

Stop in /usr/ports/lang/perl5.16.
*** [build-depends] Error code 1

Stop in /usr/ports/devel/p5-Locale-gettext.
*** [build-depends] Error code 1

Stop in /usr/ports/misc/help2man.
*** [install] Error code 1

Stop in /usr/ports/misc/help2man.
*** [build-depends] Error code 1

Stop in /usr/ports/devel/autoconf.
*** [build-depends] Error code 1

Stop in /usr/ports/devel/pecl-APCu.


Any advice?
maybe try 'pkg install perl5'
 

bkvamme

Dabbler
Joined
Jun 26, 2014
Messages
16
Excellent, that did the trick!

Thank you very much.

To sum it up, I had to run

Code:
pkg install m4 && pkg install perl5
make install clean -C /usr/ports/devel/pecl-APCu


To get it to install properly.
 

mcolinp

Explorer
Joined
Jan 30, 2013
Messages
84
I also am having difficulties in the same spot; but different. I tried the updated commands by bkvamme; but after attempting to run this command:

  1. make install clean -C /usr/ports/devel/pecl-APCu
I get this error response:

root@oC:/ # make install clean -C /usr/ports/devel/pecl-APCu
===> pecl-APCu-4.0.6 pkg(8) must be version 1.3.8 or greater, but you have 1.3.
7. You must upgrade pkg(8) first.
*** [install] Error code 1

Stop in /usr/ports/devel/pecl-APCu.
root@oC:/ #

I tried this:
'pkg install pecl-APCu'

but it does not fix it.

This seems to be a new bug; it was not doing this for me around a week ago.

-EDIT- One thing I forgot to include; is that I ran:

'portsnap fetch update'

as well as;

'portsnap extract'

before installing any of the packages.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I got that message recently too.

make install clean -C /usr/ports/ports-mgmt/pkg
 

mcolinp

Explorer
Joined
Jan 30, 2013
Messages
84
So do you run that command before or instead of the original:

  1. make install clean -C /usr/ports/devel/pecl-APCu
Would this be something you could fix in the guide on the original post?
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
So do you run that command before or instead of the original:

  1. make install clean -C /usr/ports/devel/pecl-APCu
Would this be something you could fix in the guide on the original post?
run it first, then install APCu

I'm not going to add this to the OPs
This is a temporary fix and shouldn't be needed once packages for 1.3.8+ are made/distributed.
 

mcolinp

Explorer
Joined
Jan 30, 2013
Messages
84
I tried and got this:

===> Installing for pkg-1.3.8
===> Checking if pkg already installed
===> An older version of pkg is already installed (pkg-1.2.7_2)
You may wish to ``make deinstall'' and install this port again
by ``make reinstall'' to upgrade it properly.
If you really wish to overwrite the old port of pkg
without deleting it first, set the variable "FORCE_PKG_REGISTER"
in your environment or the "make install" command line.
*** [check-already-installed] Error code 1

Stop in /usr/ports/ports-mgmt/pkg.
*** [/usr/ports/ports-mgmt/pkg/work/.install_done.pkg._usr_local] Error code 1
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I tried and got this:

===> Installing for pkg-1.3.8
===> Checking if pkg already installed
===> An older version of pkg is already installed (pkg-1.2.7_2)
You may wish to ``make deinstall'' and install this port again
by ``make reinstall'' to upgrade it properly.
If you really wish to overwrite the old port of pkg
without deleting it first, set the variable "FORCE_PKG_REGISTER"
in your environment or the "make install" command line.
*** [check-already-installed] Error code 1

Stop in /usr/ports/ports-mgmt/pkg.
*** [/usr/ports/ports-mgmt/pkg/work/.install_done.pkg._usr_local] Error code 1
make deinstall -C /usr/ports/ports-mgmt/pkg
 

mcolinp

Explorer
Joined
Jan 30, 2013
Messages
84
Thank You that seemed to work;

though now when I started up owncloud in the GUI I get this:

  • PHP module zip not installed.
    Please ask your server administrator to install the module.

  • PHP module mb multibyte not installed.
    Please ask your server administrator to install the module.

  • PHP module GD not installed.
    Please ask your server administrator to install the module.

  • PHP module zlib not installed.
    Please ask your server administrator to install the module.

  • PHP modules have been installed, but they are still listed as missing?
    Please ask your server administrator to restart the web server.
Seems something in the install process has made the installed PHP modules not list or register properly.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Thank You that seemed to work;

though now when I started up owncloud in the GUI I get this:

  • PHP module zip not installed.
    Please ask your server administrator to install the module.

  • PHP module mb multibyte not installed.
    Please ask your server administrator to install the module.

  • PHP module GD not installed.
    Please ask your server administrator to install the module.

  • PHP module zlib not installed.
    Please ask your server administrator to install the module.

  • PHP modules have been installed, but they are still listed as missing?
    Please ask your server administrator to restart the web server.
Seems something in the install process has made the installed PHP modules not list or register properly.
I'm guessing you installed a different version of php somehow. modules need to match exactly.

pkg upgrade
may be the trick, otherwise you can delete and reinstall all the modules
 

mcolinp

Explorer
Joined
Jan 30, 2013
Messages
84
Would the use of;

"portsnap fetch update"


Followed by;

"portsnap extract"

Before installing all the pkg's be the culprit? I was told to do this by someone else in this thread to solve issues I had at that time.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Would the use of;

"portsnap fetch update"


Followed by;

"portsnap extract"

Before installing all the pkg's be the culprit? I was told to do this by someone else in this thread to solve issues I had at that time.
those just update your ports tree, not really the root of the issue.

I think the issues your getting hit by are the package repo not being as up to date as the ports tree.

'pkg info' and 'pkg delete' might be your friend here. you basically want all your php packages to be the same exact version.
 

mcolinp

Explorer
Joined
Jan 30, 2013
Messages
84
So if I understand you correctly you are saying to run commands like this:

pkg info PHP module zip

or

pkg delete PHP module zip

for all the listed errors that showed up regarding PHP in the owncloud GUI.

Do I then do something like this?:

make reinstall PHP module zip

or possibly this;

pkg install PHP module zip

EDIT: How would I know what to compare the versions against?
 
Top