Coder Social home page Coder Social logo

vps-config's Introduction

Checkout code && config

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/*

OS

ln -s /root/vps-config/os/dotgitconfig /root/.gitconfig

MySQL

  • Install MySQL server:
apt install -y default-mysql-server
mysql_secure_installation
> root / root
systemctl restart mariadb
systemctl status mariadb

PostgreSQL

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

PHP

  • Install PHP 7.4
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
  • Start PHP-FPM
systemctl restart php7.4-fpm
systemctl status php7.4-fpm

Redis

  • Install Redis
apt update
apt install -y redis-server
  • Update /etc/redis/redis.conf:
bind 127.0.0.1 ::1
  • Restart Redis:
systemctl restart redis
systemctl status redis

Nginx

  • Install Nginx
apt install -y nginx
  • Update conf
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
  • Restart Nginx:
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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.