1018 字
5 分钟
Ubuntu 部署 EVE SeAT
SeAT
Waiting for api.github.com...
官方提供了两种部署方式:Docker 和 Manual,这里主要介绍 Manual 部署方法
手动安装 5.x 版本 | Manual Installation (5.x)
推荐系统版本是 Ubuntu 22.04,其他版本安装 PHP 会比较麻烦。
推荐 LTS 通过 su 进入切换到 root 用户。
准备工作
Operating System
apt-get updateapt-get full-upgraderebootapt-get autoremoveDatabase
安装 mariabd:
apt-get install curlcurl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | bashapt-get install mariadb-serversystemctl enable mariadb.service确保数据库安全运行(需要一路 yes 下去):
mariadb-secure-installation进入数据库:
mariadb -uroot -p创建数据库和账户:
create database seat;GRANT ALL ON seat.* to seat@localhost IDENTIFIED BY 's_p3rs3c3r3tp455w0rd';FLUSH PRIVILEGES;PHP
IMPORTANT必须是 Ubuntu 22.04 !!! Jammy!!!
echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu jammy main" >> /etc/apt/sources.list.d/php.listecho "deb-src http://ppa.launchpad.net/ondrej/php/ubuntu jammy main" >> /etc/apt/sources.list.d/php.listapt-key adv --recv-keys --keyserver keyserver.ubuntu.com 4F4EA0AAE5267A6Capt-get updateapt-get install libpng-dev libfreetype6-dev libjpeg-devapt-get install openssl zip php8.2-bz2 php8.2-cli php8.2-curl php8.2-dom php8.2-gd php8.2-gmp php8.2-intl php8.2-mbstring php8.2-mysql php8.2-opcache php8.2-redis php8.2-zipIMPORTANT如果有其他版本的 PHP 记得清理干净
Redis
apt-get install redis-serversystemctl enable redis-server.service安装 SeAT
下载 SeAT
apt-get install gitcurl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer && hash -rmkdir -p /var/wwwcd /var/wwwIMPORTANT如果是国内的服务器由于墙的问题,很难直接完成安装,建议通过镜像源进行安装
# 配置中国镜像composer config -g repo.packagist composer https://packagist.phpcomposer.com# 阿里云composer config -g repo.packagist composer https://mirrors.cloud.tencent.com/composer/# 腾讯composer config -g repo.packagist composer https://mirrors.cloud.tencent.com/composer/# 华为composer config -g repo.packagist composer https://repo.huaweicloud.com/repository/php/# 解除镜像composer config -g --unset repos.packagist# 搜索镜像源中是否有 SeATcomposer search eveseat/seatNOTE这里建议在使用镜像安装完后,删除镜像,然后使用
composer require package_name把几个关键包更新一下
正常进入安装:
composer create-project eveseat/seat:5.0 --no-dev --no-interactionchown -R www-data:www-data /var/www/seatchmod -R guo+w /var/www/seat/storage/配置 SeAT
vim /var/www/seat/.env 编辑数据库相关配置:
DB_CONNECTION=mysqlDB_HOST=127.0.0.1DB_PORT=3306DB_DATABASE=seatDB_USERNAME=seatDB_PASSWORD=s_p3rs3c3r3tp455w0rd # <-- this is the value you probably need to edit.DB_DEBUG=false数据库迁移:
sudo -H -u www-data bash -c 'php /var/www/seat/artisan vendor:publish --force --all'sudo -H -u www-data bash -c 'php /var/www/seat/artisan migrate'sudo -H -u www-data bash -c 'php /var/www/seat/artisan db:seed --class=Seat\\Services\\Database\\Seeders\\PluginDatabaseSeeder'EVE Sde 更新:
sudo -H -u www-data bash -c 'php /var/www/seat/artisan eve:update:sde'Supervisor
apt-get install supervisorcat > /etc/supervisor/conf.d/seat.conf << EOL[program:seat]command=/usr/bin/php /var/www/seat/artisan horizonprocess_name = %(program_name)s-80%(process_num)02dstdout_logfile = /var/log/seat-80%(process_num)02d.logstdout_logfile_maxbytes=100MBstdout_logfile_backups=10numprocs=1directory=/var/www/seatstopwaitsecs=600user=www-dataEOLsystemctl enable supervisor.serviceCrontab
echo '* * * * * php /var/www/seat/artisan schedule:run >> /dev/null 2>&1' > /tmp/seat-crontab.tmpcrontab -u www-data /tmp/seat-crontab.tmpWeb Server
apt-get install nginx php8.2-fpmcat > /etc/nginx/sites-available/seat << EOLserver {
listen 80; listen [::]:80;
# If you are hosting this instance on a domain, set that # name here. #server_name seat.yourdomain.com;
# SeAT public directory. This is the only directory that # should be exposed by the webserver. If one has to expose # the parent directory then things like the .env file will # be available for anyone to download. root /var/www/seat/public;
index index.php;
location / { try_files \$uri \$uri/ /index.php?\$query_string; }
# PHP-FPM configuration. location ~ \.php\$ { try_files \$uri /index.php =404; fastcgi_pass unix:/run/php/php8.2-fpm.sock; fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name; include fastcgi_params; }
# Even though .htaccess rules mean nothing in the nginx # world, prevent those from being downloaded anyways. location ~ /\.ht { deny all; }
# In case someone messes up, prevent .env files from # being downloaded as well. location ~ /\.env { deny all; }}EOLln -s /etc/nginx/sites-available/seat /etc/nginx/sites-enabled/seatrm /etc/nginx/sites-enabled/defaultsystemctl restart nginx.servicesystemctl restart php8.2-fpm.service到这一步就能通过浏览器直接访问 127.0.0.1 了。
ESI 配置
vim /var/www/seat/.env 修改 seat 配置文件:
EVE_CLIENT_ID=nullEVE_CLIENT_SECRET=nullEVE_CALLBACK_URL=https://seat.yourdomain.com/auth/eve/callbackSSl 配置
vim /var/www/seat/.env 修改 seat 配置文件:
APP_URL=https://seat.yourdomain.comEVE_CALLBACK_URL=https://seat.yourdomain.com/auth/eve/callbacknginx 服务器配置参考:
server {
listen 443 ssl; listen [::]:443 ssl;
ssl_certificate /path/xxx.crt; ssl_certificate_key /path/xxx.key;
# If you are hosting this instance on a domain, set that # name here. server_name seat.yourdomain.com;
# SeAT public directory. This is the only directory that # should be exposed by the webserver. If one has to expose # the parent directory then things like the .env file will # be available for anyone to download. root /var/www/seat/public;
index index.php;
location / { try_files $uri $uri/ /index.php?$query_string; }
# PHP-FPM configuration. location ~ \.php$ { try_files $uri /index.php =404; fastcgi_pass unix:/run/php/php8.2-fpm.sock; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; }
# Even though .htaccess rules mean nothing in the nginx # world, prevent those from being downloaded anyways. location ~ /\.ht { deny all; }
# In case someone messes up, prevent .env files from # being downloaded as well. location ~ /\.env { deny all; }}常见问题
能正常登录和授权,但仪表盘或角色界面空白
该问题的特征包括:
- 仪表盘空白,不显示服务器人数、ESI响应时间等
- 角色界面空白,不显示技能队列、资产等
类似的问题:
解决方法:
php artisan seat:cache:clear清理缓存reboot重启
再清理缓冲或者重启后可能也无法第一时间看到内容,建议通过添加一个新角色来尝试强制刷新。
Ubuntu 部署 EVE SeAT
https://fuwari.vercel.app/posts/建站/ubuntu-部署-eve-seat/