Skip to content

Latest commit

 

History

History
141 lines (113 loc) · 2.85 KB

README.md

File metadata and controls

141 lines (113 loc) · 2.85 KB

SRVR

TODO:

  • TLS users: (999:999)
  • File mon
  • LogRotate: nginx, exim, ...
  • CP if exists
  • rabbitmq init.sh
  • Docker: /etc/docker/daemon.json

Cron

# Edit this file to introduce tasks to be run by cron.

# Dev: phpcs phpcbf vscode
* * * * * ps -aux | grep phpcs | awk '{print $2}' | xargs kill
* * * * * ps -aux | grep phpcbf | awk '{print $2}' | xargs kill
30 7,12,18 * * * ps -aux | grep vscode | awk '{print $2}' | xargs kill

# Apps
0 10 * * * /usr/bin/docker start certbot -a > /opt/apps/certbot/log/cron.log
30 9 * * * /usr/bin/docker exec -i docker-proxy /usr/sbin/nginx -s reload > /opt/docker-proxy/reload-log.log

# Custom

Dokcer-images

Debian / Ubuntu

apt update && apt install git -y
cd /opt && git clone https://github.com/politsin/srvr
cd srvr
./init.sh

OrangePi Zero

Todo

https://askubuntu.com/questions/1472428/why-i-got-failed-to-allocate-directory-watch-too-many-open-files

sysctl fs.inotify
fs.inotify.max_queued_events = 16384
`fs.inotify.max_user_instances` = 128
fs.inotify.max_user_watches = 65536
  • sysctl fs.inotify
  • fs.inotify.max_user_instances = 128
  • sysctl -w fs.inotify.max_user_instances=256
  • sysctl -w fs.inotify.max_user_watches=256 sysctl -w fs.inotify.max_user_watches=6553699 sysctl -w fs.inotify.max_user_instances=1024

Exim Update

SET 4 APP

cd /opt/srvr
git pull
cat .env.local
docker stop exim
docker rm exim
mv /opt/apps/exim /opt/apps/exim-old
./console.php setapp
cd /opt/apps/exim
mv compose.yml docker-compose.yml
./start.sh
docker ps | grep exim

PHP-test

<?php
print "hello";
$to = "[email protected]";
$subject = "server test";
$message = "test psss";
$additional_headers = [];
$additional_params = "";
$mail = mail($to, $subject, $message);
print ">$mail<";

Docker-REST Update

  1. меняем nginx.conf
  2. выполняем команды
cd /opt/docker-rest
docker pull nginx:alpine
./start.sh

Debian update

debian.org - последняя версия 12 - bookworm

lsb_release -a
apt update
apt upgrade -y
# Keep the local version currently installed
nano /etc/apt/sources.list
cat /etc/apt/sources.list
apt update
apt upgrade --without-new-pkgs -y
# Restart services without asking
apt full-upgrade -y
apt --purge autoremove -y
lsb_release -a
cat /etc/debian_version