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>. Modify it to run the server as a
|
---|
15 | dedicated user:</para>
|
---|
16 |
|
---|
17 | <screen><userinput><command>sed -i -e "s%User nobody%User apache%" -e "s%^Group #-1%Group apache%" /etc/apache/httpd.conf</command></userinput></screen>
|
---|
18 |
|
---|
19 | <para>See
|
---|
20 | <ulink url="http://httpd.apache.org/docs-2.0/configuring.html"/> for
|
---|
21 | detailed instructions on customizing your Apache <acronym>HTTP</acronym>
|
---|
22 | server.</para>
|
---|
23 |
|
---|
24 | <para>To automate the running of Apache, use the following command to
|
---|
25 | create the init.d script:</para>
|
---|
26 |
|
---|
27 | <screen><userinput><command>cat > /etc/rc.d/init.d/apache << "EOF"</command>
|
---|
28 | #!/bin/bash
|
---|
29 |
|
---|
30 | source /etc/sysconfig/rc
|
---|
31 | source $rc_functions
|
---|
32 |
|
---|
33 | case "$1" in
|
---|
34 | start)
|
---|
35 | echo "Starting Apache daemon..."
|
---|
36 | /usr/sbin/apachectl -k start
|
---|
37 | evaluate_retval
|
---|
38 | ;;
|
---|
39 |
|
---|
40 | stop)
|
---|
41 | echo "Stopping Apache daemon..."
|
---|
42 | /usr/sbin/apachectl -k stop
|
---|
43 | evaluate_retval
|
---|
44 | ;;
|
---|
45 |
|
---|
46 | restart)
|
---|
47 | echo "Restarting Apache daemon..."
|
---|
48 | /usr/sbin/apachectl -k restart
|
---|
49 | evaluate_retval
|
---|
50 | ;;
|
---|
51 |
|
---|
52 | status)
|
---|
53 | statusproc /usr/sbin/httpd
|
---|
54 | ;;
|
---|
55 |
|
---|
56 | *)
|
---|
57 | echo "Usage: $0 {start|stop|restart|status}"
|
---|
58 | exit 1
|
---|
59 | ;;
|
---|
60 | esac
|
---|
61 | <command>EOF
|
---|
62 | chmod 755 /etc/rc.d/init.d/apache</command></userinput></screen>
|
---|
63 |
|
---|
64 | <para>Create the symbolic links to this file in the relevant
|
---|
65 | <filename class="directory">rc.d</filename> directory
|
---|
66 | with the following commands:</para>
|
---|
67 |
|
---|
68 | <screen><userinput><command>cd /etc/rc.d/init.d &&
|
---|
69 | ln -sf ../init.d/apache ../rc0.d/K28apache &&
|
---|
70 | ln -sf ../init.d/apache ../rc1.d/K28apache &&
|
---|
71 | ln -sf ../init.d/apache ../rc2.d/K28apache &&
|
---|
72 | ln -sf ../init.d/apache ../rc3.d/S32apache &&
|
---|
73 | ln -sf ../init.d/apache ../rc4.d/S32apache &&
|
---|
74 | ln -sf ../init.d/apache ../rc5.d/S32apache &&
|
---|
75 | ln -sf ../init.d/apache ../rc6.d/K28apache</command></userinput></screen>
|
---|
76 |
|
---|
77 | </sect3>
|
---|
78 |
|
---|
79 | </sect2>
|
---|