github/just/tom无脑流程.text
2025-07-06 16:55:43 +08:00

101 lines
2.1 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

===========无脑按顺序执行===============
安装环境先
mkdir /var/www/.ssh
sudo apt update
sudo apt install openssh-client
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
生成地址写 /var/www/.ssh/id_rsa_邮箱不要后缀
mkdir /www/wwwroot
cd /www/wwwroot
apt install git
git clone https://gitea.diaodu.us/tom/github
mv github github-x.diaodu.us
cd进去
chmod -R 777 # 第一遍需要777权限未必先不用他
chmod -R 755 * # 然后改成这个
chown -R www-data:www-data *
mkdir github
chmod -R 777 github
just里取出env配置一下githubhotshotgg
/etc/nginx/nginx.conf 用户改为www-data
CREATE DATABASE github CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'github'@'localhost';
GRANT ALL PRIVILEGES ON github.* TO 'github'@'localhost' IDENTIFIED BY 'hotshotgg';
FLUSH PRIVILEGES;
just里有sql导入
mysql -u -p github < github.sql
添加nginx域名配置.conf后缀别忘了
systemctl restart nginx
测试https://github-x.diaodu.us/test/hello
去tg上配置他
测试 /test#cron__i 11
==========执行结束==================
==========安装证书流程==============
sudo apt update
sudo apt install snapd
sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot
sudo certbot --nginx
==========安装证书流程结束=============
========nginx配置================
server {
listen 80;
listen [::]:80;
root /www/wwwroot/github-2.diaodu.us/public;
index index.php;
server_name github-2.diaodu.us;
location / {
try_files $uri /index.php$is_args$args;
}
location ~ \.php$ {
try_files $fastcgi_script_name =404;
include fastcgi_params;
fastcgi_index index.php;
fastcgi_buffers 8 16k;
fastcgi_buffer_size 32k;
fastcgi_pass unix:/run/php/php-fpm.sock;
fastcgi_param DOCUMENT_ROOT $realpath_root;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
}
}
========nginx配置结束=============