File:  [LON-CAPA] / doc / loncapafiles / webserver.piml
Revision 1.31: download - view: text, annotated - select for diffs
Sun Feb 27 18:54:59 2011 UTC (13 years, 2 months ago) by raeburn
Branches: MAIN
CVS tags: HEAD
- Support Debian 6, Ubuntu 10 LTS, SuSE 11.4.

    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.31 2011/02/27 18:54:59 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 sles11 suse10.1 suse10.2 suse10.3 suse11.1 suse11.2 suse11.3 suse11.4'>/etc/apache2/default-server.conf</target>
   50: <target dist='debian5 debian6 ubuntu6 ubuntu8 ubuntu10'>/etc/apache2/sites-available/loncapa</target>
   51: <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, 11.X and SLES 10 distributions, and Debian 5, Ubuntu 6 and Ubuntu 8 LTS distributions</note>
   52: <dependencies dist='default'>
   53: /etc/httpd/conf/httpd.conf
   54: </dependencies>
   55: <dependencies dist='suse9.2 suse9.3 sles9'>
   56: /etc/httpd/httpd.conf
   57: </dependencies>
   58: <dependencies dist='debian5 debian6 ubuntu6 ubuntu8 ubuntu10'>
   59: /etc/apache2/sites-available/loncapa
   60: </dependencies>
   61: <dependencies dist='sles10 sles11 suse10.1 suse10.2 suse10.3 suse11.1 suse11.2 suse11.3 suse11.4'>
   62: /etc/apache2/default-server.conf
   63: </dependencies>
   64: <perlscript mode='fg' dist="default">
   65: # Generated from doc/loncapafiles/webserver.piml
   66: unless (-e "<TARGET />") {
   67:   print '**** ERROR! <TARGET /> should exist! Are you missing the Apache '.
   68:     'software package?';
   69:   exit(1);
   70: }
   71: else {
   72:   # Append loncapa_apache.conf inclusion to httpd.conf (or sites/available/loncapa) if not present.
   73:   $flag=0;
   74:   open(IN,'&lt;<TARGET />');
   75:   while (&lt;IN&gt;) { 
   76:     if (/^\s*Include\s+conf\/loncapa_apache.conf/) {
   77:       $flag=1; 
   78:     }
   79:   }
   80:   close(IN);
   81:   unless ($flag==1) {
   82:     open(OUT,'&gt;&gt;<TARGET />');
   83:     print(OUT 'Include conf/loncapa_apache.conf'."\n");
   84:     close(OUT);
   85:   }
   86:   # Remove loncapa.conf inclusion from httpd.conf if present.
   87:   $flag=0;
   88:   open(IN,'&lt;<TARGET />');
   89:   while (&lt;IN&gt;) {
   90:     if (/^\s*Include\s+conf\/loncapa.conf/) {
   91:       $flag=1;
   92:     }
   93:   }
   94:   close(IN);
   95:   $in='';
   96:   if ($flag==1) {
   97:     open(IN,'&lt;<TARGET />');
   98:     while(&lt;IN&gt;) {
   99:       $in.=$_ unless /^\s*Include\s+conf\/loncapa.conf/;
  100:     }
  101:     close(IN);
  102:     open(OUT,'&gt;<TARGET />');
  103:     print(OUT $in."\n");
  104:     close(OUT);
  105:   }
  106: 
  107: # Checking for overlapping ScriptAlias and DocumentRoot definitions.
  108:   $scriptalias_flag=0;
  109:   $documentroot_flag=0;
  110:   my $scriptalias;
  111:   my $documentroot;
  112:   open(IN,'&lt;<TARGET />');
  113:   while (&lt;IN&gt;) {
  114:     if (m!^\s*ScriptAlias\s+/cgi-bin/\s+(.*)$!) {
  115:       $scriptalias = $1;
  116:       if ($scriptalias !~ m!home/httpd/cgi-bin!) {
  117:         $scriptalias_flag = 1;
  118:       }
  119:     }
  120:     if (m!^\s*DocumentRoot\s+(.*)$!) {
  121:       $documentroot = $1;
  122:       if ($documentroot !~ m!home/httpd/html!) {
  123:         $documentroot_flag = 1;
  124:       }
  125:     }
  126:   }
  127:   close(IN);
  128:   if ($scriptalias_flag==1) {
  129:     print('**** ERROR **** /etc/httpd/conf/httpd.conf has an overlapping definition of '.
  130:           'ScriptAlias (it is incorrectly set to '.$scriptalias.').'."\n".
  131:           'This conflicts with loncapa_apache.conf.'."\n");
  132:   }
  133:   if ($documentroot_flag==1) {
  134:     print('**** ERROR **** /etc/httpd/conf/httpd.conf has an overlapping definition of '.
  135:           'DocumentRoot (it is incorrectly set to '.$documentroot.').'."\n".
  136:           'This conflicts with loncapa_apache.conf.'."\n");
  137:   }
  138: }
  139: </perlscript>
  140: </file>
  141: </files>
  142: </piml>

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>
500 Internal Server Error

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at root@localhost to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.