seperated iipsrv from mirador and add some more questions

This commit is contained in:
rnsrk 2021-11-18 22:30:54 +01:00
parent 5a0db4ac69
commit 65989d2473

View file

@ -324,6 +324,7 @@ then
break;;
[Nn]* )
echo -e "${GREEN}Okay, to visit your website later on, you have to type http://localhost/${WEBSITENAME}";
echo -e "${RED}If you install IIP Image Server , you need http://${WEBSITENAME} as a host or you get cross origin problems!${NC}";
break;;
* ) echo "Please answer yes or no.";;
esac
@ -446,12 +447,19 @@ then
fi
# create database user and database
echo
echo -e "${YELLOW}Create database and user for Drupal. Please note your inputs, they will be needed in a moment."
CORRECTDATABASE=false
CORRECTUSER=false
FINISHED=false
while [[ $CORRECTDATABASE == false ]] && [[ $CORRECTUSER == false ]]; do
echo -e "${YELLOW}Do you want to create a database and a database user?"
echo -e "${YELLOW}If you have a database and database user, please ensure you know the credentials!"
while true; do
read -p "(y/n): " CREATEDBANDDBUSER
case $CREATEDBANDDBUSER in
[Yy]* )
echo
echo -e "${YELLOW}Create database and user for Drupal. Please note your inputs, they will be needed in a moment."
CORRECTDATABASE=false
CORRECTUSER=false
FINISHED=false
while [[ $CORRECTDATABASE == false ]] && [[ $CORRECTUSER == false ]]; do
while [[ $FINISHED == false ]]; do
echo -e "${YELLOW}Enter name of the Database, you want to create:${NC}"
read DB
@ -460,7 +468,7 @@ while [[ $CORRECTDATABASE == false ]] && [[ $CORRECTUSER == false ]]; do
echo -e "${RED}Database already exists!"
echo -e "Should I drop it and recreate? Attention: All data will be lost and can not be recovered!${NC}"
while true; do
read -p "(recreate/keep/rename/abort): " SURE
read -p "(recreate/keep/retry/abort): " SURE
case $SURE in
[recreate]* )
mysql -e "DROP DATABASE ${DB};"
@ -569,33 +577,18 @@ while [[ $CORRECTDATABASE == false ]] && [[ $CORRECTUSER == false ]]; do
esac
done
done
done
echo
echo -e "${GREEN}Created ${DB} database with ${USER}@localhost identified by ${USERPW}."
sleep 1
# install drupal with drush
echo
echo -e "${GREEN}You are ready to install Drupal! It will be installed under /var/www/html/$WEBSITENAME."
echo -e "${YELLOW}Should I start?${NC}"
while true; do
read -p "(y/n): " INSTALLDRUPAL
case $INSTALLDRUPAL in
[Yy]* )
echo -e "${GREEN}Okay, I will start installation!"
done
echo
echo -e "${GREEN}Created ${DB} database with ${USER}@localhost identified by ${USERPW}."
sleep 1
break;;
[Nn]* )
echo -e "${GREEN}Okay bye."
exit;;
break;;
* ) echo "Please answer y[es] or n[o].";;
esac
done
cd /var/www/html/
if ! command -v composer &> /dev/null
then
echo
@ -616,26 +609,45 @@ then
done
fi
# install drupal with drush
echo
echo -e "${RED}Composer will scold you for being root, do not worry, we take care of this later - answer always \"y\".${NC}"
echo
composer create-project drupal/recommended-project $WEBSITENAME
chown -R www-data:www-data $WEBSITENAME
chmod 775 -R $WEBSITENAME
echo -e "${GREEN}You are ready to install Drupal! It will be installed under /var/www/html/$WEBSITENAME."
echo -e "${YELLOW}Should I download and install Drupal?${NC}"
while true; do
read -p "(y/n/skip): " INSTALLDRUPAL
case $INSTALLDRUPAL in
[Yy]* )
echo -e "${GREEN}Okay, I will start installation!"
cd /var/www/html/
echo
echo -e "${RED}Composer will scold you for being root, do not worry, we take care of this later - answer always \"y\".${NC}"
echo
composer create-project drupal/recommended-project $WEBSITENAME
chown -R www-data:www-data $WEBSITENAME
chmod 775 -R $WEBSITENAME
echo
echo -e "${GREEN}Installing WissKI with some modules (you have to activate them later).${NC}"
echo
cd /var/www/html/$WEBSITENAME
composer require drupal/colorbox drupal/devel drush/drush drupal/imagemagick drupal/image_effects 'drupal/inline_entity_form:1.x-dev@dev' 'drupal/wisski:^3.0@RC'
cd web/modules/contrib/wisski
echo
echo -e "${GREEN}Autoload WissKI dependencies.${NC}"
echo
composer update
cd /var/www/html/$WEBSITENAME
echo
echo -e "${GREEN}Installing WissKI with some modules (you have to activate them later).${NC}"
echo
cd /var/www/html/$WEBSITENAME
composer require drupal/colorbox drupal/devel drush/drush drupal/imagemagick drupal/image_effects 'drupal/inline_entity_form:1.x-dev@dev' 'drupal/wisski:3.x-dev@dev'
cd web/modules/contrib/wisski
echo
echo -e "${GREEN}Autoload WissKI dependencies.${NC}"
echo
composer update
cd /var/www/html/$WEBSITENAME
break;;
[Nn]* )
echo -e "${GREEN}Okay bye."
exit;;
[skip]* )
echo -e "${GREEN}Okay skipping."
break;;
* ) echo "Please answer y[es] or n[o].";;
esac
done
echo
echo -e "${YELLOW}Do you like to get colorbox library?${NC}"
@ -661,22 +673,21 @@ while true; do
done
echo
echo -e "${YELLOW}Do you like to get mirador library with the IIP Image Server?${NC}"
echo -e "${YELLOW}Do like to install the IIP Image Server?${NC}"
echo -e "${YELLOW}This will download and install the IIP Image Server at /fcgi-bin/iipsrv.fcgi,${NC}"
echo -e "${YELLOW}create a iipsrv configuration file at /etc/apache2/mods-available/iipsrv.conf,${NC}"
echo -e "${YELLOW}and enable the iipsrv mod.${NC}"
echo
while true; do
read -p "(y/n): " INSTALLMIRADOR
case ${INSTALLMIRADOR} in
read -p "(y/n): " INSTALLIIPSRV
case ${INSTALLIIPSRV} in
[Yy]* )
mkdir -p web/libraries
## get mirador
wget http://wisskieu.nasarek.org/sites/default/files/assets/mirador.zip -P web/libraries/
unzip web/libraries/mirador.zip -d web/libraries/ &> /dev/null
sudo apt-get install \
autoconf \
automake \
iipimage-server \
iipimage-doc \
git \
libapache2-mod-fcgid \
libfreetype6-dev \
libjpeg-dev \
libopenjp2-7 \
@ -689,7 +700,8 @@ while true; do
libtool \
libmemcached11 \
libmemcached-dev \
imagemagick -y
imagemagick \
pkg-config -y
# the directory of the script
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
@ -718,12 +730,64 @@ while true; do
./autogen.sh && \
./configure && \
make
cp src/iipsrv.fcgi /usr/lib/iipimage-server/iipsrv.fcgi
mkdir -p /fcgi-bin
cp src/iipsrv.fcgi /fcgi-bin/iipsrv.fcgi
cd ${DIR}
FCGICONFIG=$'<IfModule mod_fcgid.c>
ScriptAlias /fcgi-bin/ "/fcgi-bin/"
<Location "/fcgi-bin/">
AllowOverride None
Options None
Require all granted
<IfModule mod_mime.c>
AddHandler fcgid-script .fcgi
</IfModule>
</Location>
# Set our environment variables for the IIP server
FcgidInitialEnv VERBOSITY "1"
FcgidInitialEnv LOGFILE "/var/log/iipsrv.log"
FcgidInitialEnv MAX_IMAGE_CACHE_SIZE "10"
FcgidInitialEnv JPEG_QUALITY "90"
FcgidInitialEnv MAX_CVT "5000"
FcgidInitialEnv MEMCACHED_SERVERS "localhost"
# Define the idle timeout as unlimited and the number of
# processes we want
FcgidConnectTimeout 20
FcgidIdleTimeout 0
FcgidMaxProcessesPerClass 1
</IfModule>'
echo "${FCGICONFIG}" > /etc/apache2/mods-available/iipsrv.conf
a2enmod iipsrv
systemctl restart apache2 &> /dev/null
echo
echo -e "${GREEN}Sucessfully intalled IIPImage server."
echo -e "You reach him at http://localhost/iipsrv/iipsrv.fcgi${NC}"
echo -e "You reach him at http://$WEBSITENAME/fcgi-bin/iipsrv.fcgi${NC}"
break;;
[Nn]* )
echo
echo -e "${GREEN}Okay, but you need an IIP Image Server for Mirador, "
echo -e "${GREEN}ensure that you have one running at http://$WEBSITENAME/fcgi-bin/iipsrv.fcgi${NC}"
break;;
* ) echo "Please answer y[es] or n[o].";;
esac
done
echo
echo -e "${YELLOW}Do you like to get mirador library with the IIP Image Server?${NC}"
echo
while true; do
read -p "(y/n): " INSTALLMIRADOR
case ${INSTALLMIRADOR} in
[Yy]* )
mkdir -p web/libraries
## get mirador
wget http://wisskieu.nasarek.org/sites/default/files/assets/mirador.zip -P web/libraries/
unzip web/libraries/mirador.zip -d web/libraries/ &> /dev/null
break;;
[Nn]* )
echo