|
51 | 51 | mph="php$version-mbstring php$version-bcmath php$version-cli php$version-curl |
52 | 52 | php$version-fpm php$version-gd php$version-intl php$version-mysql |
53 | 53 | php$version-soap php$version-xml php$version-zip php$version-mbstring |
54 | | - php$version-json php$version-bz2 php$version-pspell" |
| 54 | + php$version-json php$version-bz2 php$version-pspell php$version-imagick" |
55 | 55 |
|
56 | 56 | # Check is version is 7.1 or below to add mcrypt |
57 | 57 | if [[ `echo "$version 7.2" | awk '{print ($1 < $2)}'` == 1 ]]; then |
|
83 | 83 |
|
84 | 84 | # Check if required modules for apache2 are enabled |
85 | 85 | if [ "$WEB_SYSTEM" = "apache2" ]; then |
86 | | - if ! ls -l /etc/apache2/mods-enabled/ | grep --quiet "proxy_fcgi"; then |
87 | | - a2enmod proxy_fcgi > /dev/null 2>&1 |
88 | | - restart_apache2="yes" |
| 86 | + if ! a2query -q -m proxy_fcgi; then |
| 87 | + a2enmod -q proxy_fcgi |
89 | 88 | fi |
90 | | - if ! ls -l /etc/apache2/mods-enabled/ | grep --quiet "setenvif"; then |
91 | | - a2enmod setenvif > /dev/null 2>&1 |
92 | | - restart_apache2="yes" |
93 | | - fi |
94 | | - if [ "$restart_apache2" = "yes" ]; then |
95 | | - service apache2 restart > /dev/null 2>&1 |
| 89 | + if ! a2query -q -m setenvif; then |
| 90 | + a2enmod -q setenvif |
96 | 91 | fi |
| 92 | + $BIN/v-restart-web |
97 | 93 | fi |
98 | 94 |
|
99 | 95 | # Configure fpm |
100 | 96 | update-rc.d php$version-fpm defaults > /dev/null 2>&1 |
101 | | -v_tpl=$(echo "$version" | sed -e 's/[.]//') |
| 97 | +v_tpl=${version//.} |
102 | 98 | rm -f /etc/php/$version/fpm/pool.d/* |
103 | 99 | cp -f $HESTIA_INSTALL_DIR/php-fpm/dummy.conf /etc/php/$version/fpm/pool.d/ |
104 | 100 | sed -i "s/9999/99$v_tpl/g" /etc/php/$version/fpm/pool.d/dummy.conf |
105 | 101 |
|
106 | | -# Install php templates |
107 | | -cp -f $HESTIA_INSTALL_DIR/multiphp/$WEB_SYSTEM/PHP-${version//.}.sh \ |
108 | | - $HESTIA/data/templates/web/$WEB_SYSTEM/ |
109 | | -cp -f $HESTIA_INSTALL_DIR/multiphp/$WEB_SYSTEM/PHP-${version//.}.tpl \ |
110 | | - $HESTIA/data/templates/web/$WEB_SYSTEM/ |
111 | | -cp -f $HESTIA_INSTALL_DIR/multiphp/$WEB_SYSTEM/PHP-${version//.}.stpl \ |
112 | | - $HESTIA/data/templates/web/$WEB_SYSTEM/ |
113 | | -chmod a+x $HESTIA/data/templates/web/$WEB_SYSTEM/PHP-${version//.}.sh |
114 | | - |
| 102 | +# Install backend template |
| 103 | +cp -f $HESTIA_INSTALL_DIR/multiphp/php-fpm/default.tpl \ |
| 104 | + $HESTIA/data/templates/web/php-fpm/PHP-${version/\./_}.tpl |
115 | 105 |
|
116 | 106 | #----------------------------------------------------------# |
117 | 107 | # Hestia # |
118 | 108 | #----------------------------------------------------------# |
119 | 109 |
|
120 | 110 | # Logging |
121 | | -log_history "installed php $job" |
| 111 | +log_history "installed php $version" '' 'admin' |
122 | 112 | log_event "$OK" "$ARGUMENTS" |
123 | 113 |
|
124 | 114 | exit |
0 commit comments