[5649] | 1 | #!/bin/sh
|
---|
| 2 | #
|
---|
| 3 | # $FreeBSD: ports/www/apache2/files/apache.sh,v 1.9 2004/08/23 15:44:51 clement Exp $
|
---|
| 4 | #
|
---|
| 5 |
|
---|
| 6 | # PROVIDE: apache2
|
---|
| 7 | # REQUIRE: NETWORKING SERVERS
|
---|
| 8 | # BEFORE: DAEMON
|
---|
| 9 | # KEYWORD: FreeBSD shutdown
|
---|
| 10 |
|
---|
| 11 | #
|
---|
| 12 | # Add the following lines to /etc/rc.conf to enable apache2:
|
---|
| 13 | # apache2_enable (bool): Set to "NO" by default.
|
---|
| 14 | # Set it to "YES" to enable apache2
|
---|
| 15 | # apache2ssl_enable (bool): Set to "NO" by default.
|
---|
| 16 | # Set it to "YES" to start apache with SSL
|
---|
| 17 | # (if <IfDefined SSL> exists in httpd.conf)
|
---|
| 18 | # apache2limits_enable (bool):Set to "NO" by default.
|
---|
| 19 | # Set it to yes to run `limits $limits_args`
|
---|
| 20 | # just before apache starts.
|
---|
| 21 | # apache2_flags (str): Set to "" by default.
|
---|
| 22 | # Extra flags passed to start command
|
---|
| 23 | # apache2limits_args (str): Default to "-e -C daemon"
|
---|
| 24 | # Arguments of pre-start limits run.
|
---|
| 25 | #
|
---|
| 26 | . /etc/rc.subr
|
---|
| 27 |
|
---|
| 28 | name="apache2"
|
---|
| 29 | rcvar=`set_rcvar`
|
---|
| 30 |
|
---|
| 31 | start_precmd="apache2_precmd"
|
---|
| 32 | restart_precmd="apache2_checkconfig"
|
---|
| 33 | reload_precmd="apache2_checkconfig"
|
---|
| 34 | #command="/usr/local/sbin/httpd"
|
---|
| 35 | command="/usr/local/apache2/bin/httpd"
|
---|
| 36 | #pidfile="/var/run/httpd.pid"
|
---|
| 37 | piffile="/usr/local/apache2/logs/httpd.pid"
|
---|
| 38 | #required_files=/usr/local/etc/apache2/httpd.conf
|
---|
| 39 | required_files=/usr/local/apache2/conf/httpd.conf
|
---|
| 40 |
|
---|
| 41 | [ -z "$apache2_enable" ] && apache2_enable="NO"
|
---|
| 42 | [ -z "$apache2ssl_enable" ] && apache2ssl_enable="NO"
|
---|
| 43 | [ -z "$apache2_flags" ] && apache2_flags=""
|
---|
| 44 | [ -z "$apache2limits_enable" ] && apache2limits_enable="NO"
|
---|
| 45 | [ -z "$apache2limits_args" ] && apache2limits_args="-e -C daemon"
|
---|
| 46 |
|
---|
| 47 | load_rc_config $name
|
---|
| 48 |
|
---|
| 49 | checkyesno apache2ssl_enable && \
|
---|
| 50 | apache2_flags="-DSSL $apache2_flags"
|
---|
| 51 |
|
---|
| 52 | apache2_checkconfig()
|
---|
| 53 | {
|
---|
| 54 | echo "Performing sanity check on apache2 configuration:"
|
---|
| 55 | ${command} -t
|
---|
| 56 | }
|
---|
| 57 |
|
---|
| 58 | apache2_precmd()
|
---|
| 59 | {
|
---|
| 60 | if test -f /usr/local/sbin/envvars
|
---|
| 61 | then
|
---|
| 62 | . /usr/local/sbin/envvars
|
---|
| 63 | fi
|
---|
| 64 | if checkyesno apache2limits_enable
|
---|
| 65 | then
|
---|
| 66 | eval `/usr/bin/limits ${apache2limits_args}` 2>/dev/null
|
---|
| 67 | else
|
---|
| 68 | return 0
|
---|
| 69 | fi
|
---|
| 70 |
|
---|
| 71 | }
|
---|
| 72 |
|
---|
| 73 | sig_reload=SIGUSR1
|
---|
| 74 |
|
---|
| 75 | extra_commands="reload"
|
---|
| 76 | run_rc_command "$1"
|
---|
| 77 |
|
---|
| 78 |
|
---|
| 79 | # PROXY2 /usr/local/etc/rc.d = apache2.sh lokatie en sh naam
|
---|
| 80 | # apache2 = /usr/local/etc/apache2 install Dir
|
---|
| 81 |
|
---|
| 82 |
|
---|