106 lines
2.5 KiB
Plaintext
106 lines
2.5 KiB
Plaintext
|
||
===========无脑按顺序执行===============
|
||
|
||
安装环境先 https://nextpanel.dev/docs/installation/debian
|
||
|
||
mkdir /var/www/.ssh
|
||
chown -R www-data:www-data /var/www/.ssh
|
||
chmod 700 /var/www/.ssh
|
||
chmod 600 /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 755 *
|
||
chown -R www-data:www-data *
|
||
|
||
mkdir github
|
||
|
||
chmod -R 777 github
|
||
|
||
just里取出env,配置一下(github,hotshotgg)
|
||
|
||
/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__rand 1
|
||
到SSH config updated successfully.
|
||
到git push -u origin main错误,就基本ok了,到linux上提交确认kownhost
|
||
|
||
sudo -u www-data git add .
|
||
sudo -u www-data git push -u origin main
|
||
提交成功就ok,通了
|
||
|
||
最后挂上cron:* * * * * curl -s https://github-2.diaodu.us/cron > /dev/null
|
||
别忘了把inday_count调到正常
|
||
|
||
==========安装证书流程==============
|
||
|
||
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;
|
||
}
|
||
}
|
||
|
||
=========杂货===========
|
||
|
||
git config --global --add safe.directory /www/wwwroot/github-2.diaodu.us
|
||
|
||
可一次运行可能需要777权限
|