File:  [LON-CAPA] / doc / loncapafiles / webserver.piml
Revision 1.23: download - view: text, annotated - select for diffs
Fri Dec 7 06:01:06 2007 UTC (16 years, 4 months ago) by raeburn
Branches: MAIN
CVS tags: version_2_8_X, version_2_8_2, version_2_8_1, version_2_8_0, version_2_7_X, version_2_7_99_1, version_2_7_99_0, version_2_7_1, version_2_7_0, version_2_6_X, version_2_6_99_1, version_2_6_99_0, version_2_6_3, version_2_6_2, version_2_6_1, version_2_6_0, version_2_5_99_1, HEAD, GCI_1
support SuSE 10.3

    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.23 2007/12/07 06:01:06 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: <target dist='suse9.2 suse9.3 sles9'>/etc/httpd/httpd.conf</target>
   49: <target dist='sles10 suse10.1 suse10.2 suse10.3'>/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 later, and SuSE 10.X and SLES 10 distribtions</note>
   51: <dependencies dist='default'>
   52: /etc/httpd/conf/httpd.conf
   53: </dependencies>
   54: <dependencies dist='suse9.2 suse9.3 sles9'>
   55: /etc/httpd/httpd.conf
   56: </dependencies>
   57: <dependencies dist='sles10 suse10.1 suse10.2 suse10.3'>
   58: /etc/apache2/default-server.conf
   59: </dependencies>
   60: <perlscript mode='fg' dist="default">
   61: # Generated from doc/loncapafiles/webserver.piml
   62: unless (-e "<TARGET />") {
   63:   print '**** ERROR! <TARGET /> should exist! Are you missing the Apache '.
   64:     'software package?';
   65:   exit(1);
   66: }
   67: else {
   68:   # Append loncapa_apache.conf inclusion to httpd.conf if not present.
   69:   $flag=0;
   70:   open(IN,'&lt;<TARGET />');
   71:   while (&lt;IN&gt;) { 
   72:     if (/^\s*Include\s+conf\/loncapa_apache.conf/) {
   73:       $flag=1; 
   74:     }
   75:   }
   76:   close(IN);
   77:   unless ($flag==1) {
   78:     open(OUT,'&gt;&gt;<TARGET />');
   79:     print(OUT 'Include conf/loncapa_apache.conf'."\n");
   80:     close(OUT);
   81:   }
   82:   # Remove loncapa.conf inclusion from httpd.conf if present.
   83:   $flag=0;
   84:   open(IN,'&lt;<TARGET />');
   85:   while (&lt;IN&gt;) {
   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,'&lt;<TARGET />');
   94:     while(&lt;IN&gt;) {
   95:       $in.=$_ unless /^\s*Include\s+conf\/loncapa.conf/;
   96:     }
   97:     close(IN);
   98:     open(OUT,'&gt;<TARGET />');
   99:     print(OUT $in."\n");
  100:     close(OUT);
  101:   }
  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,'&lt;<TARGET />');
  109:   while (&lt;IN&gt;) {
  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:   }
  134: }
  135: </perlscript>
  136: </file>
  137: </files>
  138: </piml>

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>