CONTENTS
Lastmodified 2022-05-10 (火) 09:09:31
# portinstall www/nextcloud # portinstall graphics/ImageMagick-nox11
/usr/local/etc/pkgtools.conf
HOLD_PKGS = [ 'bsdpan-*', 'www/nextcloud*', ]
とすると、こうなる。
Ports tree is already up to date. [Reading data from pkg(8) ... - 441 packages found - done] glib-2.56.1_1,1 < needs updating (port has 2.56.1_2,1) gobject-introspection-1.50.0_1,1 < needs updating (port has 1.56.1,1) help2man-1.47.7 < needs updating (port has 1.47.8) nextcloud-php70-14.0.1 < [held] needs updating (port has 14.0.3) ←こうなる pkg-1.10.5_4 < needs updating (port has 1.10.5_5) pkgconf-1.5.3,1 < needs updating (port has 1.5.4,1) postgresql95-client-9.5.14 < needs updating (port has 9.5.14_1) py27-openssl-17.5.0_1 < needs updating (port has 18.0.0)
# 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.*
# 以下の行のコメントを外す 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
<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
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',
# 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>
*********************************************************************** * NEXTCLOUD VERSION UPGRADE * *********************************************************************** After a version migration you should upgrade your nextcloud instance using command line: * cd /usr/local/www/nextcloud * su -m www -c "php ./occ upgrade"
# su -m www -c "php /usr/local/www/nextcloud/occ upgrade"
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! /!\ NEXTCLOUD 13.0.1 UPDATE /!\ The nextcloud 13.0.1 package changes the location of the bundled apps. After updating to 13.0.1 you MUST adapt your configuration. You MUST add an additional entry to the "apps-paths" array in config/config.php 1 => array ( 'path' => '/usr/local/www/nextcloud/apps-pkg', 'url' => '/apps-pkg', 'writable' => false, ), For the default installation, the fix can be applied with: cd /usr/local/www/nextcloud su -m www -c "php ./occ config:import < /usr/local/share/nextcloud/fix-apps_paths.json" !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# su -m www -c "php ./occ upgrade" Nextcloud or one of the apps require upgrade - only a limited number of commands are available You may use your browser or the occ upgrade command to do the upgrade Set log level to debug Updating database schema Updated database Checking for update of app activity in appstore Checked for update of app "activity" in appstore Checking for update of app comments in appstore Checked for update of app "comments" in appstore Checking for update of app dav in appstore Checked for update of app "dav" in appstore Checking for update of app federatedfilesharing in appstore Checked for update of app "federatedfilesharing" in appstore Checking for update of app federation in appstore Checked for update of app "federation" in appstore Checking for update of app files in appstore Checked for update of app "files" in appstore Checking for update of app files_pdfviewer in appstore Checked for update of app "files_pdfviewer" in appstore Checking for update of app files_sharing in appstore Checked for update of app "files_sharing" in appstore Checking for update of app files_texteditor in appstore Checked for update of app "files_texteditor" in appstore Checking for update of app files_trashbin in appstore Checked for update of app "files_trashbin" in appstore Checking for update of app files_versions in appstore Checked for update of app "files_versions" in appstore Checking for update of app files_videoplayer in appstore Checked for update of app "files_videoplayer" in appstore Checking for update of app firstrunwizard in appstore Checked for update of app "firstrunwizard" in appstore Checking for update of app gallery in appstore Checked for update of app "gallery" in appstore Checking for update of app logreader in appstore Checked for update of app "logreader" in appstore Checking for update of app lookup_server_connector in appstore Checked for update of app "lookup_server_connector" in appstore Checking for update of app nextcloud_announcements in appstore Checked for update of app "nextcloud_announcements" in appstore Checking for update of app notifications in appstore Checked for update of app "notifications" in appstore Checking for update of app oauth2 in appstore Checked for update of app "oauth2" in appstore Checking for update of app password_policy in appstore Checked for update of app "password_policy" in appstore Checking for update of app provisioning_api in appstore Checked for update of app "provisioning_api" in appstore Checking for update of app serverinfo in appstore Checked for update of app "serverinfo" in appstore Checking for update of app sharebymail in appstore Checked for update of app "sharebymail" in appstore Checking for update of app survey_client in appstore Checked for update of app "survey_client" in appstore Checking for update of app systemtags in appstore Checked for update of app "systemtags" in appstore Checking for update of app theming in appstore Checked for update of app "theming" in appstore Checking for update of app twofactor_backupcodes in appstore Checked for update of app "twofactor_backupcodes" in appstore Checking for update of app updatenotification in appstore Checked for update of app "updatenotification" in appstore Checking for update of app workflowengine in appstore Checked for update of app "workflowengine" in appstore Starting code integrity check... Finished code integrity check Update successful Maintenance mode is kept active Reset log level
cd /usr/local/www/nextcloud/config/config.php 'maintenance' => false,
https://docs.nextcloud.com/server/12/admin_manual/configuration_server/caching_configuration.html
# portinstall databases/memcached # portinstall databases/pecl-memcache [Reading data from pkg(8) ... - 317 packages found - done] ** Port marked as IGNORE: databases/pecl-memcache: does not work with PHP versions 70 71 72 73 and 71 is installed. ←2018年11月18日現在
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では、エラーの嵐状態となる。
トランザクションファイルロックを使用して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. ),
Web設定 ⇒ 管理 ⇒ 基本設定 ⇒ ファイル操作 ⇒ 最大アップロードサイズ 511MB を変更するには、
/usr/local/www/nextcloud/.htaccess
<IfModule mod_php5.c> php_value upload_max_filesize 1024M ← 511M php_value post_max_size 1024M ← 511M php_value memory_limit 512M php_value mbstring.func_overload 0 php_value always_populate_raw_post_data -1 php_value default_charset 'UTF-8' php_value output_buffering 0 <IfModule mod_env.c> SetEnv htaccessWorking true </IfModule> </IfModule> <IfModule mod_php7.c> php_value upload_max_filesize 1024M ← 511M php_value post_max_size 1024M ← 511M php_value memory_limit 512M php_value mbstring.func_overload 0 php_value default_charset 'UTF-8' php_value output_buffering 0 <IfModule mod_env.c> SetEnv htaccessWorking true </IfModule> </IfModule>
https://wiki.archlinuxjp.org/index.php/Nextcloud
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/
コマンドにスペースが含まれるとエラーする
# sysctl -w kern.ipc.somaxconn = 100000 kern.ipc.somaxconn: 128 sysctl: unknown oid '' sysctl: unknown oid '100000'
ので、こう
# sysctl -w kern.ipc.somaxconn=100000 kern.ipc.somaxconn: 128 -> 100000
ブート時にこの値になるよう設定するには、「/etc/sysctl.conf」に以下を書き加えます
kern.ipc.somaxconn=100000
/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
https://wiki.archlinux.jp/index.php/Nextcloud#CSync_failed_to_find_a_specific_file.
Total access 5342:本日 1:昨日 0