# This script was written by Daniel Mortimer # Oracle Support Services - Proactive Support Delivery # Last Updated: 12th December 2012 clear echo "OHS 11g Apache Command Interface" echo " " echo "This script is intended for diagnosing problems only" echo " " echo "Run this script using syntax . ./ohs_apache_env.sh" echo "That way the script will set the environment for your session" echo " " echo "Note: COMPONENT_NAME will be set to ohs1 which is the default" echo "If your component name is different you will need to manually edit this script" echo " " echo "Please enter the Oracle Home, Instance Home and Name" echo " " echo "Do not leave trailing spaces or slashes" # Capture ORACLE_HOME, ORACLE_INSTANCE and INSTANCE_NAME enironment variable values echo "Enter the Oracle Home: " read OH export ORACLE_HOME=$OH echo "Enter the Instance Home Directory: " read OInstanceHome export ORACLE_INSTANCE=$OInstanceHome echo "Enter the Instance Name: " read InstanceName export INSTANCE_NAME=$InstanceName # Set Environment Variables to allow Apache commands to work export ORACLE_CONFIG_HOME="${ORACLE_INSTANCE}" export ORA_NLS33="${ORACLE_HOME}/nls/data" export NLS_LANG="AMERICAN_AMERICA.WE8MSWIN1252" export COMPONENT_TYPE="OHS" export COMPONENT_CONFIG_PATH="${ORACLE_INSTANCE}/config/OHS/ohs1" export COMPONENT_LOG_PATH="${ORACLE_INSTANCE}/diagnostics/logs/OHS/ohs1" export COMPONENT_NAME=ohs1 export LD_LIBRARY_PATH="${ORACLE_HOME}/lib:${ORACLE_HOME}/ohs/lib:${LD_LIBRARY_PATH}" export PATH="${ORACLE_HOME}/ohs/bin:$ORACLE_HOME/opmn/bin:${ORACLE_HOME}/opmn/lib:${ORACLE_HOME}/bin:${PATH}" # Now run some Apache Diagnostic commands which do not require Apache to be up and running echo "Running Apache Diagnostic Commands ..... " echo " " echo "Providing full Apache version information" read -p "Press [Enter] to continue ..." httpd -V echo " " echo "Checking configuration file syntax" read -p "Press [Enter] to continue ..." httpd -t echo " " echo "Dumping static and shared loaded modules" read -p "Press [Enter] to continue ..." httpd -M -f ${ORACLE_INSTANCE}/config/${COMPONENT_TYPE}/${COMPONENT_NAME}/httpd.conf echo " " echo "Dumping Virtual Host Information" read -p "Press [Enter] to continue ..." httpd -t -D DUMP_VHOSTS echo " " echo "Environment is now set for you to run your own choice of Apache commands" read -p "Press [Enter] to continue ..."