1: <!DOCTYPE piml PUBLIC "-//TUX/DTD piml 1.0 Final//EN"
2: "http://lpml.sourceforge.net/DTD/piml.dtd">
3: <!-- webserver.piml -->
4:
5: <!-- $Id: webserver.piml,v 1.18 2005/10/10 02:30:46 raeburn Exp $ -->
6:
7: <!--
8:
9: Copyright Michigan State University Board of Trustees
10:
11: This file is part of the LearningOnline Network with CAPA (LON-CAPA).
12:
13: LON-CAPA is free software; you can redistribute it and/or modify
14: it under the terms of the GNU General Public License as published by
15: the Free Software Foundation; either version 2 of the License, or
16: (at your option) any later version.
17:
18: LON-CAPA is distributed in the hope that it will be useful,
19: but WITHOUT ANY WARRANTY; without even the implied warranty of
20: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21: GNU General Public License for more details.
22:
23: You should have received a copy of the GNU General Public License
24: along with LON-CAPA; if not, write to the Free Software
25: Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26:
27: /home/httpd/html/adm/gpl.txt
28:
29: http://www.lon-capa.org/
30:
31: -->
32:
33: <!-- Default values must be defined before specific values. -->
34: <!-- If no 'dist' attribute is specified, then it is always installed. -->
35: <!-- If 'dist' attribute is set to 'default', then the specification. -->
36: <!-- is accepted if an alternative distribution is not requested or not -->
37: <!-- defined. -->
38:
39: <piml>
40: <targetroot>/</targetroot>
41: <specialnotices>
42: <specialnotice>
43: </specialnotice>
44: </specialnotices>
45: <files>
46: <file>
47: <target dist='default'>/etc/httpd/conf/httpd.conf</target>
48: <note>This is for Apache 1.X for Red Hat and Fedora distributions</note>
49: <dependencies dist='default'>
50: /etc/httpd/conf/httpd.conf
51: </dependencies>
52: <perlscript mode='fg'>
53: # Generated from doc/loncapafiles/webserver.piml
54: unless (-e "<TARGET />") {
55: print '**** ERROR! /etc/httpd/conf/httpd.conf should exist! Are you missing the Apache '.
56: 'software package?';
57: exit(1);
58: }
59: else {
60: # Append loncapa_apache.conf inclusion to httpd.conf if not present.
61: $flag=0;
62: open(IN,'<<TARGET />');
63: while (<IN>) {
64: if (/^\s*Include\s+conf\/loncapa_apache.conf/) {
65: $flag=1;
66: }
67: }
68: close(IN);
69: unless ($flag==1) {
70: open(OUT,'>><TARGET />');
71: print(OUT 'Include conf/loncapa_apache.conf'."\n");
72: close(OUT);
73: }
74: # Remove loncapa.conf inclusion from httpd.conf if present.
75: $flag=0;
76: open(IN,'<<TARGET />');
77: while (<IN>) {
78: if (/^\s*Include\s+conf\/loncapa.conf/) {
79: $flag=1;
80: }
81: }
82: close(IN);
83: $in='';
84: if ($flag==1) {
85: open(IN,'<<TARGET />');
86: while(<IN>) {
87: $in.=$_ unless /^\s*Include\s+conf\/loncapa.conf/;
88: }
89: close(IN);
90: open(OUT,'><TARGET />');
91: print(OUT $in."\n");
92: close(OUT);
93: }
94:
95: # Checking for overlapping ScriptAlias and DocumentRoot definitions.
96: $scriptalias_flag=0;
97: $documentroot_flag=0;
98: my $scriptalias;
99: my $documentroot;
100: open(IN,'<<TARGET />');
101: while (<IN>) {
102: if (m!^\s*ScriptAlias\s+/cgi-bin/\s+(.*)$!) {
103: $scriptalias = $1;
104: if ($scriptalias !~ m!home/httpd/cgi-bin!) {
105: $scriptalias_flag = 1;
106: }
107: }
108: if (m!^\s*DocumentRoot\s+(.*)$!) {
109: $documentroot = $1;
110: if ($documentroot !~ m!home/httpd/html!) {
111: $documentroot_flag = 1;
112: }
113: }
114: }
115: close(IN);
116: if ($scriptalias_flag==1) {
117: print('**** ERROR **** /etc/httpd/conf/httpd.conf has an overlapping definition of '.
118: 'ScriptAlias (it is incorrectly set to '.$scriptalias.').'."\n".
119: 'This conflicts with loncapa_apache.conf.'."\n");
120: }
121: if ($documentroot_flag==1) {
122: print('**** ERROR **** /etc/httpd/conf/httpd.conf has an overlapping definition of '.
123: 'DocumentRoot (it is incorrectly set to '.$documentroot.').'."\n".
124: 'This conflicts with loncapa_apache.conf.'."\n");
125: }
126: }
127: </perlscript>
128: <target dist='suse9.2 suse9.3 sles9'>/etc/httpd/httpd.conf</target>
129: <note>This is for Apache 1.X for SuSE distributions</note>
130: <dependencies dist='suse9.2 suse9.3 sles9'>
131: /etc/httpd/httpd.conf
132: </dependencies>
133: <perlscript mode='fg' dist='suse9.2 suse9.3 sles9'>
134: # Generated from doc/loncapafiles/webserver.piml
135: # Trying to check for overlapping DocumentRoot or ScriptAlias definitions.
136: unless (-e "<TARGET />") {
137: print '**** ERROR **** /etc/httpd/httpd.conf should exist! Are you missing the Apache '.
138: 'software package?';
139: exit(1);
140: }
141: else {
142: # Append loncapa_apache.conf inclusion to httpd.conf if not present.
143: $flag=0;
144: open(IN,'<<TARGET />');
145: while (<IN>) {
146: if (/^\s*Include\s+conf\/loncapa_apache.conf/) {
147: $flag=1;
148: }
149: }
150: close(IN);
151: unless ($flag==1) {
152: open(OUT,'>><TARGET />');
153: print(OUT 'Include conf/loncapa_apache.conf'."\n");
154: close(OUT);
155: }
156: # Remove loncapa.conf inclusion from httpd.conf if present.
157: $flag=0;
158: open(IN,'<<TARGET />');
159: while (<IN>) {
160: if (/^\s*Include\s+conf\/loncapa.conf/) {
161: $flag=1;
162: }
163: }
164: close(IN);
165: $in='';
166: if ($flag==1) {
167: open(IN,'<<TARGET />');
168: while(<IN>) {
169: $in.=$_ unless /^\s*Include\s+conf\/loncapa.conf/;
170: }
171: close(IN);
172: open(OUT,'><TARGET />');
173: print(OUT $in."\n");
174: close(OUT);
175: }
176:
177: # Checking for overlapping ScriptAlias and DocumentRoot definitions.
178: $scriptalias_flag=0;
179: $documentroot_flag=0;
180: my $scriptalias;
181: my $documentroot;
182: open(IN,'<<TARGET />');
183: while (<IN>) {
184: if (m!^\s*ScriptAlias\s+/cgi-bin/\s+(.*)$!) {
185: $scriptalias = $1;
186: if ($scriptalias !~ m!home/httpd/cgi-bin!) {
187: $scriptalias_flag = 1;
188: }
189: }
190: if (m!^\s*DocumentRoot\s+(.*)$!) {
191: $documentroot = $1;
192: if ($documentroot !~ m!home/httpd/html!) {
193: $documentroot_flag = 1;
194: }
195: }
196: }
197: close(IN);
198: if ($scriptalias_flag==1) {
199: print('**** ERROR **** /etc/httpd/httpd.conf has an overlapping definition of '.
200: 'ScriptAlias (it is incorrectly set to '.$scriptalias.').'."\n".
201: 'This conflicts with conf/loncapa_apache.conf.'."\n");
202: }
203: if ($documentroot_flag==1) {
204: print('**** ERROR **** /etc/httpd/httpd.conf has an overlapping definition of '.
205: 'DocumentRoot (it is incorrectly set to '.$documentroot.').'."\n".
206: 'This conflicts with conf/loncapa_apache.conf.'."\n");
207: }
208: }
209: </perlscript>
210: </file>
211: </files>
212: </piml>
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>