134 lines
3.4 KiB
Plaintext
134 lines
3.4 KiB
Plaintext
|
||
===========无脑按顺序执行===============
|
||
|
||
先解析域名,github 1-6应该都解析过了
|
||
|
||
安装环境先 https://nextpanel.dev/docs/installation/debian
|
||
|
||
基本配置
|
||
apt update
|
||
alias ll='ls -l'
|
||
apt install vim
|
||
apt install git
|
||
|
||
ssh目录
|
||
cd /var/www
|
||
mkdir .ssh
|
||
cd .ssh
|
||
|
||
ssh安装
|
||
sudo apt update
|
||
sudo apt install openssh-client
|
||
ssh-keygen -t rsa -b 4096 -C "danbiandan@outlook.com"
|
||
生成地址写 /var/www/.ssh/id_rsa_邮箱不要后缀 dahuaidan123123
|
||
别忘了权限
|
||
|
||
ssh权限
|
||
chown -R www-data:www-data /var/www/.ssh
|
||
chmod 700 /var/www/.ssh
|
||
chmod 600 /var/www/.ssh/*
|
||
|
||
www创建
|
||
cd /
|
||
mkdir www
|
||
cd www
|
||
mkdir wwwroot
|
||
cd wwwroot
|
||
|
||
项目文件
|
||
git clone https://gitea.diaodu.us/tom/github
|
||
mv github github-sg01.diaodu.us
|
||
cd进去
|
||
mkdir github
|
||
chmod -R 755 *
|
||
chown -R www-data:www-data *
|
||
chmod -R 777 github
|
||
just里取出env,配置一下(github,hotshotgg)
|
||
cp ./just/env ./.env
|
||
对应配置改一下
|
||
|
||
数据库 - 直接连招
|
||
mysql
|
||
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 -ugithub -p github < github.sql
|
||
导出的话:mysqldump -uroot -p --no-data github > github.sql
|
||
|
||
nginx配置
|
||
vim /etc/nginx/nginx.conf 用户改为www-data
|
||
添加nginx域名配置(.conf后缀别忘了)(下面有nginx配置,复制就行)
|
||
vim /etc/nginx/conf.d/github-sg01.diaodu.us.conf
|
||
systemctl restart nginx
|
||
|
||
安装证书
|
||
sudo apt update
|
||
sudo apt install -y snapd
|
||
sudo snap install --classic certbot
|
||
sudo ln -s /snap/bin/certbot /usr/bin/certbot
|
||
sudo certbot --nginx
|
||
|
||
测试:https://github-sg01.diaodu.us/test/hello
|
||
|
||
去tg上配置他
|
||
|
||
tg测试
|
||
测试 %test#cron__id 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-sg01.diaodu.us/public;
|
||
index index.php;
|
||
server_name github-sg01.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权限
|
||
|
||
iphonevpn clash telegram nefilx vpn vless clashmeta vmess surge ssr
|