🤖

Ubuntu24.04にFirefly IIIをインストールする①

2024/05/29に公開

はじめに

社会人になりお金の管理のために家計簿ソフト的なものを探していたところオープンソースで良さげなものを見つけたのでインストールしてみた.
先駆者が少なそうなので備忘録として残しておく.
誰かの参考になれば幸いである.
間違っている可能性あります.

①インストール編

環境

OS : Ubuntu 24.04 LTS Proxmox上にVMとしてインストール
DB : PostgreSQL16
WebServer : Freenginx 1.26
PHP : version 8.3
Firefly III : 6.1.16

Ubuntu準備

いつもの
vimerなのでvimをいれる

apt update && apt upgrade
apt install -y vim

PHPインストール

PHPをインストールする.
コマンドは適宜sudoをつけるかrootで実行してほしい.
2024/05/29時点ではphpでphp8.3がインストールできた.

バージョン確認

apt update
apt info php

インストール

apt install -y php php-{bcmath,intl,curl,zip,gd,xml,mbstring,pgsql}
php -V

PostgreSQLインストール

リポジトリ登録

apt install -y postgresql-common
/usr/share/postgresql-common/pgdg/apt.postgresql.org.sh

バージョン確認

apt update
apt info postgresql

インストール

apt install -y postgresql

起動確認

systemctl status postgresql

Freenginxインストール

なぜか最初からapacheが動いていたので削除する.
nginxも削除する.

systemctl stop apache2.service
apt --purge remove apache2*
apt --purge remove nginx-*
apt autoremove

必要なパッケージを入れる

apt update
apt install -y wget build-essential libpcre3 libpcre3-dev zlib1g zlib1g-dev libssl-dev libgd-dev libxml2 libxml2-dev uuid-dev

作業ディレクトリへ移動
ソースをもってくる

mkdir workspace
cd workspace
wget https://freenginx.org/download/nginx-1.26.0.tar.gz

展開,移動

tar zxvf nginx-1.26.0.tar.gz
cd freenginx-1.26.0

コンフィグ作成

./configure --prefix=/var/www/html --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --with-pcre --lock-path=/var/lock/nginx.lock --pid-path=/var/run/nginx.pid --with-http_ssl_module --with-http_image_filter_module=dynamic --modules-path=/etc/nginx/modules --with-http_v2_module --with-stream=dynamic --with-http_addition_module --with-http_mp4_module

makeする

make
sudo make install

インストール確認

nginx -v

サービスファイル作成

vim /lib/systemd/system/nginx.service

サービスファイル

[Unit]
Description=The Freenginx HTTP and reverse proxy server
After=syslog.target network-online.target remote-fs.target nss-lookup.target
Wants=network-online.target
        
[Service]
Type=forking
PIDFile=/var/run/nginx.pid
ExecStartPre=/usr/sbin/nginx -t
ExecStart=/usr/sbin/nginx
ExecReload=/usr/sbin/nginx -s reload
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true
        
[Install]
WantedBy=multi-user.target

サービス登録,起動,確認

systemctl daemon-reload
systemctl start nginx
systemctl status nginx

②へ続く...

参考サイト

https://ubuntushell.com/install-freenginx/
https://docs.firefly-iii.org/how-to/firefly-iii/installation/self-managed/
https://manualmaton.com/2023/12/24/検証firefly-iii-v6-1-0をubuntu-20-04にインストール(失敗)/
https://gist.github.com/Engr-AllanG/34e77a08e1482284763fff429cdd92fa

Discussion