CREATE DATABASE piwigo CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'piwigo_user'@'localhost' IDENTIFIED BY 'パスワード';
/* パスワードは任意のものを設定します */
GRANT ALL ON piwigo.* TO 'piwigo_user'@'localhost';
GRANT RELOAD ON *.* TO 'piwigo_user'@'localhost';
/* 後の運用を考えて、dumpが取得できるようにします */
FLUSH PRIVILEGES;
EXIT;
apache設定
バーチャルファイル作成
ServerName
ドメイン
格納場所(ログ含む)
SSL証明書及び秘密鍵格納位置
は自分の環境に合わせてください。
cat <<- __EOF__ | sudo tee -a /etc/apache2/sites-available/piwigo.conf
<VirtualHost _default_:80>
ServerName album.example.com
# 公開するサーバのドメイン名を指定
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</VirtualHost>
<VirtualHost *:443>
ServerName album.example.com
CustomLog /var/log/apache2/piwigo_access.log combined
ErrorLog /var/log/apache2/piwigo_error.log
# ログの格納先を指定を指定
DocumentRoot /var/www/html/piwigo
<Directory /var/www/html/piwigo>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
# DocumentRootは実際に配置したディレクトリを指定
SSLEngine on
Protocols h2 http/1.1
Header always set Strict-Transport-Security "max-age=63072000"
SSLCertificateFile /etc/certs/example.com.crt
SSLCertificateKeyFile /etc/private/example.com.key
# 証明書と秘密鍵のパスを指定
</VirtualHost>
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 off
SSLSessionTickets off
SSLUseStapling On
SSLStaplingCache "shmcb:logs/ssl_stapling(32768)"
__EOF__
バーチャルファイル有効化
sudo a2ensite piwigo.conf
設定反映
sudo apache2ctl configtest
# Syntax OKを確認します
sudo systemctl restart apache2.service
systemctl status apache2.service
# active (running)を確認します
sudo freshclam
ERROR: /var/log/clamav/freshclam.log is locked by another process
ERROR: Problem with internal logger (UpdateLogFile = /var/log/clamav/freshclam.log).
ERROR: initialize: libfreshclam init failed.
ERROR: Initialization error!
対処を行います。
sudo lsof /var/log/clamav/freshclam.log
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
freshclam 7001 clamav 3wW REG 202,1 2161 2319263 /var/log/clamav/freshclam.log
# この時に出てきたPIDを控えておきます。
このプロセスを停止します。
sudo kill -9 7001
# 出てきたPIDを指定します
ログファイルのパーミッション変更
sudo chmod -R 777 /var/log/clamav/
上記を実施後、
sudo freshclam
定義ファイルが更新されることを確認しました。
ウイルス定義ファイル自動更新
sudo systemctl start clamav-freshclam.service
sudo systemctl enable clamav-freshclam.service
systemctl status clamav-freshclam.service
# active (running)を確認します
ClamAVの動作確認
バージョン確認
clamscan --version
ClamAV 0.103.8/26829/Thu Mar 2 20:16:49 2023
# 2023/03/03、aptでインストールした際のバージョン
eicarテストファイルによる確認
cd ~
wget http://www.eicar.org/download/eicar.com
clamscan eicar.com
テスト結果
Win.Test.EICAR_HDB-1 FOUND
----------- SCAN SUMMARY -----------
Known viruses: 8654357
Engine version: 0.103.8
Scanned directories: 0
Scanned files: 1
Infected files: 1
Data scanned: 0.00 MB
Data read: 0.00 MB (ratio 0.00:1)
sequenceDiagram
participant b as バックアップ
participant p as パスワード生成
note over b: 処理実行
note over b: 作業ディレクトリ<br>作成
note over b: MySQL dump
b->>p: スクリプト呼び出し
note over p: 処理実行
note over p: PW発行
note over p: PWファイル作成
p-->>b: スクリプト実行完了
note over b,p: PWファイルを元に暗号化
note over b: 作業ディレクトリ<br>削除
note over b: 古いバックアップ削除
note over b,p: 古いPWファイルを削除
note over b: 処理完了
As reported in issue #12, the plugin "mega_calendar" ist not compatible with this plugin due to an issue with the provided users_controller_path.rb file.
Internal Error An error occured on the page you were trying to access. If you continue to experience problems please contact your Redmine administrator for assistance. If you are the Redmine administrator, check your log files for details about the error.