100均(セリア)でノートを買おうとした中で見つけました。

ノートの表紙に貼り付けるためのエンボスシールです。

光沢ありのエンボスシールを角に貼っていくことで、

100均のノートが少し高級な感じに。

元々あったプラカバーと合わせることで、更に表紙を引き立ててくれました。
100均(セリア)でノートを買おうとした中で見つけました。
ノートの表紙に貼り付けるためのエンボスシールです。
光沢ありのエンボスシールを角に貼っていくことで、
100均のノートが少し高級な感じに。
元々あったプラカバーと合わせることで、更に表紙を引き立ててくれました。
Nextcloud Talkを含めたレスポンスが非常に悪いという状況。具体的には
free -h
でもメモリ圧迫という様子を見せず、top
をたたいても異常なし。
何よりも、同一サーバに同居する
などが正常に動いていて、これらはレスポンスも良好。サーバの性能ではなく、サーバ以外のところに原因があると考え、調査開始です。
答えは/var/log
配下のphp8.3-fpm.log
に現れていました。
[04-Oct-2025 17:32:36] WARNING: [pool www] server reached pm.max_children setting (5), consider raising it
[04-Oct-2025 18:45:55] WARNING: [pool www] server reached pm.max_children setting (5), consider raising it
[04-Oct-2025 21:28:57] WARNING: [pool www] server reached pm.max_children setting (5), consider raising it
これにより、PHPのリクエストを処理するワーカープロセスの数が上限(5)に達し、リクエストが滞留していることがパフォーマンス低下の直接的な原因だと特定しました。
これが分かれば、後は実際の対処です。
sudo cp -pi /etc/php/8.3/fpm/pool.d/www.conf /path/to/backup/directory/www.conf.$(date +%Y%m%d)
※php-fpmの設定値は、入れているPHPのバージョンによって異なります。自分の環境に合わせたものに修正してください。
→ /home/hoge/backup
など、任意のバックアップディレクトリを指定します。
diff -u /path/to/backup/directory/www.conf.$(date +%Y%m%d) /etc/php/8.3/fpm/pool.d/www.conf
→ エラーがなければバックアップが取れています。
備考:なぜdiffを用いてバックアップの確認をするのか?
ls -l
よりも確実に、元ファイルとバックアップファイルがあるか「両方のファイル」で確認を取るため。diff
の編集を行った、追記を行った箇所が+
で表示されます。(同様に削った箇所が-
で表示)特に、設定ファイルの修正は非常にデリケートな問題であり、下手な設定がサーバ全体のシステムダウンを引き起こします。このため、変更管理や後のトラブルの追跡を兼ねてのバックアップはサーバメンテナンスの黄金律として体に覚え込ませましょう。
上記、バックアップを取った後の 元ファイル /etc/php/8.3/fpm/pool.d/www.conf
を、管理者権限で、自身の教義・信仰に基づいたエディタで修正します。
こちらの設定値は、apt
などでのパッケージ管理システムでのインストールであれば、
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
となっていることが多いです。これを、以下のように修正しましょう。
pm.max_children = 15
pm.start_servers = 4
pm.min_spare_servers = 2
pm.max_spare_servers = 6
※ サーバ環境などにより、随時、修正を行ってください。
修正後、保存を行います。
diff -u /path/to/backup/directory/www.conf.$(date +%Y%m%d) /etc/php/8.3/fpm/pool.d/www.conf
以下のような差分を確認します。
; Note: This value is mandatory.
-pm.max_children = 5
+pm.max_children = 15
; The number of child processes created on startup.
; Note: Used only when pm is set to 'dynamic'
; Default Value: (min_spare_servers + max_spare_servers) / 2
-pm.start_servers = 2
+pm.start_servers = 4
; The desired minimum number of idle server processes.
; Note: Used only when pm is set to 'dynamic'
; Note: Mandatory when pm is set to 'dynamic'
-pm.min_spare_servers = 1
+pm.min_spare_servers = 2
; The desired maximum number of idle server processes.
; Note: Used only when pm is set to 'dynamic'
; Note: Mandatory when pm is set to 'dynamic'
-pm.max_spare_servers = 3
+pm.max_spare_servers = 6
; The number of rate to spawn child processes at once.
; Note: Used only when pm is set to 'dynamic'
このように、修正前が-
の行、修正後が+
の行で修正されていることが分かります。この数値や設定以上に重要なのは「変なスペースや意図した設定以外の情報が含まれていないか?」を、自分の修正した記憶を頼りにすることではなく、コマンドという絶対的な第三者の目で確認することです。
PHP-FPMだけでなく、前段のApacheもサービス再起動を行います。
sudo systemctl restart apache2.service
systemctl status apache2.service
→ active(running)
を確認します。
sudo systemctl restart php8.3-fpm.service
systemctl status php8.3-fpm.service
→ active(running)
を確認します。
再びNextcloudにアクセスし、事象が改善したことを確認できれば設定完了です。
Nextcloudの利用頻度が高まったからに尽きます。Talkをスマートフォンアプリでも利用したり、データが増えたことで、PHP-FPMの処理能力が追いつかなかったのでしょう。
利用状況に合わせて、ボトルネックを特定し、修正を加えて改善を施していくというのもまた、サーバ運用の苦しくも楽しいところです。
6年ぶりの機種変更を行ったiPhone。そのカメラのベンチマークとして、様々な光がある葛西臨海水族園での検証です。
以前の11Proから広角機能がなくなったものの、どこまで撮影できるのかを確認
より詳細に、動きのある魚や光をきちんと捉えていると、これだけでも技術の進歩を感じます。
秋雲やドームなどの描写もバッチリ。広角を用いるまでもなく広がりが撮れるのは満足しました。
これはマクロが弱くなってるのは否めません。しかし、パンフォーカス気味で詳細に撮影できるのは好印象でした。
など、日常的に使うのは全く問題ありません。これからの相棒としての活躍に期待です。
別で出しているBookStack。(一部の維持は連動しています)
こちら、nano bananaの画像生勢力により、サイトのイメージを
この状態から
こちらへと変更。このように、ブログとの共通バナーを置いた次第です。
Japanese anime / manga style illustration, (maximum moe-style:1.7), (ultra-detailed:1.6), (dramatic contrast between traditional Japanese study room and holographic terminal commands:1.5), (a giant, aged scroll (Makimono) unrolled, with neon-green shell script flowing across its surface:1.6), (atmospheric illumination from the flowing script and floating "$ " prompts:1.4), (standard lens perspective:1.3), (smooth, natural visual composition:1.2), 16:9, widescreen
THRUST_WEIGHT = 1.7 // Thigh emphasis weight for "Stable Foundation of Automation" (1.5 - 2.0 recommended)
// CORE VARIABLES (Optimized for Shell Script Makimono)
HAIR_COLOR = (Matte, deep charcoal or sleek jet black, styled with elegant, traditional rope braids:1.5) // Traditional yet structured.
HAIR_ACCENT = (Kanzashi designed as a delicate, glowing '$ ' (prompt symbol) icon and a miniature sealing stamp:1.7), (Thin pure white and neon-green braided cord decoration:1.4).
GLASSES_STYLE = (Thin, antique metallic-rimmed glasses, reflecting the complex, flowing script logic:1.6) // Glasses for deep analysis.
OUTFIT_BASE_COLOR = (Structured, deep matte indigo or black Kimono-inspired functional wear:1.5) // Elegant and non-distracting color.
EMBROIDERY_COLOR = Neon-green and vibrant orange (CUI commands and variable names:1.4).
HOSIERY_COLOR = Sheer matte black or opaque deep indigo (smooth, functional texture, with subtle glowing lines resembling command pipes:1.6) // Pipe/Flow lines.
// CONSTRAINT & FOCUS (Filter Mitigation & Execution Focus)
Constraint: (Healthy and dignified, intellectual and deeply focused aesthetic only:1.5), (No offensive or sexually explicit content:1.5), (Focus on automation flow and scripting mastery:1.5).
Focus: (Maximum emphasis on the glowing script text on the scroll:1.8), (Fingers delicately touching the scroll, suggesting script execution:1.6), (The elegant, powerful curve of the upper thighs as a stable base for the command flow:THRUST_WEIGHT).
---
// **LETTERING (Shell Script Title - Execution Command)**
(Large, powerful, and perfectly aligned lettering of the words 'Shell Script' projected as glowing, neon-green commands directly over the center of the unrolled Makimono scroll:1.7), (Strict, mono-spaced terminal font, suggesting code precision and execution integrity:1.5), (The letters feature subtle internal segments that resemble pipe operators '|' and glowing '$' prompt symbols at the start of the word, all in neon green:1.6), (Holographic projection effect with sharp, clean edges and intense neon-green internal illumination, contrasting with the parchment texture:1.5), (Intensely illuminated by its own neon-green light, casting sharp, digital-looking reflections onto the aged parchment and the character's clothing:1.4)
---
// PERSPECTIVE, COMPOSITION, & POSE (Filter Safe & Execution Focus)
Perspective: (Medium-low angle perspective:1.5), emphasizing the grandeur of the unrolled scroll.
Framing: (Full body visible, seated in front of a low, sturdy wooden desk/platform:1.4), (**Framed by the subtle texture of a traditional shoji screen and the ancient wooden desk:1.3**).
PoseAction: (**Seated in a calm, focused posture (正座 or 片膝立ち), both hands gently holding the edges of the unrolled giant Makimono:1.7**), (**One finger or a traditional brush hovering over a glowing line of code, suggesting activation or modification:1.6**). // Scripting/Chanting pose.
Expression: (Intense concentration, a calm yet satisfied gaze as the script logic unfolds:1.5).
---
// SETTING & CYBER DETAILS
Location: (**A quiet, traditional Japanese study room (書斎) with a low, dark wooden desk:1.5**), (**The air is filled with subtle, swirling smoke or vapor, suggesting powerful computation:1.6**).
Decorations: (**A massive, aged parchment scroll unrolled, filled with glowing neon-green and orange shell script commands:1.7**), (**Holographic '$ ' prompts floating in the air like dust motes:1.5**), (A traditional inkstone and brush (筆) resting nearby:1.4).
Atmosphere: (Mysterious, powerful, and deeply focused, the magic of automation:1.2).
Details: (**The intense neon light from the script reflects dramatically off the character's face and the glossy hosiery:1.7**), (The contrast between the fragile parchment/wood and the powerful digital light:1.5).
---
// OUTFIT & ACCESSORIES (Automation Modules)
Outfit: (Kimono-inspired functional scholar's robes:1.4) (base=**OUTFIT_BASE_COLOR**, embroidery color=**EMBROIDERY_COLOR**, motif=flowing script/logic gates), (clean, structured, and matte texture:1.5).
Leg Wear: (**HOSIERY_COLOR** tights/leggings with subtle, pipe-like seams:1.6), (modular thigh strap designed as a scroll tie/seal, with a glowing 'for loop' icon charm:1.5).
Accessories: Minimalist choker designed as a logic gate circuit:1.3, A small, portable, clear glass sphere containing a perfectly ordered 'history' log:1.5.
---
// NEGATIVE PROMPTS (General)
(extra fingers:1.8), (fewer fingers:1.8), (malformed hands:1.8), (extra limbs:1.8), (mutated hands:1.8), (bad anatomy:1.5), (disfigured:1.5), (ugly:1.5), (deformed:1.5), (blurry:1.3), (duplicate:1.3), (morbid:1.2), (mutilated:1.2), (out of frame:1.2), (bad proportion:1.2), (bad quality:1.2), (overly sensual:1.5), (crotch_focus:1.5), (nipples:1.5), (vagina:1.5), (too much skin:1.5).
これで、より、自サイトの統一感が保たせられるようになりました。
細かいところに手が届くWindowsPowershell。
その例として、「特定のフォルダにあるpngファイルをjpgにコンバートする」をメモします。
convert.ps1
# 変換対象のフォルダを指定
$folderPath = "C:\Users\hoge\fuga\photo"
# System.Drawing を使うためにアセンブリを読み込む
Add-Type -AssemblyName System.Drawing
# PNGファイルを取得
$pngFiles = Get-ChildItem -Path $folderPath -Filter *.png
foreach ($file in $pngFiles) {
# 画像を読み込む
$image = [System.Drawing.Image]::FromFile($file.FullName)
# 出力ファイル名(拡張子を .jpg に変更)
$jpgPath = [System.IO.Path]::ChangeExtension($file.FullName, "jpg")
# JPEGエンコーダを取得
$jpgEncoder = [System.Drawing.Imaging.ImageCodecInfo]::GetImageEncoders() | Where-Object { $_.MimeType -eq "image/jpeg" }
# エンコードパラメータ(品質指定:90)
$encoderParams = New-Object System.Drawing.Imaging.EncoderParameters(1)
$qualityParam = New-Object System.Drawing.Imaging.EncoderParameter([System.Drawing.Imaging.Encoder]::Quality, 90L)
$encoderParams.Param[0] = $qualityParam
# JPGとして保存
$image.Save($jpgPath, $jpgEncoder, $encoderParams)
# メモリ解放
$image.Dispose()
}
適当な手段で上記を作成し、このスクリプトをPowershellで走らせます。
これはあくまでも「こういうことができた」という例なので、
など、調整のしがいがあります。
前回の温泉旅行から1年以上曲田って言うということもあり、いくつかの“文具”に若干のアップデートがありました。
これが一番の違いです。軽く、頑丈なこれはとても中古で買ったとは思えないパフォーマンスを見せていました。
また、バッテリーの持ちもいいので、家族と話しながらでも活躍です。
ノートPCにもチャージできる大容量モデルが活きました。歩行中などに充電切れとなったiPadなどをチャージしてタイムロスを防ぎます。
これは続投。片手で持ててペンにより入力が容易と、場所を選ばない万能器具です。
今回は残念ながらあまり使わず。PC作業の方に夢中だったからです。なので、日記もまとめてやるというていたらく。
なんといってもこの機種変したiPhoneAIR。
など、今までで難点だった改善点が多数含まれていました。また、マスクありでもFace IDが使えるというのもありがたいです。
谷川岳に訪れたとき。
コインロッカーの小銭がなかったのでお札を崩そうと言う形でお土産物屋に訪れたときに、それを見つけました。
トラベラーズノート、星野リゾートコラボ。このトラベラーズノート自身は知ってはいたものの、手に取ることがなかった製品、しかし、サンプルを手に取って、まさにこんな形で
「これだ!」という顔になりました。
しかも、1万円で支払えばコインロッカーの料金まで支払えます。
そうして、宿で開封と相成りました。
内容物はシンプル。
ぐらいです。ですが、そのシンプルな味わいが逆にいい味を出しています。
宿でも記念撮影をしたほど。
また、リフィルの書き心地も上々なので、これを元に何を記録していくかがワクワクでした。
何と、6年ぶりの機種変更です。
店頭で展示品を見たときに
に感動。矢も楯もたまらず契約をした次第です。
「軽さ」に尽きます。iPhone 11proよりサイズアップしているのに明らかに軽い。カバーをつけても差が無いほど。
5Gにも対応しているので、速度も圧倒的です。
カバー、ストラップをつけて引き継ぎも完了。
旧機と共に。様々な思い入れのある機体、部屋でも端末として使うか何かの余生を与えたいものです。
PHP-FPMを利用したNextcloudのセットアップ方法です。
パフォーマンスとリソース効率を向上させるためです。
従来のmod_php
では、PHPがApacheの全プロセスに組み込まれるため、画像ファイルのリクエストのようなPHPが不要な処理でもメモリを消費し、無駄が多くなりがちでした。
一方、PHP-FPM
はPHPの処理をApacheから完全に独立させた専門のプロセスとして管理します。ApacheはPHPが必要なリクエストだけをPHP-FPMに中継するため、サーバー全体の動作が軽量かつ高速になります。
www-data
/home/www-data
にしています。自分の環境に合わせてください。筆者の好みでaptitude
を用いています。必要に応じてapt
をご利用ください。
最新のPHPバージョンを利用するためにppa:ondrej/php
リポジトリを追加していきます。
sudo add-apt-repository ppa:ondrej/php
sudo apt update
PHP本体、PHP-FPM、Nextcloudが必要とする各種PHPモジュールをインストールします。
sudo aptitude install php8.3 php8.3-fpm php8.3-opcache php8.3-pdo php8.3-bcmath php8.3-calendar php8.3-ctype php8.3-fileinfo php8.3-ftp php8.3-gd php8.3-intl php8.3-json php8.3-mbstring php8.3-mysql php8.3-posix php8.3-readline php8.3-sockets php8.3-bz2 php8.3-tokenizer php8.3-zip php8.3-curl php8.3-iconv php8.3-xml php8.3-imagick php8.3-gmp php8.3-apcu memcached
バージョンを確認します。
php -v
表示例
PHP 8.3.25 (cli) (built: Aug 29 2025 12:01:53) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.3.25, Copyright (c) Zend Technologies
with Zend OPcache v8.3.25, Copyright (c), by Zend Technologies
従来の mod_php
を無効化し、PHP-FPMとの通信に必要な proxy_fcgi
モジュールなどを有効化します。
sudo a2dismod php8.3
sudo a2enmod proxy_fcgi setenvif header rewrite
Nextcloudのパフォーマンス向上のため、PHPのメモリ制限、OPcache、APCuを設定します。
sudo sed -i 's/memory_limit = .*/memory_limit = 512M/g' /etc/php/8.3/fpm/php.ini
Nextcloud推奨の設定値を /etc/php/8.3/mods-available/
に作成・適用します。
cat <<- __EOF__ | sudo tee /etc/php/8.3/mods-available/opcache.ini
opcache.enable=1
opcache.enable_cli=1
opcache.interned_strings_buffer=16
opcache.max_accelerated_files=10000
opcache.memory_consumption=128
opcache.save_comments=1
opcache.revalidate_freq=1
__EOF__
cat <<- __EOF__ | sudo tee /etc/php/8.3/mods-available/apcu.ini
[acpu]
apc.enabled=1
apc.shm_size=32M
apc.ttl=7200 apc.enable_cli=1
apc.serializer=php
__EOF__
Nextcloudが使用するMySQLデータベースと専用ユーザーを作成します。
mysql -u root -p
以下のSQLコマンドを実行します。YOUR_STRONG_PASSWORD
は必ず強固なパスワードに変更してください。
CREATE DATABASE IF NOT EXISTS nextcloud CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
CREATE USER 'nextcloud'@'localhost' IDENTIFIED WITH mysql_native_password BY 'YOUR_STRONG_PASSWORD';
GRANT ALL PRIVILEGES ON nextcloud.* TO 'nextcloud'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Nextcloud本体をダウンロードし、Webサーバーからアクセスできる場所に配置します。
cd /tmp && pwd
任意のディレクトリを指定します。
wget https://download.nextcloud.com/server/releases/latest.zip
unzip latest.zip
sudo mv nextcloud /home/www-data/
sudo chown -R www-data:www-data /home/www-data/nextcloud
Nextcloud用のApache設定ファイルを作成します。ここでPHP-FPMとの連携設定を組み込みます。
sudo mkdir /var/log/nextcloud
www-data
に修正。これは、後のメンテナンス性を高めるためです。
sudo chown www-data:www-data /var/log/nextcloud
/etc/apache2/sites-available/nextcloud.conf
を、teeで一気通貫で作ります。
# 【】内はご自身の環境に合わせてください
cat <<- __EOF__ | sudo tee /etc/apache2/sites-available/nextcloud.conf
<VirtualHost *:80>
ServerName 【hoge.example.com】
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</VirtualHost>
<VirtualHost *:443>
ServerName 【hoge.example.com】
DocumentRoot 【/home/www-data/nextcloud】
CustomLog /var/log/nextcloud/nextcloud_access.log combined
ErrorLog /var/log/nextcloud/nextcloud_error.log
<Directory 【/home/www-data/nextcloud】>
Options -MultiViews
AllowOverride All
Require all granted
</Directory>
# PHP-FPM連携設定
<FilesMatch \.php$>
# SetHandlerで、phpファイルのリクエストをPHP-FPMのソケットに渡す
SetHandler "proxy:unix:/var/run/php/php8.3-fpm.sock|fcgi://localhost/"
</FilesMatch>
# --- SSL設定 ---
SSLEngine on
Protocols h2 http/1.1
SSLCertificateFile 【/etc/certs/hoge.example.com.crt】
SSLCertificateKeyFile 【/etc/private/hoge.example.com.key】
# 中間証明書が別に提供されている場合はこちらを有効化
# SSLCACertificateFile 【/etc/certs/hoge.example.com.CA.crt】
# --- 推奨SSL/TLS設定 ---
SSLProtocol all -SSLv3 -TLSv1 -TLSv1.1
SSLCipherSuite ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384
SSLHonorCipherOrder on
SSLCompression off
SSLSessionTickets off
# --- セキュリティヘッダー ---
# Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains"
Header always set Referrer-Policy "no-referrer"
Header always set X-Content-Type-Options "nosniff"
Header always set X-Frame-Options "SAMEORIGIN"
Header always set X-Permitted-Cross-Domain-Policies "none"
</VirtualHost>
__EOF__
sudo a2ensite nextcloud.conf
sudo apache2ctl configtest
Syntax OK
と表示されることを確認
sudo systemctl restart php8.3-fpm.service
sudo systemctl restart apache2.service
systemctl status php8.3-fpm.service
systemctl status apache2.service
active (running)
と表示されていれば正常です。
最後に、Webブラウザで https://【設定したドメイン】
にアクセスし、画面の指示に従ってNextcloudの初期設定を完了させます。
nextcloud
nextcloud
localhost
(または localhost:3306
)これで、PHP-FPM上で動作するNextcloud環境の構築が完了します。
Growiの表示フォントを、サーバー内に配置したカスタムフォント(kiloji)に変更するメモを記します。
BookStackと同じような方法でいけるかと思いましたが、Apacheの追加設定が必要でした。
root
Webブラウザからアクセスできる公開ディレクトリに、使用したいフォントファイルを設置します。上記リンク先に示した「kiloji」を使います。
cd /path/to/growi/packages/preset-themes/public
/path/to/growi
は自分の環境に合わせます。(筆者環境/home/www-data/growi
)
sudo mkdir -p ./fonts/kiloji
上記ディレクトリ(筆者例では/home/www-data/growi/fonts/kiloji
)
にフォント一式を格納します。
この設定がハマった部分です。というのも、Growiの使用上、
https://【growi】/fonts/kiloji.wof
などにアクセスしても、アプリはURLとして解釈してしまうからです。
そのため、リバースプロキシで運用しているApacheのconfファイル/etc/apache2/sites-available/growi.conf
などの修正を行います。
sudo cp -pi /etc/apache2/sites-available/growi.conf /path/to/backup/directory/growi.conf.$(date +%Y%m%d)
diff -u /path/to/backup/directory/growi.conf.$(date +%Y%m%d) /etc/apache2/sites-available/growi.conf
→ 差分がなければ(エラーが表示されなければ)バックアップ成功です。
※編集前
FileETag None
<FilesMatch "\.(js|css|png|jpg|gif|svg|woff2?)$">
Header set Cache-Control "public, max-age=31536000, immutable"
</FilesMatch>
# リバースプロキシー設定
RewriteEngine on
RewriteCond %{HTTP:Upgrade} websocket [NC]
RewriteRule /(.*) ws://localhost:3000/$1 [P,L]
ProxyPass / http://localhost:3000/
ProxyPassReverse / http://localhost:3000/
※編集後
これは、リバーズプロキシ設定の直情に記載します。
# (1) 静的ファイル(フォントなど)のキャッシュ設定
FileETag None
<FilesMatch "\.(js|css|png|jpg|gif|svg|woff2?)$">
Header set Cache-Control "public, max-age=31536000, immutable"
</FilesMatch>
# (2) /fonts/ ディレクトリの場所をApacheに教える【重要:この部分を追加してください】
Alias "/fonts/" "/home/www-data/growi/packages/preset-themes/public/fonts/"
<Directory "/home/www-data/growi/packages/preset-themes/public/fonts/">
Require all granted
</Directory>
# (3) /fonts/ へのアクセスはプロキシの対象から除外する
ProxyPass "/fonts/" "!"
※差分(以下のコマンドを発行して差分を確認)
-FileETag None
-
+# (1) 静的ファイル(フォントなど)のキャッシュ設定
+FileETag None
<FilesMatch "\.(js|css|png|jpg|gif|svg|woff2?)$">
Header set Cache-Control "public, max-age=31536000, immutable"
</FilesMatch>
+
+# (2) /fonts/ ディレクトリの場所をApacheに教える【重要:この部分を追加してください】
+Alias "/fonts/" "/home/www-data/growi/packages/preset-themes/public/fonts/"
+<Directory "/home/www-data/growi/packages/preset-themes/public/fonts/">
+ Require all granted
+</Directory>
+
+
+# (3) /fonts/ へのアクセスはプロキシの対象から除外する
+ProxyPass "/fonts/" "!"
+
# リバースプロキシー設定
RewriteEngine on
RewriteCond %{HTTP:Upgrade} websocket [NC]
diff -u /path/to/backup/directory/growi.conf.$(date +%Y%m%d) /etc/apache2/sites-available/growi.conf
sudo apache2ctl configtest
Syntax OKを確認します。
sudo systemctl restart apache2.service
systemctl status apache2.service
active (running)
を確認します。
/* --- フォントの定義 --- */ @font-face { font-family: 'kiloji'; font-style: normal; font-weight: normal; src: url('/fonts/kiloji/kiloji.woff2') format('woff2'), url('/fonts/kiloji/kiloji.woff') format('woff'), url('/fonts/kiloji/kiloji.ttf') format('truetype'); } @font-face { font-family: 'kiloji'; font-style: normal; font-weight: bold; src: url('/fonts/kiloji/kiloji_b.woff2') format('woff2'), url('/fonts/kiloji/kiloji_b.woff') format('woff'), url('/fonts/kiloji/kiloji_b.ttf') format('truetype'); } /* --- フォントの適用 (アイコンを壊さない修正版) --- */ body, .growi, .page-main, .wiki, .sidebar-content, h1, h2, h3, h4, h5, h6, p, li, .btn, a, input, textarea { font-family: 'kiloji', sans-serif !important; } /* 基本の文字サイズを改めて指定 */ body { font-size: 16px; }
Ctrl + Shift + R
)し、フォントが変わっていることを確認できれば作業完了です。今回、この手順がうまくいったのはひとえに「Apacheによるリバースプロキシ化」でした。
http://【growiサイト】:3000
のように、直接(Growiのような)nodeアプリに接続していたら、フォントファイルを透過させるかのようにアクセスさせることは難しかったでしょう。
Powered by WordPress & Theme by Anders Norén