Updated alpine-setup.sh

This commit is contained in:
Muhamad Aditya Prima 2024-12-27 14:55:56 +07:00
parent 3db317a682
commit edcb233a46
2 changed files with 24 additions and 32 deletions

View File

@ -6,7 +6,7 @@ dom,embed,enchant,exif,ftp,
gd,gettext,gmp,iconv,imap,
intl,json,ldap,mcrypt,
opcache,openssl,pcntl,pdo,
pear,phar,phpdbg,
pear,phpdbg,
posix,pspell,shmop,
snmp,soap,sockets,sysvmsg,sysvsem,
sysvshm,wddx,xml,xmlreader,
@ -19,42 +19,33 @@ LOG_LEVEL="info"
# Setup php flavor
if [[ "$FLAVOR" == "debug" ]]; then
LOG_LEVEL="debug"
/sbin/apk add --update --no-cache php$PHP_VER_SHORT-dbg;
fi
if [ "$FLAVOR" == "full" ] || [ "$FLAVOR" == "debug" ]; then
for i in $(echo $PHP_LIST | tr "," "\n"); do
PHP_DEPS="${PHP_DEPS} php$PHP_VER_SHORT-$i ";
done
for i in $(echo $PHP_LIST | tr "," "\n"); do
PHP_DEPS="${PHP_DEPS} php$PHP_VER_SHORT-$i ";
done
/sbin/apk add --update --no-cache $PHP_DEPS;
fi
# Only setup apache with full flavor parameters
if [ "$WITH_APACHE" == "true" ]; then
if [ "$FLAVOR" == "full" ] || [ "$FLAVOR" == "debug" ]; then
/usr/sbin/addgroup -g 10002 apache ;
/usr/sbin/adduser -D -u 10002 -G apache -s /sbin/nologin -h $APP_ROOT apache ;
/sbin/apk add --update --no-cache apache2 php$PHP_VER_SHORT-apache2 ;
/usr/sbin/addgroup -g 10001 apache ;
/usr/sbin/adduser -D -u 10001 -G apache -s /sbin/nologin -h $APP_ROOT apache ;
/sbin/apk add --update --no-cache apache2 php$PHP_VER_SHORT-apache2 ;
sed -i "s|ServerRoot /var/www|ServerRoot ${SERVER_ROOT}|" /etc/apache2/httpd.conf ;
sed -i "s|ServerAdmin you@example.com| ServerAdmin map@sindigilive.com|" /etc/apache2/httpd.conf ;
sed -i "s|DocumentRoot \"/var/www/localhost/htdocs\"|DocumentRoot \"${APP_ROOT}\"|" /etc/apache2/httpd.conf ;
sed -i "s|Directory \"/var/www/localhost/htdocs\"|Directory \"${APP_ROOT}\"|" /etc/apache2/httpd.conf ;
sed -i "s|AllowOverride None|AllowOverride All|" /etc/apache2/httpd.conf ;
sed -i "s|ErrorLog .*|ErrorLog /dev/stderr \nTransferLog /dev/stdout|" /etc/apache2/httpd.conf ;
sed -i "s|CustomLog .* combined|CustomLog /dev/stdout combined|" /etc/apache2/httpd.conf ;
sed -i "s|LogLevel .*|LogLevel ${LOG_LEVEL}|" /etc/apache2/httpd.conf ;
sed -i "s|#LoadModule rewrite_module|LoadModule rewrite_module|" /etc/apache2/httpd.conf ;
sed -i "s|#LoadModule deflate_module|LoadModule deflate_module|" /etc/apache2/httpd.conf ;
sed -i "s|#LoadModule expires_module|LoadModule expires_module|" /etc/apache2/httpd.conf ;
sed -i "s|/var/www/localhost/cgi-bin/|/app/cgi-bin/|" /etc/apache2/httpd.conf ;
sed -i "s|Require host .example.com|#Require host .example.com|" /etc/apache2/conf.d/info.conf ;
sed -i "s|Require ip 127|Require all granted|" /etc/apache2/conf.d/info.conf ;
sed -i "s|/run/apache2/httpd.pid|${SERVER_ROOT}/run/httpd.pid|" /etc/apache2/conf.d/mpm.conf ;
fi
sed -i "s|ServerRoot /var/www|ServerRoot ${SERVER_ROOT}|" /etc/apache2/httpd.conf ;
sed -i "s|ServerAdmin you@example.com| ServerAdmin map@sindigilive.com|" /etc/apache2/httpd.conf ;
sed -i "s|DocumentRoot \"/var/www/localhost/htdocs\"|DocumentRoot \"${APP_ROOT}\"|" /etc/apache2/httpd.conf ;
sed -i "s|Directory \"/var/www/localhost/htdocs\"|Directory \"${APP_ROOT}\"|" /etc/apache2/httpd.conf ;
sed -i "s|AllowOverride None|AllowOverride All|" /etc/apache2/httpd.conf ;
sed -i "s|ErrorLog .*|ErrorLog /dev/stderr \nTransferLog /dev/stdout|" /etc/apache2/httpd.conf ;
sed -i "s|CustomLog .* combined|CustomLog /dev/stdout combined|" /etc/apache2/httpd.conf ;
sed -i "s|LogLevel .*|LogLevel ${LOG_LEVEL}|" /etc/apache2/httpd.conf ;
sed -i "s|#LoadModule rewrite_module|LoadModule rewrite_module|" /etc/apache2/httpd.conf ;
sed -i "s|#LoadModule deflate_module|LoadModule deflate_module|" /etc/apache2/httpd.conf ;
sed -i "s|#LoadModule expires_module|LoadModule expires_module|" /etc/apache2/httpd.conf ;
sed -i "s|/var/www/localhost/cgi-bin/|/app/cgi-bin/|" /etc/apache2/httpd.conf ;
sed -i "s|Require host .example.com|#Require host .example.com|" /etc/apache2/conf.d/info.conf ;
sed -i "s|Require ip 127|Require all granted|" /etc/apache2/conf.d/info.conf ;
sed -i "s|/run/apache2/httpd.pid|${SERVER_ROOT}/run/httpd.pid|" /etc/apache2/conf.d/mpm.conf ;
fi
if [ "$WITH_DATABASE" == "postgresql" ]; then
@ -62,5 +53,6 @@ if [ "$WITH_DATABASE" == "postgresql" ]; then
fi
if [ "$WITH_DATABASE" == "mysql" ]; then
/sbin/apk add --update --no-cache php$PHP_VER_SHORT-pdo php$PHP_VER_SHORT-pdo_mysql php$PHP_VER_SHORT-mysql php$PHP_VER_SHORT-mysqli ;
/sbin/apk add --update --no-cache php$PHP_VER_SHORT-pdo php$PHP_VER_SHORT-pdo_mysql php$PHP_VER_SHORT-mysql \
php$PHP_VER_SHORT-mysqli ;
fi