version 1.11, 2002/05/16 01:22:38
|
version 1.12, 2003/01/07 19:01:58
|
Line 58 unless (-e "<TARGET />") {
|
Line 58 unless (-e "<TARGET />") {
|
exit(1); |
exit(1); |
} |
} |
else { |
else { |
$flag=0; |
# Append loncapa_apache.conf inclusion to httpd.conf if not present. |
open IN, "<<TARGET />"; |
|
while (<IN>) { if (/^\s*Include\s+conf\/srm.conf/) { $flag=1; } } |
|
close IN; |
|
if ($flag!=1 and -e '/etc/httpd/conf/srm.conf') { |
|
open OUT,">><TARGET />"; |
|
print OUT 'Include conf/srm.conf'."\n"; |
|
close OUT; |
|
} |
|
$flag=0; |
|
open IN, "<<TARGET />"; |
|
while (<IN>) { if (/^\s*Include\s+conf\/access.conf/) { $flag=1; } } |
|
close IN; |
|
if ($flag!=1 and -e '/etc/httpd/conf/access.conf') { |
|
open(OUT,'>><TARGET />'); |
|
print(OUT 'Include conf/access.conf'."\n"); |
|
close(OUT); |
|
} |
|
my $eflag=0; |
|
$flag=0; |
$flag=0; |
open(IN,'<<TARGET />'); |
open(IN,'<<TARGET />'); |
while (<IN>) { |
while (<IN>) { |
Line 90 else {
|
Line 72 else {
|
print(OUT 'Include conf/loncapa_apache.conf'."\n"); |
print(OUT 'Include conf/loncapa_apache.conf'."\n"); |
close(OUT); |
close(OUT); |
} |
} |
$flag=0; |
# Remove loncapa.conf inclusion from httpd.conf if present. |
open(IN,'<<TARGET />'); |
|
while (<IN>) { |
|
if (/^\s*Include\s+conf\/loncapa.conf/) { |
|
$flag=1; |
|
} |
|
} |
|
close(IN); |
|
$in=''; |
|
if ($flag==1) { |
|
open(IN,'<<TARGET />'); |
|
while(<IN>) { |
|
$in.=$_ unless /^\s*Include\s+conf\/loncapa.conf/; |
|
} |
|
close(IN); |
|
open(OUT,'><TARGET />'); |
|
print(OUT $in."\n"); |
|
close(OUT); |
|
} |
|
} |
|
</perlscript> |
|
</file> |
|
<file> |
|
<target dist='default'>/etc/httpd/conf/access.conf</target> |
|
<note>This may or may not exist on a system depending on the version of |
|
Apache</note> |
|
<dependencies dist='default'> |
|
/etc/httpd/conf/access.conf |
|
</dependencies> |
|
<perlscript mode='fg'> |
|
if (-e '<TARGET />') { |
|
my $flag=0; |
|
open(IN,'<<TARGET />'); |
|
while (<IN>) { |
|
if (/^\s*Include\s+conf\/loncapa_apache.conf/) { |
|
$flag=1; |
|
} |
|
} |
|
close(IN); |
|
unless ($flag==1) { |
|
open(OUT,'>><TARGET />'); |
|
print(OUT 'Include conf/loncapa_apache.conf'."\n"); |
|
close(OUT); |
|
} |
|
$flag=0; |
|
open(IN,'<<TARGET />'); |
|
while (<IN>) { if (/^\s*Include\s+conf\/loncapa.conf/) { $flag=1; } } |
|
close(IN); |
|
$in=''; |
|
if ($flag==1) { |
|
open(IN,'<<TARGET />'); |
|
while(<IN>) { |
|
$in.=$_ unless /^\s*Include\s+conf\/loncapa.conf/; |
|
} |
|
close(IN); |
|
open(OUT,'><TARGET />'); |
|
print(OUT $in."\n"); |
|
close(OUT); |
|
} |
|
} |
|
</perlscript> |
|
</file> |
|
<file> |
|
<target dist='default'>/etc/httpd/conf/srm.conf</target> |
|
<note>This may or may not exist on a system depending on the version of |
|
Apache</note> |
|
<dependencies dist='default'> |
|
/etc/httpd/conf/srm.conf |
|
</dependencies> |
|
<perlscript mode='fg'> |
|
if (-e '<TARGET />') { |
|
my $flag=0; |
|
open(IN,'<<TARGET />'); |
|
while (<IN>) { |
|
if (/^\s*Include\s+conf\/loncapa_apache.conf/) { |
|
$flag=1; |
|
} |
|
} |
|
close(IN); |
|
unless ($flag==1) { |
|
open(OUT,'>><TARGET />'); |
|
print(OUT 'Include conf/loncapa_apache.conf'."\n"); |
|
close(OUT); |
|
} |
|
$flag=0; |
$flag=0; |
open(IN,'<<TARGET />'); |
open(IN,'<<TARGET />'); |
while (<IN>) { |
while (<IN>) { |