Blame Extras/Apache/install.sh

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