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