1
0
ubuntu.22.04/memories
2025-04-03 14:28:55 +03:00

121 lines
4.5 KiB
Plaintext

install "minimized server"
*** after install: ***
# sudo -s
*** on proxmox ***
# apt-get install -y qemu-guest-agent && systemctl start qemu-guest-agent && systemctl enable qemu-guest-agent
# apt-get -y update && apt-get -y upgrade
# apt install -y mc net-tools iputils-ping inetutils-traceroute htop ca-certificates apt-utils aptitude locales git iproute2
### https://dondub.com/2021/07/udalenie-cloud-init-iz-ubuntu-server-21-04/
# sed -i -e 's/datasource_list:/# datasource_list:/g' /etc/cloud/cloud.cfg.d/90_dpkg.cfg
# echo "datasource_list: [ None ]" >> /etc/cloud/cloud.cfg.d/90_dpkg.cfg
# dpkg-reconfigure cloud-init
# apt purge -y cloud-init && rm -rf /etc/cloud/ && rm -rf /var/lib/cloud/
# shutdown -r now
# apt-get -y remove unattended-upgrades && systemctl stop apt-daily.timer && systemctl disable apt-daily.timer && systemctl stop apt-daily-upgrade.timer && systemctl disable apt-daily-upgrade.timer && systemctl disable apt-daily.service && systemctl daemon-reload
# sed -i -e 's/APT::Periodic::Update-Package-Lists "1";/APT::Periodic::Update-Package-Lists "0";/g' /etc/apt/apt.conf.d/20auto-upgrades
# sed -i -e 's/APT::Periodic::Unattended-Upgrade "1";/APT::Periodic::Unattended-Upgrade "0";/g' /etc/apt/apt.conf.d/20auto-upgrades
# snap remove --purge snapd && apt-get -y remove snapd && apt-get -y autoremove
# apt install -y netplan.io isc-dhcp-client isc-dhcp-common mc net-tools iputils-ping inetutils-traceroute htop ca-certificates apt-utils aptitude locales git squashfs-tools tzdata fdisk gdisk
### ? systemctl disable snapd.service && systemctl disable snapd.socket && systemctl disable snapd.seeded.service && systemctl mask snapd.service && rm -rf /var/cache/snapd/ && apt autoremove --purge snapd -y && rm -rf ~/snap
# aptitude install console-cyrillic
# dpkg-reconfigure locales
select [392] ru_RU.UTF-8 UTF-8
# shutdown -r now
# rm /etc/netplan/50-cloud-init.yaml
# touch /etc/netplan/10-netplan-config.yaml
# echo "# This is the network config written by 'subiquity'
network:
version: 2
ethernets:
[NET_DEVICE_ID]:
dhcp4: no
addresses:
- [IP]/24
nameservers:
addresses: [IP_NAMESERVER]
routes:
- to: default
via: [IP_GATEWAY]
" >> /etc/netplan/10-netplan-config.yaml
# chmod 600 /etc/netplan/10-netplan-config.yaml
# netplan try
# netplan apply
# systemctl restart systemd-networkd
# shutdown -r now
# sudo su -
*** HESTIACP 1.9.3 ***
# wget https://raw.githubusercontent.com/hestiacp/hestiacp/release/install/hst-install.sh
# bash hst-install.sh --lang 'ru' --hostname '[HOSTNAME]' --username '[USERNAME]' --email '[EMAIL]' --password '[PASSWORD]' --multiphp '8.2' --named no --postgresql yes --dovecot no --clamav no --spamassassin no
# reboot
*** login as 'root'
# usermod -aG sudo admin
# apt-get install -y memcached php-memcached php8.2-memcached
# v-change-user-package admin default
# v-change-user-shell admin bash
# v-add-database admin rfclass_pg rfclass_pg [DB_PASSWORD] pgsql localhost
# v-add-database admin eis_pg eis_pg [DB_PASSWORD] pgsql localhost
# v-add-domain admin [DOMAIN]
*** relogin as 'admin'
# cd /home/admin/web/[DOMAIN]/public_html/
# rm /home/admin/web/[DOMAIN]/public_html/index.html
# rm /home/admin/web/[DOMAIN]/public_html/robots.txt
# git clone https://git.kosenka.ru/kosenka/[DOMAIN].git .
# php composer.phar install
# sudo su -
# v-change-web-domain-docroot admin [DOMAIN] [DOMAIN] /web
# exit
*** install odbc-driver
** Add the signature to trust the Microsoft repo
** For Ubuntu versions < 24.04
# curl https://packages.microsoft.com/keys/microsoft.asc | sudo tee /etc/apt/trusted.gpg.d/microsoft.asc
** For Ubuntu versions >= 24.04
** curl https://packages.microsoft.com/keys/microsoft.asc | sudo gpg --dearmor -o /usr/share/keyrings/microsoft-prod.gpg
** Add repo to apt sources
curl https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/prod.list | sudo tee /etc/apt/sources.list.d/mssql-release.list
** Install the driver
# sudo apt-get update
# sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18
** optional: for bcp and sqlcmd
# sudo ACCEPT_EULA=Y apt-get install -y mssql-tools18
# echo 'export PATH="$PATH:/opt/mssql-tools18/bin"' >> ~/.bashrc
# source ~/.bashrc
** optional: for unixODBC development headers
sudo apt-get install -y unixodbc-dev
# apt-get install -y php8.2-odbc
*** copy archive ***
*** restore database: admin_rfclass_pg
# grep -Eo "PASSWORD='[a-zA-Z0-9]+'" /usr/local/hestia/conf/pgsql.conf | awk -F "PASSWORD=" '{print $2}' | awk -F "'" '{print $2}'
# exit
# cd /home/admin/web/[SITE]/public_html
# php composer.phar install