http-apache22 revision 2015
7f7460e7095628f3437b116ee78d3043d11f8febChristian Maeder# CDDL HEADER START
4e2331b387b90a234dc36b12c778914d3e202718Christian Maeder# The contents of this file are subject to the terms of the
7f7460e7095628f3437b116ee78d3043d11f8febChristian Maeder# Common Development and Distribution License (the "License").
4e2331b387b90a234dc36b12c778914d3e202718Christian Maeder# You may not use this file except in compliance with the License.
4e2331b387b90a234dc36b12c778914d3e202718Christian Maeder# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
57d320fc4d0fe1a1c08cfe6cd9ebec09b86c2cbfTill Mossakowski# or http://www.opensolaris.org/os/licensing.
4e2331b387b90a234dc36b12c778914d3e202718Christian Maeder# See the License for the specific language governing permissions
4e2331b387b90a234dc36b12c778914d3e202718Christian Maeder# and limitations under the License.
eac3174ea16c143bfaeb3f2e2103a11a2f162c6cChristian Maeder# When distributing Covered Code, include this CDDL HEADER in each
4e2331b387b90a234dc36b12c778914d3e202718Christian Maeder# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
4e2331b387b90a234dc36b12c778914d3e202718Christian Maeder# If applicable, add the following below this CDDL HEADER, with the
4e2331b387b90a234dc36b12c778914d3e202718Christian Maeder# fields enclosed by brackets "[]" replaced with your own identifying
4e2331b387b90a234dc36b12c778914d3e202718Christian Maeder# information: Portions Copyright [yyyy] [name of copyright owner]
4e2331b387b90a234dc36b12c778914d3e202718Christian Maeder# CDDL HEADER END
57d320fc4d0fe1a1c08cfe6cd9ebec09b86c2cbfTill Mossakowski# Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
0206ab93ef846e4e0885996d052b9b73b9dc66b0Christian Maeder#if startup options contain multiple arguments separated by a blank,
2272b992302eb61b2a039033cb8cdaf7809fe682Christian Maeder#then they should be specified as below
0206ab93ef846e4e0885996d052b9b73b9dc66b0Christian Maeder#e.g., %> svccfg -s apache22 setprop 'httpd/startup_options=("-f" "/etc/apache2/2.2/new.conf")'
7f7460e7095628f3437b116ee78d3043d11f8febChristian Maeder if [ $? -eq 0 ] ; then
4e2331b387b90a234dc36b12c778914d3e202718Christian Maeder# Check whether alternate config file was specified using option -f.
4e2331b387b90a234dc36b12c778914d3e202718Christian Maeder# If it's the case, Apache will search in the same directory for
4e2331b387b90a234dc36b12c778914d3e202718Christian Maeder# availability of environment file.
7bf4436b6f9987b070033a323757b206c898c1beChristian Maeder while [ $# -gt 0 ]; do
5fcb1cb8c190e9bfb8d5c06c2e7d7a4b65f361acKlaus Luettich -f) APACHE_USER_ENVVARS=`dirname "${2:-}"`/envvars; break;;
5fcb1cb8c190e9bfb8d5c06c2e7d7a4b65f361acKlaus Luettich -f*) APACHE_USER_ENVVARS=`dirname "${1#-f}"`/envvars; break;;
4e2331b387b90a234dc36b12c778914d3e202718Christian MaederAPACHE_VERSION=`echo ${SMF_FMRI} | sed 's/[^0-9]//g;s/./\.&/g;s/^\.//'`
eac3174ea16c143bfaeb3f2e2103a11a2f162c6cChristian Maeder echo "Apache version is ${APACHE_VERSION}"
8a8880f1b6a0681e636480991d45dfea11d62ff8Christian Maeder APACHE_USR_ROOT=${APACHE_USR_ROOT}/${APACHE_VERSION}
cd25621939b8f27c6c7e2933ece72bc2d91b00f7Christian Maeder APACHE_ETC_ROOT=${APACHE_ETC_ROOT}/${APACHE_VERSION}
04d04d19fdd5320953c78ad5b6d2d11f85bc4bcfChristian Maeder APACHE_VAR_ROOT=${APACHE_VAR_ROOT}/${APACHE_VERSION}
7bf4436b6f9987b070033a323757b206c898c1beChristian MaederAPACHE_USER_ENVVARS=${APACHE_ETC_ROOT}/envvars
7bf4436b6f9987b070033a323757b206c898c1beChristian Maeder # Check if the system architecture supports 64-bit applications
7bf4436b6f9987b070033a323757b206c898c1beChristian Maeder echo "This system is not capable of supporting 64-bit applications."
7bf4436b6f9987b070033a323757b206c898c1beChristian Maeder echo "Set \"enable_64bit\" property value to \"false\" to start the 32-bit server."
7f7460e7095628f3437b116ee78d3043d11f8febChristian Maeder # 64 bit Apache
54a0a1e10bd93721cf52dbd9b816c8f108997ec0Christian Maeder # 32 bit Apache
54a0a1e10bd93721cf52dbd9b816c8f108997ec0Christian Maeder # Invalid value for "bitness"
eac3174ea16c143bfaeb3f2e2103a11a2f162c6cChristian Maeder echo "\"bitness\" property value is invalid. Starting the server in 32-bit mode"
4e2331b387b90a234dc36b12c778914d3e202718Christian MaederAPACHE_BIN=${APACHE_HOME}/bin${PLATFORM_DIR}
4e2331b387b90a234dc36b12c778914d3e202718Christian Maeder echo "Unknown server_type"
7f7460e7095628f3437b116ee78d3043d11f8febChristian Maeder echo "Usage: $0 {start|stop|refresh}"
7bf4436b6f9987b070033a323757b206c898c1beChristian MaederHTTPD="${HTTPD}" APACHE_USER_ENVVARS="${APACHE_USER_ENVVARS}" ${APACHE_BIN}/apachectl ${STARTUP_OPTIONS} ${cmd} 2>&1
7f7460e7095628f3437b116ee78d3043d11f8febChristian Maeder echo "Server failed to start. Check the error log (defaults to ${APACHE_VAR_ROOT}/logs/error_log) for more information, if any."