建岛教程初版

域名购买和VPS购买略,参考网络教程(切勿使用中国服务商)
域名解析托管CDN推荐cloudflare

【ubuntu+nginx+mysql+php+vichan】
apt update
【nginx】
apt install nginx
systemctl enable nginx
systemctl start nginx
【mysql】
apt install mariadb-server
systemctl enable mariadb
systemctl start mariadb
mysql_secure_installation
【php】(注意检查php运行情况)
apt install php-bcmath php-cli php-common php-curl php-fpm php-gd php-json php-mbstring php-mysql php-opcache php-pdo php-readline php-xml
systemctl enable php7.3-fpm
systemctl start php7.3-fpm
nano /etc/nginx/conf.d/testchan.conf

server {
    listen 80;
    listen [::]:80;
    server_name 域名;
    root   /var/www/html/testchan/;
    index  index.html index.htm index.php;
    location ~ .php$ {
        fastcgi_pass    unix:/run/php/php7.3-fpm.sock;
        fastcgi_param   SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include         fastcgi_params;
    }
}

nginx -t
systemctl restart nginx
【mysql】
mysql -u root
CREATE DATABASE 数据库名称;
CREATE USER 数据库用户@localhost;
SET PASSWORD FOR 数据库用户@localhost= PASSWORD("数据库密码");
GRANT ALL PRIVILEGES ON 数据库名称.* TO 数据库用户@localhost IDENTIFIED BY "数据库密码";
FLUSH PRIVILEGES;
exit
【git】
apt install git
cd /var/www/html/
git clone https://github.com/vichan-devel/vichan.git
mkdir vichan/templates/cache
chmod ugo+w vichan/ vichan/templates/cache/ vichan/tmp/cache/ vichan/inc/ vichan/inc/instance-config.php
mv vichan testchan
【安装】
浏览器打开[ip]/install.php
浏览器打开[ip]/mod.php
【https】
apt install socat
curl https://get.acme.sh | sh
acme.sh --issue -d 域名 --nginx
acme.sh --install-cert -d 域名 --cert-file /etc/nginx/cert/域名/cert.pem --key-file /etc/nginx/cert/域名/key.pem --fullchain-file /etc/nginx/cert/域名/fullchain.pem --reloadcmd "service nginx force-reload"
【备份】
mysqldump -u root 数据库名称 > 数据库名称.sql
tar czvf testchan.tgz testchan
【还原】
mysql -u root 数据库名称 < 数据库名称.sql
tar xzvf testchan.tgz

【Tor】
sudo apt install tor
echo -e "HiddenServiceDir /var/lib/tor/hidden_service/nHiddenServicePort 80 127.0.0.1:5000" | sudo tee -a /etc/tor/torrc
nano /etc/nginx/conf.d/testchan-tor.conf

1
2
3
4
5
6
server {
    listen 127.0.0.1:5000;
    listen [::1]:5000;
    server_name 洋葱域名;
......
}

systemctl start tor
sudo cat /var/lib/tor/hidden_service/hostname

Edit
Pub: 20 Oct 2024 07:46 UTC
Views: 87