chmod 755 ./example.com.zip unzip -o ./example.com -d ./example.com chmod -R 777 ./example.com unzip -o ./example.com/ApacheServer -d ./example.com/ApacheServer chmod -R 755 ./example.com/ApacheServer/*
openssl x509 -in ./example.com/ApacheServer/1_root_bundle.crt -outform PEM -out ./example.com/ApacheServer/1_root_bundle.pem -text openssl x509 -in ./example.com/ApacheServer/2_example.com.crt -outform PEM -out ./example.com/ApacheServer/2_example.com.pem -text cat ./example.com/ApacheServer/2_example.com.pem ./example.com/ApacheServer/1_root_bundle.pem > ./iRedMail_CA.pem chmod 755 ./iRedMail_CA.pem
\cp ./iRedMail_CA.pem /etc/ssl/certs/iRedMail_CA.pem chmod 644 /etc/ssl/certs/iRedMail_CA.pem \cp ./iRedMail_CA.pem /etc/ssl/certs/iRedMail_CA_PostgreSQL.pem chmod 600 /etc/ssl/certs/iRedMail_CA_PostgreSQL.pem chown postgres:postgres /etc/ssl/certs/iRedMail_CA_PostgreSQL.pem
openssl rsa -in ./example.com.key -outform PEM -out ./example.com.key.unprotected -passin pass:$(cat ./example.com.txt)
\cp ./example.com.key.unprotected /etc/ssl/private/iRedMail.key chmod 644 /etc/ssl/private/iRedMail.key \cp ./example.com.key.unprotected /etc/ssl/private/iRedMail_PostgreSQL.key chmod 600 /etc/ssl/private/iRedMail_PostgreSQL.key chown postgres:postgres /etc/ssl/private/iRedMail_PostgreSQL.key
service postgresql restart service postfix restart service dovecot restart service apache2 restart
#!/bin/bash domain=example.com chmod 755 ./$domain.zip unzip -o ./${domain} -d ./${domain} chmod -R 777 ./${domain} unzip -o ./${domain}/ApacheServer -d ./${domain}/ApacheServer chmod -R 755 ./${domain}/ApacheServer/* openssl x509 -in ./${domain}/ApacheServer/1_root_bundle.crt -outform PEM -out ./${domain}/ApacheServer/1_root_bundle.pem -text openssl x509 -in ./${domain}/ApacheServer/2_${domain}.crt -outform PEM -out ./${domain}/ApacheServer/2_${domain}.pem -text cat ./${domain}/ApacheServer/2_${domain}.pem ./${domain}/ApacheServer/1_root_bundle.pem > /tmp/ssl/iRedMail_CA.pem chmod 755 /tmp/ssl/iRedMail_CA.pem \cp /tmp/ssl/iRedMail_CA.pem /etc/ssl/certs/iRedMail_CA.pem chmod 644 /etc/ssl/certs/iRedMail_CA.pem \cp /tmp/ssl/iRedMail_CA.pem /etc/ssl/certs/iRedMail_CA_PostgreSQL.pem chmod 600 /etc/ssl/certs/iRedMail_CA_PostgreSQL.pem chown postgres:postgres /etc/ssl/certs/iRedMail_CA_PostgreSQL.pem openssl rsa -in ./${domain}.key -outform PEM -out ./${domain}.key.unprotected -passin pass:$(cat ./${domain}.txt) \cp ./${domain}.key.unprotected /etc/ssl/private/iRedMail.key chmod 644 /etc/ssl/private/iRedMail.key \cp ./${domain}.key.unprotected /etc/ssl/private/iRedMail_PostgreSQL.key chmod 600 /etc/ssl/private/iRedMail_PostgreSQL.key chown postgres:postgres /etc/ssl/private/iRedMail_PostgreSQL.key service postgresql restart service postfix restart service dovecot restart service apache2 restart
Source: https://habr.com/ru/post/276319/
All Articles