]>
Commit | Line | Data |
---|---|---|
e91b9f68 A |
1 | #!/bin/sh |
2 | ||
3 | ## | |
4 | # Apache HTTP Server | |
5 | ## | |
6 | ||
7 | . /etc/rc.common | |
8 | ||
9 | StartService () | |
10 | { | |
11 | if [ "${WEBSERVER:=-NO-}" = "-YES-" ]; then | |
12 | echo "Starting Apache web server" | |
13 | if [ ! -e /etc/httpd/httpd.conf ] ; then | |
14 | cp -p /etc/httpd/httpd.conf.default /etc/httpd/httpd.conf | |
15 | fi | |
16 | apachectl start | |
17 | if [ "${WEBPERFCACHESERVER:=-NO-}" = "-YES-" ]; then | |
18 | if [ -x /usr/sbin/webperfcachectl ]; then | |
19 | echo "Starting web performance cache server" | |
20 | /usr/sbin/webperfcachectl start | |
21 | fi | |
22 | fi | |
23 | fi | |
24 | } | |
25 | ||
26 | StopService () | |
27 | { | |
28 | if [ -x /usr/sbin/webperfcachectl ]; then | |
29 | echo "Stopping web performance cache server" | |
30 | /usr/sbin/webperfcachectl stop | |
31 | fi | |
32 | echo "Stopping Apache web server" | |
33 | apachectl stop | |
34 | } | |
35 | ||
36 | RestartService () | |
37 | { | |
38 | if [ "${WEBSERVER:=-NO-}" = "-YES-" ]; then | |
39 | echo "Restarting Apache web server" | |
40 | apachectl restart | |
41 | if [ "${WEBPERFCACHESERVER:=-NO-}" = "-YES-" ]; then | |
42 | if [ -x /usr/sbin/webperfcachectl ]; then | |
43 | echo "Restarting web performance cache server" | |
44 | /usr/sbin/webperfcachectl restart | |
45 | fi | |
46 | fi | |
47 | else | |
48 | StopService | |
49 | fi | |
50 | } | |
51 | ||
52 | RunService "$1" |