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

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