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

https://www.iij.ad.jp/company/development/tech/activities/weighttp/

ブート時にこの値になるよう設定するには、「/etc/sysctl.conf」に以下を書き加えます。

net.core.somaxconn = 10000

AM3

/etc/sysctrl.conf

# https://pleiades.ucsc.edu/hyades/FreeBSD_Network_Tuning
kern.maxfiles=6289573
kern.maxfilesperproc=6289573
#kern.maxvnodes=3339551
Sep 25 02:55:00 sun1 /usr/sbin/cron[75782]: (munin) CMD (/usr/local/bin/munin-cron)
Sep 25 03:00:00 sun1 /usr/sbin/cron[76073]: (root) CMD (newsyslog)
Sep 25 03:00:00 sun1 /usr/sbin/cron[76074]: (root) CMD (/usr/libexec/atrun)
Sep 25 03:00:00 sun1 /usr/sbin/cron[76075]: (operator) CMD (/usr/libexec/save-entropy)
Sep 25 03:00:00 sun1 /usr/sbin/cron[76076]: (munin) CMD (/usr/local/bin/munin-cron)
Sep 25 03:01:00 sun1 /usr/sbin/cron[76365]: (root) CMD (adjkerntz -a)
Sep 25 03:01:00 sun1 /usr/sbin/cron[76366]: (root) CMD (periodic daily)
Sep 25 04:39:58 sun1 kernel: sonewconn: pcb 0xfffff80079f03ae0: Listen queue overflow: 193 already in queue awaiting acceptance (1 occurrences)
Sep 25 04:41:03 sun1 kernel: sonewconn: pcb 0xfffff80079f03ae0: Listen queue overflow: 193 already in queue awaiting acceptance (8 occurrences)
Sep 25 04:42:07 sun1 kernel: sonewconn: pcb 0xfffff80079f03ae0: Listen queue overflow: 193 already in queue awaiting acceptance (10 occurrences)
Sep 25 04:43:11 sun1 kernel: sonewconn: pcb 0xfffff80079f03ae0: Listen queue overflow: 193 already in queue awaiting acceptance (3 occurrences)
Sep 25 04:44:15 sun1 kernel: sonewconn: pcb 0xfffff80079f03ae0: Listen queue overflow: 193 already in queue awaiting acceptance (8 occurrences)

https://blog.tyk.nu/blog/fun-with-freebsd-listen-queue-overflow/

https://github.com/tmux/tmux/issues/352


Total access 5342:本日 1:昨日 0

Counter: 5342, today: 1, yesterday: 0

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