Базовые настройки операционной системы Debian |
1 | apt update apt upgrade apt install vim git curl wget ufw ntp nginx mysql-server mysql-client unattended-upgrades postfix prometheus borgbackup zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-agent elasticsearch logstash kibana adduser DEBIAN_USER usermod -aG DEBIAN_USER dpkg-reconfigure tzdata ufw allow OpenSSH ufw enable sed -i 's#?Port .*Port 23g' etcsshsshd_config sed -i 's#?PasswordAuthentication .*PasswordAuthentication nog' etcsshsshd_config sed -i 's#?worker_connections .*worker_connections 1024;g' etcnginxnginx.conf sed -i 's#?gzip .*gzip on;g' etcnginxnginx.conf sed -i 'http {a fastcgi_cache_path varcachenginx levels=1:2 keys_zone=WORDPRESS:100m inactive=60m;' etcnginxnginx.conf systemctl enable nginx systemctl start nginx dpkg-reconfigure --priority=low unattended-upgrades sed -i 's#?myhostname = .*myhostname = mail.fqdn.testg' etcpostfixmain.cf systemctl enable postfix systemctl start postfix sed -i 's#?targets: .*targets: 'server.fqdn.test:9090'g' etcprometheusprometheus.yml systemctl enable prometheus systemctl start prometheus export BORG_PASSPHRASE='mypass' borg create --stats my_storage::backup-{now:%Y-%m-%d} mystoragepath sed -i 's#?network.host: .*network.host: 24g' etcelasticsearchelasticsearch.yml sed -i 's#?cluster.name: .*cluster.name: cluster_nameg' etcelasticsearchelasticsearch.yml systemctl enable elasticsearch systemctl start elasticsearch sed -i 's#?port => .*port => 5140g' etclogstashconf.dyour_config.conf systemctl enable logstash systemctl start logstash sed -i 's#?server.port: .*server.port: 5601g' etckibanakibana.yml sed -i 's#?elasticsearch.username: .*elasticsearch.username: "kibana"g' etckibanakibana.yml systemctl enable kibana systemctl start kibana sed -i 's#?innodb_log_buffer_size = .*innodb_log_buffer_size = 32Mg' etcmysqlmysql.conf.dmysqld.cnf sed -i 's#?sort_buffer_size = .*sort_buffer_size = 2Mg' etcmysqlmysql.conf.dmysqld.cnf systemctl enable mysql systemctl start mysql sed -i 's#?DBHost=localhostDBHost=hostname1g' etczabbixzabbix_server.conf sed -i 's#?DBName=zabbixDBName=database1g' etczabbixzabbix_server.conf sed -i 's#?DBUser=zabbixDBUser=DBuser1g' etczabbixzabbix_server.conf sed -i 's#?DBPassword=DBPassword=password1g' etczabbixzabbix_server.conf sed -i 's#?Server=127.0.0.1Server=hostname_zabbix_srvg' etczabbixzabbix_agentd.conf sed -i 's#?ServerActive=127.0.0.1ServerActive=hostname_zabbix_srvg' etczabbixzabbix_agentd.conf. |
Комментарии