#!/bin/bash # Configuration script MAUS_WEB_ROOT_DIR=`pwd` # Check path. if echo $MAUS_WEB_ROOT_DIR | grep -E '[ "]' >/dev/null; then echo "FATAL: No whitespace allowed in directory names.">&2; echo "FATAL:">&2; echo "FATAL: See:" >&2; echo "FATAL:" >&2; echo "FATAL: http://micewww.pp.rl.ac.uk:8080/issues/306" >&2; exit 1; fi # Set permissions so Apache can access configuration file. echo "Setting group and world write execute permissions for apache" chmod -R go+rx $MAUS_WEB_ROOT_DIR/apache # Set permissions so Apache can media directories. echo "Setting group and world write and execute permissions for media" chmod -R go+rwx $MAUS_WEB_ROOT_DIR/media # Create environment file. cat > env.sh <> env.sh <&2 echo "FATAL: for running the web front-end." >&2 echo "FATAL: IF running the Django web server THEN" >&2 echo "FATAL: Change into the MAUS distribution directory " >&2 echo "FATAL: Run " >&2 echo "FATAL:" >&2 echo "FATAL: source env.sh " >&2 echo "FATAL:" >&2 echo "FATAL: IF running under Apache THEN" >&2 echo "FATAL: Edit /usr/local/apache2/bin/envvars " >&2 echo "FATAL: Add the path to your MAUS distribution directory " >&2 echo "FATAL: For example " >&2 echo "FATAL:" >&2 echo "FATAL: source /home/user/maus/env.sh " >&2 echo "FATAL:" >&2 return 1; fi EOF else echo "Creating env.sh for usage standalone..." fi cat >> env.sh <