#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
#
SERVER_PG="httpd"
LISTEN_PORTS=""
{
return 1;
else
return 0;
fi
}
#
# Add the given port to LISTEN_PORTS
#
{
LISTEN_PORTS="${LISTEN_PORTS} ${1}"
}
# Create additional module directives from vhost configurations. Modules
# additions are in server config context so this methods has to run
# before any call to generate_vhost()
#
{
exit 1
fi
# Get a list of enabled virtual host.
do
done
do
do
file=$2
else
file=$1
fi
done
done
if [ -f $mods ]; then
fi
}
# Put additional mime definitions into vhost configurations
#
{
pg=$1
do
Mimetype=""
ext=""
do
else
fi
done
done
}
# Create vhost configuration in APACHE_CONF for
# named vhost.
#
{
vhost_name="$1"
# Don't bother if this vhost is disabled
vhost_is_enabled $vhost || return 0
sslengine=`$SVCPROP -p ${vhost_name}/sslengine ${SMF_FMRI}`
sslcert=`$SVCPROP -p ${vhost_name}/sslcert ${SMF_FMRI}`
sslkey=`$SVCPROP -p ${vhost_name}/sslkey ${SMF_FMRI}`
sslip=`$SVCPROP -p ${vhost_name}/sslip ${SMF_FMRI}`
sslport=`$SVCPROP -p ${vhost_name}/sslport ${SMF_FMRI}`
else
port=`$SVCPROP -p ${vhost_name}/port ${SMF_FMRI}`
fi
docroot=`$SVCPROP -p ${vhost_name}/docroot ${SMF_FMRI}`
use_custom=`$SVCPROP -p ${vhost_name}/custom_conf ${SMF_FMRI}`
custom_file=`$SVCPROP -p ${vhost_name}/custom_file ${SMF_FMRI}`
domain=`$SVCPROP -p ${vhost_name}/domain ${SMF_FMRI}`
serve_home_dir=`$SVCPROP -p ${vhost_name}/serve_home_dir ${SMF_FMRI}`
# Create DocumentRoot directive if it's not empty. Also
# create a Directory section with default permission for
# the specified DocumentRoot directory
#
echo "Options Indexes Includes FollowSymLinks " \
fi
fi
fi
echo " Options Indexes Includes FollowSymLinks " \
fi
}
{
if (($1 ~ /^vhost/) && ($2 == "application"))
printf("%s ", $1)
}'
}
{
httpd_custom_file=`$SVCPROP -p ${SERVER_PG}/custom_file ${SMF_FMRI}`
httpd_custom_conf=`$SVCPROP -p ${SERVER_PG}/custom_conf ${SMF_FMRI}`
# Generate general parameters
ln -s ${httpd_custom_file} ${CONF_FILE}
exit 0
else
fi
fi
# Get the list of vhost names
# Add mimes for server and modules for both server and virtual hosts
process_modules "${vhost_list}"
process_mimes "${SERVER_PG}"
# Make sure root user's home directory is disabled
# Generate vhost clauses in configuration file
for vhost in $vhost_list
do
done
echo >> $APACHE_CONF
# Add a "Listen <port>" line for each uniqe port
# Add a "NameVirtualHost: *:<port>" line for each duplicate port
}
{
FMRI=$1
policy=`get_policy ${FMRI}`
# rules for global port
# rules for virtual hosts
vhost_list=`get_vhost_list ${FMRI}`
for vhost in $vhost_list
do
ip="any"
else
fi
done
}
case "$1" in
cmd="-DSSL -k start"
;;
cmd="-k graceful"
;;
stop)
cmd="-k stop"
;;
gen_ipf_conf $2
exit $SMF_EXIT_OK
;;
*)
echo "Usage: $0 {start|stop|refresh}"
exit 1
;;
esac
[ ! -f ${CONF_FILE} ] && exit $SMF_EXIT_ERR_CONFIG