Blame Artworks/Webenv/Httpd/2.2.3/install.sh

Alain Reguera Delgado 46de3c
#!/bin/bash
Alain Reguera Delgado 46de3c
#
Alain Reguera Delgado 46de3c
# Install web server customization.
Alain Reguera Delgado 46de3c
Alain Reguera Delgado 46de3c
echo 'What customization do you want to apply?:'
Alain Reguera Delgado 46de3c
select VERSION in `find . -maxdepth 1 -type d \
Alain Reguera Delgado 46de3c
	| egrep -v '^.$' | egrep -v 'svn' \
Alain Reguera Delgado 46de3c
	| sed 's/\.\///'`;do
Alain Reguera Delgado 46de3c
	SVN=http://centos.org/svn/artwork/trunk/Extras/Apache/$VERSION
Alain Reguera Delgado 46de3c
	break
Alain Reguera Delgado 46de3c
done
Alain Reguera Delgado 46de3c
Alain Reguera Delgado 46de3c
INSTANCE=tmp
Alain Reguera Delgado 46de3c
FILE=apache.conf	 # Apache's Customization file
Alain Reguera Delgado 46de3c
CONFD=/etc/httpd/conf.d	 # Apache's Configuration directory
Alain Reguera Delgado 46de3c
DROOT=/var/www/html/	 # Apache's Document Root
Alain Reguera Delgado 46de3c
DERROR=/var/www/error	 # Apache's Error directory
Alain Reguera Delgado 46de3c
DICONS=/var/www/icons	 # Apache's Icons directory
Alain Reguera Delgado 46de3c
Alain Reguera Delgado 46de3c
echo 'Creating local copy ...'
Alain Reguera Delgado 46de3c
svn export $SVN $INSTANCE --force --quiet
Alain Reguera Delgado 46de3c
Alain Reguera Delgado 46de3c
# Copy files
Alain Reguera Delgado 46de3c
echo "Applying Errors Customization ... "
Alain Reguera Delgado 46de3c
cp -r $INSTANCE/error/*   $DERROR;
Alain Reguera Delgado 46de3c
Alain Reguera Delgado 46de3c
echo  "Applying Indexing Customization ... "
Alain Reguera Delgado 46de3c
cp -r $INSTANCE/indexing/* $DROOT/;
Alain Reguera Delgado 46de3c
Alain Reguera Delgado 46de3c
echo "Applying Icons Customization ... "
Alain Reguera Delgado 46de3c
cp -r $INSTANCE/icons/* $DICONS/;
Alain Reguera Delgado 46de3c
Alain Reguera Delgado 46de3c
echo "Applying Apache Customization ... "
Alain Reguera Delgado 46de3c
cp $INSTANCE/$FILE $CONFD/;
Alain Reguera Delgado 46de3c
Alain Reguera Delgado 46de3c
# Permissions
Alain Reguera Delgado 46de3c
echo 'Applying permissions ...'
Alain Reguera Delgado 46de3c
chown -R apache:apache $DROOT
Alain Reguera Delgado 46de3c
chown -R apache:apache $DERROR
Alain Reguera Delgado 46de3c
chown -R apache:apache $DICONS
Alain Reguera Delgado 46de3c
chmod -R 750 $DROOT
Alain Reguera Delgado 46de3c
chmod -R 750 $DERROR
Alain Reguera Delgado 46de3c
chmod -R 750 $DICONS
Alain Reguera Delgado 46de3c
if [ selinuxenabled ];then
Alain Reguera Delgado 46de3c
chcon -R system_u:object_r:httpd_sys_content_t $DROOT
Alain Reguera Delgado 46de3c
chcon -R system_u:object_r:httpd_sys_content_t $DERROR
Alain Reguera Delgado 46de3c
chcon -R system_u:object_r:httpd_sys_content_t $DICONS
Alain Reguera Delgado 46de3c
chcon -R system_u:object_r:httpd_config_t $CONFD
Alain Reguera Delgado 46de3c
fi
Alain Reguera Delgado 46de3c
Alain Reguera Delgado 46de3c
# Remove temporal files
Alain Reguera Delgado 46de3c
rm -r $INSTANCE
Alain Reguera Delgado 46de3c
Alain Reguera Delgado 46de3c
# Reloading configuration
Alain Reguera Delgado 46de3c
/sbin/service httpd reload