View | Details | Raw Unified | Return to bug 15303
Collapse All | Expand All

(-)a/debian/scripts/koha-create (+16 lines)
Lines 71-76 Options: Link Here
71
                            conjunction with --defaultsql and --populate-db.
71
                            conjunction with --defaultsql and --populate-db.
72
  --upload-path dir         Set a user defined upload_path. It defaults to
72
  --upload-path dir         Set a user defined upload_path. It defaults to
73
                            /var/lib/koha/<instance>/uploads
73
                            /var/lib/koha/<instance>/uploads
74
  --force-https             Set up a https-only site with letsencrypt certificates
74
  --help,-h                 Show this help.
75
  --help,-h                 Show this help.
75
76
76
Note: the instance name cannot be longer that 11 chars.
77
Note: the instance name cannot be longer that 11 chars.
Lines 419-424 while true ; do Link Here
419
            SRU_SERVER_PORT="$2" ; shift 2 ;;
420
            SRU_SERVER_PORT="$2" ; shift 2 ;;
420
        --upload-path)
421
        --upload-path)
421
            CLO_UPLOAD_PATH="$2" ; shift 2 ;;
422
            CLO_UPLOAD_PATH="$2" ; shift 2 ;;
423
        --force-https)
424
            USE_HTTPS="yes" ; shift ;;
422
        -h|--help)
425
        -h|--help)
423
            usage ; exit 0 ;;
426
            usage ; exit 0 ;;
424
        --)
427
        --)
Lines 708-713 then Link Here
708
        # Start Indexer daemon
711
        # Start Indexer daemon
709
        koha-indexer --start "$name"
712
        koha-indexer --start "$name"
710
    fi
713
    fi
714
715
    if [ "$USE_HTTPS" = "yes" ]; then
716
        # Get letsencrypt certificates
717
        # TODO: fix path of letsencrypt
718
        /path/to/letsencrypt-auto --agree-tos --renew-by-default --webroot --server https://acme-v01.api.letsencrypt.org/directory certonly -w /usr/share/koha/opac/htdocs/ -d $opacdomain -w /usr/share/koha/intranet/htdocs/ -d $intradomain
719
        # enable all ssl settings (apache won't start with these before certs are present)
720
        sed -i "s:^\s*#\(\s*SSL.*\)$:\1:" "/etc/apache2/sites-available/$name.conf"
721
        # change port from 80 to 443. (apache won't start if it is 443 without certs present)
722
        sed -i "s:^\s*\(<VirtualHost \*\:\)80> #ssl$:\1443>:" "/etc/apache2/sites-available/$name.conf"
723
        # TODO: enable forward from 80 to https
724
        # restart apache with working certs
725
        service apache2 restart
726
    fi
711
fi
727
fi
712
728
713
729
(-)a/debian/templates/apache-site-https.conf.in (-1 / +68 lines)
Line 0 Link Here
0
- 
1
# Koha instance __KOHASITE__ Apache config.
2
3
#<VirtualHost *:80> #nohttps
4
#  RewriteEngine On
5
#  RewriteCond %{HTTPS} !=on
6
#  RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
7
#</VirtualHost>
8
9
10
# OPAC
11
<VirtualHost *:80> #https
12
#  SSLEngine on
13
#  SSLProtocol +TLSv1.2 +TLSv1.1 +TLSv1
14
#  SSLCompression off
15
#  SSLHonorCipherOrder on
16
#  SSLCipherSuite "ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-SA-AES128-SHA256:ECDHE-RSA-AES256-SHA"
17
#  SSLCertificateKeyFile   /etc/letsencrypt/live/__OPACSERVER__/privkey.pem
18
#  SSLCertificateFile      /etc/letsencrypt/live/__OPACSERVER__/cert.pem
19
#  SSLCertificateChainFile /etc/letsencrypt/live/__OPACSERVER__/chain.pem
20
21
  <IfVersion >= 2.4>
22
   Define instance "__KOHASITE__"
23
  </IfVersion>
24
   Include /etc/koha/apache-shared.conf
25
#  Include /etc/koha/apache-shared-disable.conf
26
#  Include /etc/koha/apache-shared-opac-plack.conf
27
   Include /etc/koha/apache-shared-opac.conf
28
29
   ServerName __OPACSERVER__
30
   SetEnv KOHA_CONF "/etc/koha/sites/__KOHASITE__/koha-conf.xml"
31
   SetEnv MEMCACHED_SERVERS "__MEMCACHED_SERVERS__"
32
   SetEnv MEMCACHED_NAMESPACE "__MEMCACHED_NAMESPACE__"
33
   AssignUserID __UNIXUSER__ __UNIXGROUP__
34
35
   ErrorLog    /var/log/koha/__KOHASITE__/opac-error.log
36
#  TransferLog /var/log/koha/__KOHASITE__/opac-access.log
37
#  RewriteLog  /var/log/koha/__KOHASITE__/opac-rewrite.log
38
</VirtualHost>
39
40
# Intranet
41
<VirtualHost *:80> #https
42
#  SSLEngine on
43
#  SSLProtocol +TLSv1.2 +TLSv1.1 +TLSv1
44
#  SSLCompression off
45
#  SSLHonorCipherOrder on
46
#  SSLCipherSuite "ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA"
47
#  SSLCertificateKeyFile   /etc/letsencrypt/live/__OPACSERVER__/privkey.pem
48
#  SSLCertificateFile      /etc/letsencrypt/live/__OPACSERVER__/cert.pem
49
#  SSLCertificateChainFile /etc/letsencrypt/live/__OPACSERVER__/chain.pem
50
51
  <IfVersion >= 2.4>
52
   Define instance "__KOHASITE__"
53
  </IfVersion>
54
   Include /etc/koha/apache-shared.conf
55
#  Include /etc/koha/apache-shared-disable.conf
56
#  Include /etc/koha/apache-shared-intranet-plack.conf
57
   Include /etc/koha/apache-shared-intranet.conf
58
   
59
   ServerName __INTRASERVER__
60
   SetEnv KOHA_CONF "/etc/koha/sites/__KOHASITE__/koha-conf.xml"
61
   SetEnv MEMCACHED_SERVERS "__MEMCACHED_SERVERS__"
62
   SetEnv MEMCACHED_NAMESPACE "__MEMCACHED_NAMESPACE__"
63
   AssignUserID __UNIXUSER__ __UNIXGROUP__
64
65
   ErrorLog    /var/log/koha/__KOHASITE__/intranet-error.log
66
#  TransferLog /var/log/koha/__KOHASITE__/intranet-access.log
67
#  RewriteLog  /var/log/koha/__KOHASITE__/intranet-rewrite.log
68
</VirtualHost>

Return to bug 15303