1 | <sect2>
|
---|
2 | <title>Configuring <application>Apache</application></title>
|
---|
3 |
|
---|
4 | <sect3>
|
---|
5 | <title>Config files</title>
|
---|
6 |
|
---|
7 | <para><filename>/etc/apache/*</filename></para>
|
---|
8 |
|
---|
9 | </sect3>
|
---|
10 |
|
---|
11 | <sect3><title>Configuration Information</title>
|
---|
12 |
|
---|
13 | <para>The main configuration file is called
|
---|
14 | <filename>httpd.conf</filename>. See
|
---|
15 | <ulink url="http://httpd.apache.org/docs-2.0/configuring.html"/> for detailed
|
---|
16 | instructions on customizing your Apache <acronym>HTTP</acronym>
|
---|
17 | server.</para>
|
---|
18 |
|
---|
19 | <para>To automate the running of Apache, use the following command to
|
---|
20 | create the init.d script:</para>
|
---|
21 |
|
---|
22 | <screen><userinput><command>cat > /etc/rc.d/init.d/apache << "EOF"</command>
|
---|
23 | #!/bin/bash
|
---|
24 |
|
---|
25 | source /etc/sysconfig/rc
|
---|
26 | source $rc_functions
|
---|
27 |
|
---|
28 | case "$1" in
|
---|
29 | start)
|
---|
30 | echo "Starting Apache daemon..."
|
---|
31 | /usr/sbin/apachectl -k start
|
---|
32 | evaluate_retval
|
---|
33 | ;;
|
---|
34 |
|
---|
35 | stop)
|
---|
36 | echo "Stopping Apache daemon..."
|
---|
37 | /usr/sbin/apachectl -k stop
|
---|
38 | evaluate_retval
|
---|
39 | ;;
|
---|
40 |
|
---|
41 | restart)
|
---|
42 | echo "Restarting Apache daemon..."
|
---|
43 | /usr/sbin/apachectl -k restart
|
---|
44 | evaluate_retval
|
---|
45 | ;;
|
---|
46 |
|
---|
47 | status)
|
---|
48 | statusproc /usr/sbin/httpd
|
---|
49 | ;;
|
---|
50 |
|
---|
51 | *)
|
---|
52 | echo "Usage: $0 {start|stop|restart|status}"
|
---|
53 | exit 1
|
---|
54 | ;;
|
---|
55 | esac
|
---|
56 | <command>EOF
|
---|
57 | chmod 755 /etc/rc.d/init.d/apache</command></userinput></screen>
|
---|
58 |
|
---|
59 | <para>Create the symbolic links to this file in the relevant
|
---|
60 | <filename class="directory">rc.d</filename> directory
|
---|
61 | with the following commands:</para>
|
---|
62 |
|
---|
63 | <screen><userinput><command>cd /etc/rc.d/init.d &&
|
---|
64 | ln -sf ../init.d/apache ../rc0.d/K28apache &&
|
---|
65 | ln -sf ../init.d/apache ../rc1.d/K28apache &&
|
---|
66 | ln -sf ../init.d/apache ../rc2.d/K28apache &&
|
---|
67 | ln -sf ../init.d/apache ../rc3.d/S32apache &&
|
---|
68 | ln -sf ../init.d/apache ../rc4.d/S32apache &&
|
---|
69 | ln -sf ../init.d/apache ../rc5.d/S32apache &&
|
---|
70 | ln -sf ../init.d/apache ../rc6.d/K28apache</command></userinput></screen>
|
---|
71 |
|
---|
72 | </sect3>
|
---|
73 |
|
---|
74 | </sect2>
|
---|