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

(-)a/debian/scripts/koha-create (-2 / +27 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 354-359 END_BIBLIOS_RETRIEVAL_INFO="" Link Here
354
START_AUTHORITIES_RETRIEVAL_INFO=""
355
START_AUTHORITIES_RETRIEVAL_INFO=""
355
END_AUTHORITIES_RETRIEVAL_INFO=""
356
END_AUTHORITIES_RETRIEVAL_INFO=""
356
357
358
APACHE_CONFIGFILE=""
359
LETSENCRYPT_PATH=""
360
357
if [ -e /etc/koha/koha-sites.conf ]
361
if [ -e /etc/koha/koha-sites.conf ]
358
then
362
then
359
    . /etc/koha/koha-sites.conf
363
    . /etc/koha/koha-sites.conf
Lines 378-384 CLO_MEMCACHED_SERVERS="" Link Here
378
CLO_MEMCACHED_PREFIX=""
382
CLO_MEMCACHED_PREFIX=""
379
CLO_UPLOAD_PATH=""
383
CLO_UPLOAD_PATH=""
380
384
381
382
while true ; do
385
while true ; do
383
    case "$1" in
386
    case "$1" in
384
        -c|--create-db)
387
        -c|--create-db)
Lines 419-424 while true ; do Link Here
419
            SRU_SERVER_PORT="$2" ; shift 2 ;;
422
            SRU_SERVER_PORT="$2" ; shift 2 ;;
420
        --upload-path)
423
        --upload-path)
421
            CLO_UPLOAD_PATH="$2" ; shift 2 ;;
424
            CLO_UPLOAD_PATH="$2" ; shift 2 ;;
425
        --force-https)
426
            USE_HTTPS="yes" ; shift ;;
427
        --letsencrypt)
428
           LETSENCRYPT_PATH="$2" ; shift 2 ;;
422
        -h|--help)
429
        -h|--help)
423
            usage ; exit 0 ;;
430
            usage ; exit 0 ;;
424
        --)
431
        --)
Lines 598-605 FLUSH PRIVILEGES; Link Here
598
eof
605
eof
599
    fi #`
606
    fi #`
600
607
608
    if [ "$USE_HTTPS" = "yes" ]; then
609
        APACHE_CONFIGFILE = "apache-site-https.conf.in"
610
    else
611
        APACHE_CONFIGFILE = "apache-site.conf.in"
612
    fi
601
    # Generate and install Apache site-available file and log dir.
613
    # Generate and install Apache site-available file and log dir.
602
    generate_config_file apache-site.conf.in \
614
    generate_config_file $APACHE_CONFIGFILE \
603
        "/etc/apache2/sites-available/$name.conf"
615
        "/etc/apache2/sites-available/$name.conf"
604
    mkdir "/var/log/koha/$name"
616
    mkdir "/var/log/koha/$name"
605
    chown "$username:$username" "/var/log/koha/$name"
617
    chown "$username:$username" "/var/log/koha/$name"
Lines 708-713 then Link Here
708
        # Start Indexer daemon
720
        # Start Indexer daemon
709
        koha-indexer --start "$name"
721
        koha-indexer --start "$name"
710
    fi
722
    fi
723
724
    if [ "$USE_HTTPS" = "yes" ]; then
725
        # Get letsencrypt certificates
726
        # TODO: fix path of letsencrypt
727
        $LETSENCRYPT_PATH/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
728
        # enable all ssl settings (apache won't start with these before certs are present)
729
        sed -i "s:^\s*#\(\s*SSL.*\)$:\1:" "/etc/apache2/sites-available/$name.conf"
730
        # change port from 80 to 443. (apache won't start if it is 443 without certs present)
731
        sed -i "s:^\s*\(<VirtualHost \*\:\)80> #ssl$:\1443>:" "/etc/apache2/sites-available/$name.conf"
732
        # TODO: enable forward from 80 to https
733
        # restart apache with working certs
734
        service apache2 restart
735
    fi
711
fi
736
fi
712
737
713
738
(-)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