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

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Ok. We moving further :)
make config-recursive install clean -C /usr/ports/devel/pecl-APCu

The make stops here:
===> pecl-APCu-5.1.5 cannot be installed: doesn't work with lang/php70 port
(doesn't support PHP 70).
*** Error code 1
Stop.
make: stopped in /usr/ports/devel/pecl-APCu

I just used default options for make.
ohh, and comment out "IGNORE_WITH_PHP= 70" in the Makefile
 

Perm1990

Dabbler
Joined
Feb 25, 2016
Messages
43
ohh, and comment out "IGNORE_WITH_PHP= 70" in the Makefile
I did as you suggested:

make config-recursive install clean -C /usr/ports/devel/pecl-APCu

Output:
===> Setting user-specified options for pecl-APCu-5.1.5 and dependencies
/!\ WARNING /!\
You have security/openssl installed but do not have DEFAULT_VERSIONS+=ssl=openssl set in your make.conf
===> License PHP301 accepted by the user
===> pecl-APCu-5.1.5 depends on file: /usr/local/sbin/pkg - found
=> PECL/apcu-5.1.5.tgz is not in /usr/ports/devel/pecl-APCu/distinfo.
=> Either /usr/ports/devel/pecl-APCu/distinfo is out of date, or
=> PECL/apcu-5.1.5.tgz is spelled incorrectly.
*** Error code 1
Stop.
make: stopped in /usr/ports/devel/pecl-APCu
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
you missed the 'make makesum' part. Also I say that I typoed this as well, sorry was replying earlier at the DMV on my phone.
 

Joshua Parker Ruehlig

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

Perm1990

Dabbler
Joined
Feb 25, 2016
Messages
43

IsNoGood

Cadet
Joined
May 1, 2016
Messages
6
After updating php56 to php70 i have get error with post server "Connection could not be established with host smtp.gmail.com [Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP? #8])". Can't find how to enable ssl support for php.
View attachment 12792

UPDATE: problem solved php70-openssl wasn't installed need add it to line
"pkg install nginx mariadb101-server redis php70-extensions php70-bz2 php70-curl php70-exif php70-fileinfo php70-gd php70-intl php70-mbstring php70-mcrypt php70-pdo_mysql php70-zip php70-zlib php70-redis php70-openssl && pkg delete php70-sqlite3"
 
Last edited:

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
After updating php56 to php70 i have get error with post server "Connection could not be established with host smtp.gmail.com [Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP? #8])". Can't find how to enable ssl support for php.
View attachment 12792

UPDATE: problem solved php70-openssl wasn't installed need add it to line
"pkg install nginx mariadb101-server redis php70-extensions php70-bz2 php70-curl php70-exif php70-fileinfo php70-gd php70-intl php70-mbstring php70-mcrypt php70-pdo_mysql php70-zip php70-zlib php70-redis php70-openssl && pkg delete php70-sqlite3"
Thanks, not sure how I missed that!
 

adrianwi

Guru
Joined
Oct 15, 2013
Messages
1,231
Is updating PHP from 5.6 to 7.0 just a case of pkg install for all the PHP modules, or do you need to pkg remove the 5.6 version?

And does it seem any faster?
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Is updating PHP from 5.6 to 7.0 just a case of pkg install for all the PHP modules, or do you need to pkg remove the 5.6 version?

And does it seem any faster?
I think they conflict with each other, so when you try the 'pkg install' command the 56 versions will be removed.
I don't notice a speed difference, but theoretically it is.
 

Sean Kim

Cadet
Joined
Jul 16, 2016
Messages
2
Hello, I am new to here. I was initially able to install owncloud successfully with the guide. When I tried to do it second time, I can't find mariadb101-server at all. I am using FreeNAS-9.10-STABLE-201606270534 (dd17351).
Here is list of mariadb available,

pkg search mariadb
mariadb100-client-10.0.26 Multithreaded SQL database (client)
mariadb100-server-10.0.26 Multithreaded SQL database (server)
mariadb55-client-5.5.50 Multithreaded SQL database (client)
mariadb55-server-5.5.50 Multithreaded SQL database (server)
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Hello, I am new to here. I was initially able to install owncloud successfully with the guide. When I tried to do it second time, I can't find mariadb101-server at all. I am using FreeNAS-9.10-STABLE-201606270534 (dd17351).
Here is list of mariadb available,

pkg search mariadb
mariadb100-client-10.0.26 Multithreaded SQL database (client)
mariadb100-server-10.0.26 Multithreaded SQL database (server)
mariadb55-client-5.5.50 Multithreaded SQL database (client)
mariadb55-server-5.5.50 Multithreaded SQL database (server)
just use mariadb100-server then
 

Sean Kim

Cadet
Joined
Jul 16, 2016
Messages
2
Hi Joshua, I was able to install owncloud using mariadb100-server. Now, I am getting error 502 Bad gateway if I add following codes,
  1. su -m www -c 'php /usr/local/www/owncloud/occ config:system:set memcache.local --value="\OC\Memcache\APCu"'
  2. su -m www -c 'php /usr/local/www/owncloud/occ config:system:set memcache.locking --value="\OC\Memcache\Redis"'
  3. su -m www -c 'php /usr/local/www/owncloud/occ config:system:set redis host --value="/tmp/redis.sock"'
  4. su -m www -c 'php /usr/local/www/owncloud/occ config:system:set redis port
Do I need to use these codes?
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Hi Joshua, I was able to install owncloud using mariadb100-server. Now, I am getting error 502 Bad gateway if I add following codes,
  1. su -m www -c 'php /usr/local/www/owncloud/occ config:system:set memcache.local --value="\OC\Memcache\APCu"'
  2. su -m www -c 'php /usr/local/www/owncloud/occ config:system:set memcache.locking --value="\OC\Memcache\Redis"'
  3. su -m www -c 'php /usr/local/www/owncloud/occ config:system:set redis host --value="/tmp/redis.sock"'
  4. su -m www -c 'php /usr/local/www/owncloud/occ config:system:set redis port
Do I need to use these codes?
no, they just enable different cache mechanism. you can disable them. but if you read the last few posts, you can see another person had the same issue, related to APCu not being updated on freebsd, and I gave them the steps to fix it.
 

Apollo

Wizard
Joined
Jun 13, 2013
Messages
1,458
Hi Joshua,

The number of pages this thread is reaching is becoming insane. Looking for specifics is becoming more challenging as the thread is expanding.
I wish it was possible to generate a PDF version of this thread for offline reading and highlighting key points and add personal notes.

Question:
I am running the hold jail system under Freenas 9.3 and I will be installing a new instance of Owncloud under the latest jail system based on FreeBSD 10 I believe.
I will be poiting the new jail to my existing files and database mounted under /mnt/files and /var/db/mysql.
As far I understand, I need to perform a new install following your guide up to section that deals with starting the service on line 1 of the folowing:
Code:
    service nginx start && service php-fpm start && service mysql-server start && service redis start
    mysql_secure_installation
    mysql -u root -p
        CREATE DATABASE owncloud;
        GRANT ALL PRIVILEGES ON owncloud.* TO 'ocuser'@'localhost' IDENTIFIED BY 'ocpass';
        FLUSH PRIVILEGES;
        quit;


I will need to skip the commands from line 2 to 7.
After that, I will proceed with the rest of the install up to the point where owncloud is being configured through web browser.
Normally, on a brand new system, I would fill out the Storage and database fields as well as creating a new admin account.
If I proceed that way, I think I might corrupt my databse.
So instead, I can copy the contnet of the old jail:
/usr/local/www/owncloud/config/config.php to the new jail location.

Then it's just a matter of restarting the jail.

Is this the proper and more elegant approch or do you advise in a different path?
Am I overlooking anything critical?
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Hi Joshua,

The number of pages this thread is reaching is becoming insane. Looking for specifics is becoming more challenging as the thread is expanding.
I wish it was possible to generate a PDF version of this thread for offline reading and highlighting key points and add personal notes.

Question:
I am running the hold jail system under Freenas 9.3 and I will be installing a new instance of Owncloud under the latest jail system based on FreeBSD 10 I believe.
I will be poiting the new jail to my existing files and database mounted under /mnt/files and /var/db/mysql.
As far I understand, I need to perform a new install following your guide up to section that deals with starting the service on line 1 of the folowing:
Code:
    service nginx start && service php-fpm start && service mysql-server start && service redis start
    mysql_secure_installation
    mysql -u root -p
        CREATE DATABASE owncloud;
        GRANT ALL PRIVILEGES ON owncloud.* TO 'ocuser'@'localhost' IDENTIFIED BY 'ocpass';
        FLUSH PRIVILEGES;
        quit;


I will need to skip the commands from line 2 to 7.
After that, I will proceed with the rest of the install up to the point where owncloud is being configured through web browser.
Normally, on a brand new system, I would fill out the Storage and database fields as well as creating a new admin account.
If I proceed that way, I think I might corrupt my databse.
So instead, I can copy the contnet of the old jail:
/usr/local/www/owncloud/config/config.php to the new jail location.

Then it's just a matter of restarting the jail.

Is this the proper and more elegant approch or do you advise in a different path?
Am I overlooking anything critical?
it sounds like you understand what to do. save your config.php and mount your datasets to the new jail.
 

Apollo

Wizard
Joined
Jun 13, 2013
Messages
1,458
Hi Joshua,

I was able to install and access owncloud but not without challenges.
As I am using Nginx to implement SSL, I have to copy the relevant nginx.conf file to the new install jail as well as the ssl certificate and keys.
One part that really troubled me is the presence of the Bad Gateway within Nginx browser.
It seems running the following commands cause corruption somewhere:

Code:
pkg install libreoffice pecl-imagick
pkg install ffmpeg


For some reason, one of the above package is based on PHP 5. Could it be the reason causing the Bad Gateway issue? Is this breaking PHP 7?

Also, do you have a guide on setting up HAPproxy on pFsense to service owncloud? This would be a nice addition to this thread I think.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Hi Joshua,

I was able to install and access owncloud but not without challenges.
As I am using Nginx to implement SSL, I have to copy the relevant nginx.conf file to the new install jail as well as the ssl certificate and keys.
One part that really troubled me is the presence of the Bad Gateway within Nginx browser.
It seems running the following commands cause corruption somewhere:

Code:
pkg install libreoffice pecl-imagick
pkg install ffmpeg


For some reason, one of the above package is based on PHP 5. Could it be the reason causing the Bad Gateway issue? Is this breaking PHP 7?

Also, do you have a guide on setting up HAPproxy on pFsense to service owncloud? This would be a nice addition to this thread I think.
I would not call that corruption. that sounds like dependency issues. I guess pecl-imagick would use php5 by default; you could get around this by compiling from ports.

no guide on haproxy. if you need help with that the developer has been very responsive to me on the pfsense forum.
 

dr_cmoore

Cadet
Joined
Aug 5, 2016
Messages
1
INSTALLATION

FreeNAS WebUI
Storage > Create ZFS Dataset

  • Dataset Name = files
  • Compression level = lz4
  • Enable atime = Off
  • Dataset Name = db
  • Compression level = zle
  • Enable atime = Off
  • Record Size = 16K
Jails > Add Jails

Add Storage

  • Source = /mnt/tank/files
  • Destination = /mnt/files
  • Source = /mnt/tank/db
  • Destination = /var/db/mysql
Console in FreeNAS's userland
Code:
zfs set primarycache=metadata tank/db


Console in jail's userland


Code:
pkg upgrade
pkg install nginx mariadb101-server redis php70-bz2 php70-ctype php70-curl php70-dom php70-exif php70-fileinfo php70-filter php70-gd php70-hash php70-iconv php70-intl php70-json php70-mbstring php70-mcrypt php70-pdo_mysql php70-openssl php70-posix php70-session php70-simplexml  php70-xml php70-xmlreader php70-xmlwriter php70-xsl php70-wddx php70-zip php70-zlib php70-redis
[/SIZE]

Based on other posts and errors I received it looks the pkg install command should have "mariadb100-server" vs. "mariddb101-server"
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
101 should be available, but I think some freebsd repos are missing it for some reason. 100 works as well
 
Top