Annotation of doc/loncapafiles/webserver.piml, revision 1.20
1.8 harris41 1: <!DOCTYPE piml PUBLIC "-//TUX/DTD piml 1.0 Final//EN"
2: "http://lpml.sourceforge.net/DTD/piml.dtd">
1.1 harris41 3: <!-- webserver.piml -->
4:
1.20 ! raeburn 5: <!-- $Id: webserver.piml,v 1.19 2006/01/23 19:36:03 raeburn Exp $ -->
1.1 harris41 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>
1.6 harris41 40: <targetroot>/</targetroot>
1.2 harris41 41: <specialnotices>
42: <specialnotice>
43: </specialnotice>
44: </specialnotices>
1.1 harris41 45: <files>
46: <file>
47: <target dist='default'>/etc/httpd/conf/httpd.conf</target>
1.20 ! raeburn 48: <target dist='suse9.2 suse9.3 sles9'>/etc/httpd/httpd.conf</target>
! 49: <target dist='sles10'>/etc/apache2/default-server.conf</target>
! 50: <note>This is for Apache 1.X for Red Hat, Fedora 2,3 and 4, and SusSE 9.2, 9.3 and SLES 9 distributions. This is for Apache 2.X for Fedora 5 and SuSE 10.1 and SLES 10 distribtions</note>
1.1 harris41 51: <dependencies dist='default'>
52: /etc/httpd/conf/httpd.conf
53: </dependencies>
1.20 ! raeburn 54: <dependencies dist='suse9.2 suse9.3 sles9'>
! 55: /etc/httpd/httpd.conf
! 56: </dependencies>
! 57: <dependencies dist='sles10'>
! 58: /etc/apache2/default-server.conf
! 59: </dependencies>
1.19 raeburn 60: <perlscript mode='fg' dist="default">
1.11 harris41 61: # Generated from doc/loncapafiles/webserver.piml
1.1 harris41 62: unless (-e "<TARGET />") {
1.20 ! raeburn 63: print '**** ERROR! <TARGET /> should exist! Are you missing the Apache '.
1.13 harris41 64: 'software package?';
1.11 harris41 65: exit(1);
1.1 harris41 66: }
67: else {
1.12 harris41 68: # Append loncapa_apache.conf inclusion to httpd.conf if not present.
1.9 harris41 69: $flag=0;
1.11 harris41 70: open(IN,'<<TARGET />');
1.9 harris41 71: while (<IN>) {
72: if (/^\s*Include\s+conf\/loncapa_apache.conf/) {
73: $flag=1;
74: }
75: }
1.11 harris41 76: close(IN);
1.9 harris41 77: unless ($flag==1) {
1.11 harris41 78: open(OUT,'>><TARGET />');
79: print(OUT 'Include conf/loncapa_apache.conf'."\n");
80: close(OUT);
1.9 harris41 81: }
1.12 harris41 82: # Remove loncapa.conf inclusion from httpd.conf if present.
1.11 harris41 83: $flag=0;
84: open(IN,'<<TARGET />');
85: while (<IN>) {
86: if (/^\s*Include\s+conf\/loncapa.conf/) {
87: $flag=1;
88: }
89: }
90: close(IN);
91: $in='';
92: if ($flag==1) {
93: open(IN,'<<TARGET />');
94: while(<IN>) {
95: $in.=$_ unless /^\s*Include\s+conf\/loncapa.conf/;
96: }
97: close(IN);
98: open(OUT,'><TARGET />');
99: print(OUT $in."\n");
100: close(OUT);
1.13 harris41 101: }
1.18 raeburn 102:
103: # Checking for overlapping ScriptAlias and DocumentRoot definitions.
104: $scriptalias_flag=0;
105: $documentroot_flag=0;
106: my $scriptalias;
107: my $documentroot;
108: open(IN,'<<TARGET />');
109: while (<IN>) {
110: if (m!^\s*ScriptAlias\s+/cgi-bin/\s+(.*)$!) {
111: $scriptalias = $1;
112: if ($scriptalias !~ m!home/httpd/cgi-bin!) {
113: $scriptalias_flag = 1;
114: }
115: }
116: if (m!^\s*DocumentRoot\s+(.*)$!) {
117: $documentroot = $1;
118: if ($documentroot !~ m!home/httpd/html!) {
119: $documentroot_flag = 1;
120: }
121: }
122: }
123: close(IN);
124: if ($scriptalias_flag==1) {
125: print('**** ERROR **** /etc/httpd/conf/httpd.conf has an overlapping definition of '.
126: 'ScriptAlias (it is incorrectly set to '.$scriptalias.').'."\n".
127: 'This conflicts with loncapa_apache.conf.'."\n");
128: }
129: if ($documentroot_flag==1) {
130: print('**** ERROR **** /etc/httpd/conf/httpd.conf has an overlapping definition of '.
131: 'DocumentRoot (it is incorrectly set to '.$documentroot.').'."\n".
132: 'This conflicts with loncapa_apache.conf.'."\n");
133: }
1.13 harris41 134: }
135: </perlscript>
1.1 harris41 136: </file>
137: </files>
138: </piml>
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>