CONTENTS


Lastmodified 2022-05-10 (火) 09:09:31


Nextcloud

 # portinstall www/nextcloud
 # portinstall graphics/ImageMagick-nox11

SSL

# cd  /usr/local/etc/apache24/
# openssl genrsa -out server.key 2048
# openssl req -new -key server.key -out server.csr
# openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
# chmod 0400 /usr/local/etc/apache24/server.*

edit usr/local/etc/apache24/httpd.conf

# 以下の行のコメントを外す
LoadModule socache_shmcb_module libexec/apache24/mod_socache_shmcb.so
LoadModule ssl_module libexec/apache24/mod_ssl.so
Include etc/apache24/extra/httpd-ssl.conf

edit httpd-ssl.conf

<VirtualHost _default_:443>

#   General setup for the virtual host
DocumentRoot "/usr/local/www/apache24/data"
ServerName xxxx.smb.net:443
ServerAdmin xxxx@smb.net
ErrorLog "/var/log/httpd-error.log"
TransferLog "/var/log/httpd-access.log"
# apachectl restart

post install settings

config.sample.php

/**
 * Where user files are stored. The SQLite database is also stored here, when
 * you use SQLite.
 *
 * Default to ``data/`` in the Nextcloud directory.
 */
'datadirectory' => '/usr/local/www/nextcloudnextcloud/data',

G7

# cp -rp /usr/local/www/nextcloud/data /usr/home/Nextcloud/
# chown -R www:www /usr/home/Nextcloud/data
'datadirectory' => '/usr/home/Nextcloud/data',

/usr/local/etc/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

/usr/local/etc/apache24/Includes/nextcloud.conf

Alias /nextcloud /usr/local/www/nextcloud
AcceptPathInfo On
<Directory /usr/local/www/nextcloud>
    AllowOverride All
    Require all granted
    Header set Strict-Transport-Security "max-age=15768000; includeSubDomains; preload"
</Directory>

Memorycache

https://docs.nextcloud.com/server/12/admin_manual/configuration_server/caching_configuration.html

# portinstall databases/memcached
# portinstall databases/pecl-memcache
memcached_enable="YES"
# portinstall devel/pecl-APCu
[Reading data from pkg(8) ... - 405 packages found - done]
** Port marked as IGNORE: devel/pecl-APCu:
        cannot be installed: doesn't work with lang/php56 port (doesn't support PHP 5.6)
** Listing the failed packages (-:ignored / *:skipped / !:failed)
        - devel/pecl-APCu
# portinstall devel/pecl-APCu4

/usr/local/www/nextcloud/config/config.php

'memcache.local' => '\OC\Memcache\APCu',

「すべてのチェックに合格しました。」とでるが、サーバDBでは、エラーの嵐状態となる。

File locking

https://docs.nextcloud.com/server/12/admin_manual/configuration_files/files_locking_transactional.html?highlight=lock

トランザクションファイルロックを使用してMemcacheを使用するには、Redisサーバーとそれに対応するPHPモジュールをインストールする必要があります。

# portinstall databases/redis
redis_enable="YES"
# portinstall databases/pecl-redis
'redis' => array(
     'host' => 'localhost',
     'port' => 6379,
     'timeout' => 0.0,
     'password' => '', // Optional, if not defined no password will be used.
      ),

ファイルをアップロードすると 'Integrity constraint violation...' エラーが表示される

https://wiki.archlinuxjp.org/index.php/Nextcloud

https://wiki.archlinuxjp.org/index.php/Nextcloud#.E3.83.95.E3.82.A1.E3.82.A4.E3.83.AB.E3.82.92.E3.82.A2.E3.83.83.E3.83.97.E3.83.AD.E3.83.BC.E3.83.89.E3.81.99.E3.82.8B.E3.81.A8_.27Integrity_constraint_violation....27_.E3.82.A8.E3.83.A9.E3.83.BC.E3.81.8C.E8.A1.A8.E7.A4.BA.E3.81.95.E3.82.8C.E3.82.8B

PHPのキャッシュを止めるとOK

/usr/local/etc/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

結局RedisをセットしてPHPキャッシュを止めると、エラーも出なくなる。

ファイルロックを解除する

https://help.nextcloud.com/t/file-is-locked-how-to-unlock/1883


Total access 5111:本日 1:昨日 1

Counter: 5111, today: 1, yesterday: 1

トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS