mkdir -p /var/www
git clone [email protected]:liupangzi/liuchao.me.git /var/www/liuchao.me
git clone [email protected]:liupangzi/vps-config.git /root/vps-config
chown -R www-data:www-data /var/www/*
ln -s /root/vps-config/os/dotgitconfig /root/.gitconfig
apt install -y default-mysql-server
mysql_secure_installation
> root / root
systemctl restart mariadb
systemctl status mariadb
apt update && sudo apt upgrade
apt install -y curl apt-transport-https
curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo gpg --dearmor -o /usr/share/keyrings/postgresql-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/postgresql-keyring.gpg] http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg main" | sudo tee /etc/apt/sources.list.d/postgresql.list
apt update
apt install -y postgresql-14
systemctl restart postgresql
systemctl status postgresql
apt -y install lsb-release apt-transport-https ca-certificates wget
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/php.list
apt update && apt upgrade -y
apt install -y php7.4-xml php7.4-mbstring php7.4-zip php7.4-mysql php7.4 php7.4-opcache php7.4-curl php7.4-bz2 php7.4-cgi php7.4-cli php7.4-fpm php7.4-gmp php7.4-common php7.4-bcmath php7.4-gd php7.4-intl php-imagick
update-alternatives --set php /usr/bin/php7.4
- Edit
/etc/php/7.4/fpm/pool.d/www.conf
to change PHP-FPM from listening on unix socket to listening on TCP/IP port:
- listen = /run/php/php7.4-fpm.sock
+ listen = 127.0.0.1:9000
systemctl restart php7.4-fpm
systemctl status php7.4-fpm
apt update
apt install -y redis-server
- Update
/etc/redis/redis.conf
:
bind 127.0.0.1 ::1
systemctl restart redis
systemctl status redis
cd /etc/nginx
mv nginx.conf nginx.conf.back && ln -s /root/vps-config/nginx/conf/nginx.conf nginx.conf
ln -s /root/vps-config/nginx/conf/servers servers
systemctl restart nginx
systemctl status nginx
Tiny Tiny RSS
# crontab:
sudo -u www-data /usr/bin/php /var/www/liuchao.me/rss/update.php --feeds