wok-next rev 18893
Update apache post_install
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sat Feb 13 10:39:15 2016 +0100 (2016-02-13) |
parents | a2346222a89e |
children | 362f5ed1734c |
files | apache/receipt |
line diff
1.1 --- a/apache/receipt Fri Feb 12 20:27:04 2016 +0000 1.2 +++ b/apache/receipt Sat Feb 13 10:39:15 2016 +0100 1.3 @@ -75,24 +75,30 @@ 1.4 1.5 post_install() 1.6 { 1.7 - local lang=$(. /etc/locale.conf 2>/dev/null; echo ${LANG#*_}) 1.8 - local tz=$(cat /etc/TZ 2>/dev/null) 1.9 - local hostname=$(cat /etc/hostname 2>/dev/null) 1.10 + local lang=$(. $1/etc/locale.conf 2>/dev/null; echo ${LANG#*_}) 1.11 + local tz=$(cat $1/etc/TZ 2>/dev/null) 1.12 + local hostname=$(cat $1/etc/hostname 2>/dev/null) 1.13 1.14 # Just in case. 1.15 chown www.www "$1/var/log/$PACKAGE" 1.16 ping -c 2 $(hostname) > /dev/null 2>&1 || 1.17 sed -i "s/localhost/$(hostname) localhost/" "$1/etc/hosts" 1.18 + sed -i -e "s/^#\(LoadModule.*slotmem_shm.*\)$/\1/" \ 1.19 + -e "s/.*ServerName www.example.*/ServerName ${hostname:-slitaz}/" \ 1.20 + $1/etc/apache/httpd.conf $1/etc/apache/ssl/httpd-ssl.conf 1.21 + grep -qs Apache $1/var/www/index.html && 1.22 + sed -i 's|^LighTTPD.*|&\nApache configs : /etc/apache|' \ 1.23 + $1/var/www/index.html 1.24 [ -s "$1/etc/ssl/apache/apache.pem" ] || 1.25 openssl req -new -x509 -keyout "$1/etc/ssl/apache/apache.pem" \ 1.26 -out "$1/etc/ssl/apache/apache.pem" -days 3650 -nodes <<EOT 1.27 -${lang:-us} 1.28 -${tz:-UTC} 1.29 +${lang:-US} 1.30 +${tz:-Somewhere} 1.31 + 1.32 + 1.33 1.34 ${hostname:-slitaz} 1.35 1.36 - 1.37 - 1.38 EOT 1.39 [ -z "$quiet" ] && echo # Start new line 1.40 ( cd "$1/$INSTALLED/" ; grep -l /etc/apache/conf.d/ */receipt ) | \