fixed addDomain.sh, auto correct folder permissions, included localhost

This commit is contained in:
lars-hagen
2019-12-25 23:38:13 +01:00
parent b5165fcd28
commit 80d234b3c7
10 changed files with 57 additions and 38 deletions
+1 -1
View File
@@ -14,7 +14,7 @@ RUN apt-get install mysql-client lsphp73 lsphp73-mysql lsphp73-opcache lsphp73-c
EXPOSE 7080
RUN curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar && \
chmod +x wp-cli.phar && mv wp-cli.phar /usr/local/bin/wp && \
chmod +x wp-cli.phar && mv wp-cli.phar /usr/bin/wp && \
ln -s /usr/local/lsws/lsphp73/bin/php7.3 /usr/bin/php
+12 -7
View File
@@ -1,4 +1,5 @@
#!/bin/bash
chown 999:999 /usr/local/lsws/conf -R
cd /var/www/vhosts/localhost/html
if [ ! -f "./wp-config.php" ]; then
# su -s /bin/bash www-data -c
@@ -36,15 +37,19 @@ if [ ! -f "./wp-config.php" ]; then
--allow-root
wp plugin install litespeed-cache \
--activate \
--allow-root
--allow-root
first_www_uid=$(stat -c "%u" /var/www/vhosts/localhost)
first_www_gid=$(stat -c "%g" /var/www/vhosts/localhost)
chown $first_www_uid:$first_www_gid /var/www/vhosts/localhost -R
fi
#www_uid=$(stat -c "%u" /var/www/vhosts/localhost)
#if [ ${www_uid} -eq 0 ]; then
# #echo "./sites/localhost is owned by root, auto changing ownership of ./sites/localhost to uid 1000"
# chown 1000 /var/www/vhosts/localhost -R
#fi
www_uid=$(stat -c "%u" /var/www/vhosts/localhost)
if [ ${www_uid} -eq 0 ]; then
#echo "./sites/localhost is owned by root, auto changing ownership of ./sites/localhost to uid 1000"
chown 1000:1000 /var/www/vhosts/localhost -R
fi
echo "WordPress installation finished."
exec "$@"
exec "$@"