You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

пре 5 година
пре 5 година
пре 5 година
пре 5 година
пре 5 година
123456789101112131415161718192021222324252627
  1. #!/usr/bin/env bash
  2. create_wildcard_certificate () {
  3. openssl req -x509 -newkey rsa:4096 -nodes -keyout ${1}.key -out ${1}.crt -days 365 -subj "/C=FR/ST=Gironde/L=Bordeaux/O=LessPass/OU=LessPass/CN=*.${1}"
  4. }
  5. if [[ ! -f /app/ssl/${FQDN}.crt || ! -f /app/ssl/${FQDN}.key ]]; then
  6. echo "${FQDN}.crt or ${FQDN}.key not found! Generate wildcard certificate"
  7. cd /app/ssl
  8. create_wildcard_certificate ${FQDN}
  9. fi
  10. mkdir -p /etc/httpd/ssl
  11. chmod 755 /etc/httpd/ssl
  12. cp /app/ssl/${FQDN}.crt /etc/httpd/ssl/
  13. chmod 644 /etc/httpd/ssl/${FQDN}.crt
  14. mkdir -p /etc/httpd/ssl/private
  15. chmod 710 /etc/httpd/ssl/private
  16. cp /app/ssl/${FQDN}.key /etc/httpd/ssl/private/
  17. chmod 640 /etc/httpd/ssl/private/${FQDN}.key
  18. python /app/generate_apache_conf.py
  19. cat /etc/httpd/conf.d/lesspass.conf
  20. exec /usr/sbin/httpd -D FOREGROUND