参考资料

  1. Open Web Analytics (OWA)
  2. Firefly III 是一款开源的个人财务管理系统
  3. AWStats 是一款功能强大的免费工具
  4. Matomo 本地部署教程
  5. 免费商用网站流量统计系统

Firefly III 详细搭建说明

系统要求

  • PHP 7.4 或更高版本

  • MySQL 5.7 或更高版本/MariaDB 10.2 或更高版本

  • Web服务器(Apache/Nginx)

  • Composer

  • Git

安装步骤

1. 下载Firefly III

git clone https://github.com/firefly-iii/firefly-iii.git
cd firefly-iii

2. 安装依赖

composer install --no-dev --prefer-dist --no-scripts

3. 配置环境

复制.env.example文件为.env并编辑:

cp .env.example .env

修改以下关键配置:

APP_URL=http://your-domain.com
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=firefly
DB_USERNAME=firefly
DB_PASSWORD=your_password

4. 生成应用密钥

php artisan key:generate

5. 数据库迁移

php artisan migrate --seed

6. 设置权限

chown -R www-data:www-data storage
chmod -R 775 storage

7. 配置Web服务器

Nginx配置示例:

server {
    listen 80;
    server_name your-domain.com;
    root /path/to/firefly-iii/public;

    index index.php;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
    }
}

8. 设置定时任务

添加以下cron任务:

* * * * * cd /path/to/firefly-iii && php artisan schedule:run >> /dev/null 2>&1

9. 访问系统

在浏览器中访问配置的域名,使用默认凭据登录:

后续配置

  1. 登录后立即更改管理员密码

  2. 配置邮件设置以启用密码重置功能

  3. 设置定期任务自动导入交易数据

更新方法

git pull origin master
composer install --no-dev --prefer-dist
php artisan migrate