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

(-)a/debian/koha-common.config (+2 lines)
Lines 42-46 fi Link Here
42
42
43
db_input medium koha-common/automatically-update-translations || true
43
db_input medium koha-common/automatically-update-translations || true
44
44
45
db_input high koha-common/rename-apache-vhost-files || true
46
45
db_go || true
47
db_go || true
46
48
(-)a/debian/koha-common.install (+1 lines)
Lines 7-12 debian/koha-post-install-setup usr/sbin Link Here
7
debian/unavailable.html                     usr/share/koha/intranet/htdocs
7
debian/unavailable.html                     usr/share/koha/intranet/htdocs
8
debian/unavailable.html                     usr/share/koha/opac/htdocs
8
debian/unavailable.html                     usr/share/koha/opac/htdocs
9
debian/templates/*                          etc/koha
9
debian/templates/*                          etc/koha
10
debian/scripts/koha-functions.sh            usr/share/koha/bin
10
debian/scripts/koha-create                  usr/sbin
11
debian/scripts/koha-create                  usr/sbin
11
debian/scripts/koha-create-dirs             usr/sbin
12
debian/scripts/koha-create-dirs             usr/sbin
12
debian/scripts/koha-disable                 usr/sbin
13
debian/scripts/koha-disable                 usr/sbin
(-)a/debian/koha-common.postinst (+49 lines)
Lines 78-83 EOF Link Here
78
    fi
78
    fi
79
fi
79
fi
80
80
81
# Check if we need to rename the Apache vhost files
82
RENAME_APACHE_FILES="no"
83
for vhost in $(koha-list); do
84
    if [ -f "/etc/apache2/sites-available/$vhost" ] && \
85
       [ ! -f "/etc/apache2/sites-available/$vhost.conf" ]; then
86
       RENAME_APACHE_FILES="yes"
87
       break # at least one, trigger renaming
88
    fi
89
done
90
91
if [ "$RENAME_APACHE_FILES" = "yes" ]; then
92
    # If the user agreed we now rename their Apache files
93
    db_get koha-common/rename-apache-vhost-files
94
    if [ "$RET" = "false" ]; then
95
        # We're not renaming the files, just print a warning
96
        cat <<EOF >&2
97
Warning: you have chosen not to migrate your Apache virtual hosts files to the
98
Apache 2.4 naming schema. You can do it manually by running this for each
99
Koha instance:
100
101
    $ sudo a2dissite instance
102
    $ sudo mv /etc/apache2/sites-available/instance \
103
              /etc/apache2/sites-available/instance.conf
104
    $ sudo a2ensite instance
105
EOF
106
    else
107
        # We have to rename the Apache files
108
        for site in $(koha-list); do
109
            ENABLE_VHOST="yes"
110
            if [ -f "/etc/apache2/sites-available/$site" ] && \
111
               [ ! -f "/etc/apache2/sites-available/$site.conf" ]; then
112
                if ! a2dissite $site > /dev/null 2>&1; then
113
                    echo "Warning: problem disabling $site in Apache" >&2
114
                    ENABLE_VHOST="no"
115
                fi
116
                # Rename the vhost definition files
117
                mv "/etc/apache2/sites-available/$site" \
118
                   "/etc/apache2/sites-available/$site.conf"
119
120
                if [ "$ENABLE_VHOST" = "yes" ]; then
121
                    if ! a2ensite $site > /dev/null 2>&1; then
122
                        echo "Warning: problem enabling $site in Apache" >&2
123
                    fi
124
                fi
125
            fi
126
        done
127
    fi
128
fi
129
81
db_stop
130
db_stop
82
131
83
exit 0
132
exit 0
(-)a/debian/koha-common.templates (-1 / +8 lines)
Lines 15-17 Default: true Link Here
15
Description: automatically update translations
15
Description: automatically update translations
16
  When Koha is upgraded, any existing translated templates can be regenerated
16
  When Koha is upgraded, any existing translated templates can be regenerated
17
  to keep everything in sync. Select "yes" if you want this.
17
  to keep everything in sync. Select "yes" if you want this.
18
- 
18
19
Template: koha-common/rename-apache-vhost-files
20
Type: boolean
21
Default: true
22
Description: Rename the Apache virtual hosts files for Koha instances?
23
 When Koha is upgraded, the Apache's virtual host definition files can be
24
 renamed to match the needs of the newer Apache 2.4. Previously defined
25
 Koha instances will get their Apache files appended '.conf'.

Return to bug 11404