25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 
 
 

27 satır
808 B

  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