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

kwessel

Dabbler
Joined
Mar 30, 2015
Messages
44
It is actually working correctly after I ran your test and then reverted back. When I first set it up, I did my first sync on a lan network before I moved it off site.
 

seohyunxian

Cadet
Joined
Jan 24, 2017
Messages
7
I'm a Chinese boy, I can't speak English very well.
I recently ran a PKG upgrade,Unable to open owncloud web page. 502 error occurred.
run service nginx restart ,service php-fpm restart ,Test run OK.
Re installed according to the material, but also failed, can not open the web page, how can I restore the owncloud service?
The nginx version :nginx-1.12.0_3,2
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I'm a Chinese boy, I can't speak English very well.
I recently ran a PKG upgrade,Unable to open owncloud web page. 502 error occurred.
run service nginx restart ,service php-fpm restart ,Test run OK.
Re installed according to the material, but also failed, can not open the web page, how can I restore the owncloud service?
The nginx version :nginx-1.12.0_3,2
I would check your php socket is still listening at '/var/run/php-fpm.sock' with the command "sockstat"

If it is not listening, maybe you updated PHP; I believe at some point the default php/php-fpm configuration file location changed.
Check '/usr/local/etc/php-fpm.d/www.conf' is edited properly.
 

Joseph Lennemann

Explorer
Joined
Aug 27, 2016
Messages
69
@Joshua Parker Ruehlig did you ever find a way to upgrade the PHP version in the nextcloud plugin instead of us less knowledgable members having to create a jail and install Nextcloud.
 

Joshua Parker Ruehlig

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

Apollo

Wizard
Joined
Jun 13, 2013
Messages
1,458
Has anyone tried upgrading to Nextcloud 12.0?
I have tried on a brand new jail install following this post as well has replicating my jails and datasets to another PC then upgrading, while both solutions work, I am getting a "Code integrity check" message from Nextcloud which points to "ownbackup".

Under the Admin page, I have the following messages:

Code:
Security & setup warnings
It's important for the security and performance of your instance that everything is configured correctly. To help you with that we are doing some automatic checks. Please see the Tips & Ticks section and the documentation for more information.

  • Some files have not passed the integrity check. Further information on how to resolve this issue can be found in our documentation. (List of invalid files… / Rescan…)
  • The "X-Frame-Options" HTTP header is not configured to equal to "SAMEORIGIN". This is a potential security or privacy risk and we recommend adjusting this setting.
  • The PHP Opcache is not properly configured. For better performance we recommend ↗ to use following settings in the php.ini: opcache.enable=1 opcache.enable_cli=1 opcache.interned_strings_buffer=8 opcache.max_accelerated_files=10000 opcache.memory_consumption=128 opcache.save_comments=1 opcache.revalidate_freq=1
Please double check the installation guides ↗, and check for any errors or warnings in the log.


The following are the details regarding the "Code integrity check" message:
Code:
Technical information
=====================
The following list covers which files have failed the integrity check. Please read
the previous linked documentation to learn more about the errors and how to fix
them.

Results
=======
- ownbackup
	- EXCEPTION
		- OC\IntegrityCheck\Exceptions\InvalidSignatureException
		- Certificate is not valid.

Raw output
==========
Array
(
	[ownbackup] => Array
		(
			[EXCEPTION] => Array
				(
					[class] => OC\IntegrityCheck\Exceptions\InvalidSignatureException
					[message] => Certificate is not valid.
				)

		)

)


For the opcache issues, I wasn't successful resolving the issue, when I tried to work on it a few weeks back.
Even after updating php.ini and restarting the jail, I would still have the exact same error messages.
There are reference in the Installation document about mutliple instance of php.ini where the update needs to be done.

Any idea?
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Has anyone tried upgrading to Nextcloud 12.0?
I have tried on a brand new jail install following this post as well has replicating my jails and datasets to another PC then upgrading, while both solutions work, I am getting a "Code integrity check" message from Nextcloud which points to "ownbackup".

Under the Admin page, I have the following messages:

Code:
Security & setup warnings
It's important for the security and performance of your instance that everything is configured correctly. To help you with that we are doing some automatic checks. Please see the Tips & Ticks section and the documentation for more information.

  • Some files have not passed the integrity check. Further information on how to resolve this issue can be found in our documentation. (List of invalid files… / Rescan…)
  • The "X-Frame-Options" HTTP header is not configured to equal to "SAMEORIGIN". This is a potential security or privacy risk and we recommend adjusting this setting.
  • The PHP Opcache is not properly configured. For better performance we recommend ↗ to use following settings in the php.ini: opcache.enable=1 opcache.enable_cli=1 opcache.interned_strings_buffer=8 opcache.max_accelerated_files=10000 opcache.memory_consumption=128 opcache.save_comments=1 opcache.revalidate_freq=1
Please double check the installation guides ↗, and check for any errors or warnings in the log.


The following are the details regarding the "Code integrity check" message:
Code:
Technical information
=====================
The following list covers which files have failed the integrity check. Please read
the previous linked documentation to learn more about the errors and how to fix
them.

Results
=======
- ownbackup
	- EXCEPTION
		- OC\IntegrityCheck\Exceptions\InvalidSignatureException
		- Certificate is not valid.

Raw output
==========
Array
(
	[ownbackup] => Array
		(
			[EXCEPTION] => Array
				(
					[class] => OC\IntegrityCheck\Exceptions\InvalidSignatureException
					[message] => Certificate is not valid.
				)

		)

)


For the opcache issues, I wasn't successful resolving the issue, when I tried to work on it a few weeks back.
Even after updating php.ini and restarting the jail, I would still have the exact same error messages.
There are reference in the Installation document about mutliple instance of php.ini where the update needs to be done.

Any idea?
I upgraded the NC12 and do not have any issues/warnings.

Is ownbackup an app you installed?

I'll add some of the security lines to the example config.

Do you not have php70-opcache or php71-opcache installed? It should be enabled by default when installed.
 

Michael Sparks

Explorer
Joined
Apr 23, 2014
Messages
56
Has anyone tried upgrading to Nextcloud 12.0?
I have tried on a brand new jail install following this post as well has replicating my jails and datasets to another PC then upgrading, while both solutions work, I am getting a "Code integrity check" message from Nextcloud which points to "ownbackup".

Under the Admin page, I have the following messages:

Code:
Security & setup warnings
It's important for the security and performance of your instance that everything is configured correctly. To help you with that we are doing some automatic checks. Please see the Tips & Ticks section and the documentation for more information.

  • Some files have not passed the integrity check. Further information on how to resolve this issue can be found in our documentation. (List of invalid files… / Rescan…)
  • The "X-Frame-Options" HTTP header is not configured to equal to "SAMEORIGIN". This is a potential security or privacy risk and we recommend adjusting this setting.
  • The PHP Opcache is not properly configured. For better performance we recommend ↗ to use following settings in the php.ini: opcache.enable=1 opcache.enable_cli=1 opcache.interned_strings_buffer=8 opcache.max_accelerated_files=10000 opcache.memory_consumption=128 opcache.save_comments=1 opcache.revalidate_freq=1
Please double check the installation guides ↗, and check for any errors or warnings in the log.


The following are the details regarding the "Code integrity check" message:
Code:
Technical information
=====================
The following list covers which files have failed the integrity check. Please read
the previous linked documentation to learn more about the errors and how to fix
them.

Results
=======
- ownbackup
	- EXCEPTION
		- OC\IntegrityCheck\Exceptions\InvalidSignatureException
		- Certificate is not valid.

Raw output
==========
Array
(
	[ownbackup] => Array
		(
			[EXCEPTION] => Array
				(
					[class] => OC\IntegrityCheck\Exceptions\InvalidSignatureException
					[message] => Certificate is not valid.
				)

		)

)


For the opcache issues, I wasn't successful resolving the issue, when I tried to work on it a few weeks back.
Even after updating php.ini and restarting the jail, I would still have the exact same error messages.
There are reference in the Installation document about mutliple instance of php.ini where the update needs to be done.

Any idea?


I ran into the same issues, and also followed the solutions posted to correct it (modifying php.ini) but still had the same errors. I contemplated rebuilding entire jail with fresh 12.0 install but haven't had time. However, from your description it doesnt seem to help.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I ran into the same issues, and also followed the solutions posted to correct it (modifying php.ini) but still had the same errors.
strange. Could someone try the following?

* move index.php to index-back.php
* create index.php with the following contents
Code:
<?php
phpinfo();
?>

* browse to nextcloud and see what the page says about opcache
 

Apollo

Wizard
Joined
Jun 13, 2013
Messages
1,458
I upgraded the NC12 and do not have any issues/warnings.

Is ownbackup an app you installed?
Ownbackup is one of the app listed in Nextcloud. It's main purpose is to handle backing up of the database. I removed it then installed it again, and message is no longer present.
 

Apollo

Wizard
Joined
Jun 13, 2013
Messages
1,458
strange. Could someone try the following?

* move index.php to index-back.php
* create index.php with the following contents
Code:
<?php
phpinfo();
?>

* browse to nextcloud and see what the page says about opcache
I have no specific info about "opcache" except the credits.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I have no specific info about "opcache" except the credits.
does 'pkg info' show that php70-opcache is installed?
 

Apollo

Wizard
Joined
Jun 13, 2013
Messages
1,458
does 'pkg info' show that php70-opcache is installed?
I just installed the pakage you referenced:
Here is the output after install.

Code:
Zend OPcache
Opcode Caching Up and Running
Optimization Enabled
SHM Cache Enabled
File Cache Disabled
Startup OK
Shared memory model mmap
Cache hits 0
Cache misses 1
Used memory 9132816
Free memory 57976048
Wasted memory 0
Interned Strings Used memory 278848
Interned Strings Free memory 3915456
Cached scripts 1
Cached keys 1
Max keys 3907
OOM restarts 0
Hash keys restarts 0
Manual restarts 0
Directive Local Value Master Value
opcache.blacklist_filename no value no value
opcache.consistency_checks 0 0
opcache.dups_fix Off Off
opcache.enable On On
opcache.enable_cli Off Off
opcache.enable_file_override Off Off
opcache.error_log no value no value
opcache.fast_shutdown 0 0
opcache.file_cache no value no value
opcache.file_cache_consistency_checks 1 1
opcache.file_cache_only 0 0
opcache.file_update_protection 2 2
opcache.force_restart_timeout 180 180
opcache.huge_code_pages Off Off
opcache.inherited_hack On On
opcache.interned_strings_buffer 4 4
opcache.lockfile_path /tmp /tmp
opcache.log_verbosity_level 1 1
opcache.max_accelerated_files 2000 2000
opcache.max_file_size 0 0
opcache.max_wasted_percentage 5 5
opcache.memory_consumption 64 64
opcache.optimization_level 0x7FFFBFFF 0x7FFFBFFF
opcache.preferred_memory_model no value no value
opcache.protect_memory 0 0
opcache.restrict_api no value no value
opcache.revalidate_freq 2 2
opcache.revalidate_path Off Off
opcache.save_comments 1 1
opcache.use_cwd On On
opcache.validate_permission Off Off
opcache.validate_root Off Off
opcache.validate_timestamps On On
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I just installed the pakage you referenced:
Here is the output after install.

Code:
Zend OPcache
Opcode Caching Up and Running
Optimization Enabled
SHM Cache Enabled
File Cache Disabled
Startup OK
Shared memory model mmap
Cache hits 0
Cache misses 1
Used memory 9132816
Free memory 57976048
Wasted memory 0
Interned Strings Used memory 278848
Interned Strings Free memory 3915456
Cached scripts 1
Cached keys 1
Max keys 3907
OOM restarts 0
Hash keys restarts 0
Manual restarts 0
Directive Local Value Master Value
opcache.blacklist_filename no value no value
opcache.consistency_checks 0 0
opcache.dups_fix Off Off
opcache.enable On On
opcache.enable_cli Off Off
opcache.enable_file_override Off Off
opcache.error_log no value no value
opcache.fast_shutdown 0 0
opcache.file_cache no value no value
opcache.file_cache_consistency_checks 1 1
opcache.file_cache_only 0 0
opcache.file_update_protection 2 2
opcache.force_restart_timeout 180 180
opcache.huge_code_pages Off Off
opcache.inherited_hack On On
opcache.interned_strings_buffer 4 4
opcache.lockfile_path /tmp /tmp
opcache.log_verbosity_level 1 1
opcache.max_accelerated_files 2000 2000
opcache.max_file_size 0 0
opcache.max_wasted_percentage 5 5
opcache.memory_consumption 64 64
opcache.optimization_level 0x7FFFBFFF 0x7FFFBFFF
opcache.preferred_memory_model no value no value
opcache.protect_memory 0 0
opcache.restrict_api no value no value
opcache.revalidate_freq 2 2
opcache.revalidate_path Off Off
opcache.save_comments 1 1
opcache.use_cwd On On
opcache.validate_permission Off Off
opcache.validate_root Off Off
opcache.validate_timestamps On On
Can you restart php-fpm, and move back the index.php file.
Then check if that fixed it.

Weird, I thought I had php70-opcache in the install command, but it was missing.
 

Apollo

Wizard
Joined
Jun 13, 2013
Messages
1,458
It is getting better.
After installing php70-opcache, php71-opcache, I have been able to update the php.ini file with:

nano /usr/local/etc/php.ini

I have uncommented and updated the values based on Nextcloud recommendations:

Code:
opcache.enable=1
opcache.enable_cli=1
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=10000
opcache.memory_consumption=128
opcache.save_comments=1
opcache.revalidate_freq=1


I now need to address the following message:
Code:
Security & setup warnings
It's important for the security and performance of your instance that everything is configured correctly. To help you with that we are doing some automatic checks. Please see the Tips & Ticks section and the documentation for more information.

  • The "X-Frame-Options" HTTP header is not configured to equal to "SAMEORIGIN". This is a potential security or privacy risk and we recommend adjusting this setting.
Please double check the installation guides ↗, and check for any errors or warnings in the log.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
It is getting better.
After installing php70-opcache, php71-opcache, I have been able to update the php.ini file with:

nano /usr/local/etc/php.ini

I have uncommented and updated the values based on Nextcloud recommendations:

Code:
opcache.enable=1
opcache.enable_cli=1
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=10000
opcache.memory_consumption=128
opcache.save_comments=1
opcache.revalidate_freq=1


I now need to address the following message:
Code:
Security & setup warnings
It's important for the security and performance of your instance that everything is configured correctly. To help you with that we are doing some automatic checks. Please see the Tips & Ticks section and the documentation for more information.

  • The "X-Frame-Options" HTTP header is not configured to equal to "SAMEORIGIN". This is a potential security or privacy risk and we recommend adjusting this setting.
Please double check the installation guides ↗, and check for any errors or warnings in the log.
check the css/js section of the nginx.conf, I updated it
 

Apollo

Wizard
Joined
Jun 13, 2013
Messages
1,458
check the css/js section of the nginx.conf, I updated it
No luck there.
I couldn't find the
add_header X-Frame-Options "SAMEORIGIN";

in the nginx.conf file. Maybe the file has not been updated on the forum yet.
It does however appear in mine.
My nginx.conf file is a bit more complexe than yours. I will have to go through it again in more details.
 

Apollo

Wizard
Joined
Jun 13, 2013
Messages
1,458
Have you been able to install spreed.me? I have some issues with the server configuration side of it. The default admin guide is not quite clear when it come to Freenas.
 

Joshua Parker Ruehlig

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