#!/bin/bash # This script checks cmsdam directory permission. # You have to know the username/group of your webserver. echo "Now I will check if your cmsdam directory permissions are ok..." echo echo "I'm trying to get info about your apache web server..." apache_exec=`ps -ef | grep apache | grep -v grep | awk '{print $8}' | uniq` apache_exec="`echo $apache_exec | sed 's/"//g'`" if [ "x$apache_exec" == "x" ] then # Try this apache_exec=`ps -ef | grep httpd | grep -v grep | awk '{print $8}' | uniq` fi if [ "x$apache_exec" == "x" ] then echo "Apache executable not found running" exit 1 else echo "Apache executable found running: $apache_exec" fi apache_conf_file=`$apache_exec -V | grep 'D SERVER_CONFIG_FILE'| awk -F ' -D SERVER_CONFIG_FILE=' '{print $2}'` apache_conf_file="`echo $apache_conf_file | sed 's/"//g'`" if [ "x$apache_conf_file" == "x" ] then echo "Apache configuration file not found" echo "Please check manually the logfile to check if the cmsdam log directory is OK" exit 1 else echo "Apache configuration file: $apache_conf_file" fi apache_user=`cat $apache_conf_file | egrep "^User\ .*$" | awk '{print $2}'` apache_group=`cat $apache_conf_file | egrep "^Group\ .*$" | awk '{print $2}'` echo "Apache user: $apache_user, group: $apache_group" #echo -n "Insert your apache username, User directive in Apache: " #read wwwuser #echo -n "Insert your apache groupname, Group directory in Apache: " #read wwwgroup echo echo "Here is your logs directory, the one that cmsdam needs to have write access for logging:" ls -lhd ../logs/