Home  |  Linux  | Mysql  | PHP  | XML
From:Allison Randal Date:Mon Oct  6 21:22:12 2003
Subject:hard-coded apache path
I've found a few places where the path to apache is hard-coded as
"/home/perl/apache1" in:

  apache/conf/httpd.tmpl
  lib/Combust/Control/Basic.pm

I've attached a patch with one way to make it dynamic based on the
combust.conf settings. You may have a better way to do it.

Hope this helps.

Allison

Index: stable/apache/conf/httpd.tmpl
===================================================================
--- stable/apache/conf/httpd.tmpl	(revision 202)
+++ stable/apache/conf/httpd.tmpl	(working copy)
@@ -18,6 +18,7 @@
 PassEnv     CBROOT
 PerlPassEnv CBROOTLOCAL
 PassEnv     CBROOTLOCAL
+PerlSetEnv APACHEROOT [% apache_root %]
 
 #LoadModule env_module         libexec/apache/mod_env.so
 #LoadModule config_log_module  libexec/apache/mod_log_config.so
@@ -41,7 +42,7 @@
 #LoadModule setenvif_module    libexec/apache/mod_setenvif.so
 #LoadModule perl_module        libexec/apache/libperl.so
 
-#MimeMagicFile /home/perl/apache1/conf/magic
+#MimeMagicFile [% apache_root %]/conf/magic
 
 ExtendedStatus On
 Port 80
@@ -189,7 +190,7 @@
         LanguagePriority en da nl et fr de el it ja kr no pl pt pt-br ru ltz ca es sv tw
     </IfModule>
 
-    TypesConfig /home/perl/apache1/conf/mime.types
+    TypesConfig [% apache_root %]/conf/mime.types
 
     #AddType application/x-httpd-php .php
     #AddType application/x-httpd-php-source .phps
Index: stable/lib/Combust/Config.pm
===================================================================
--- stable/lib/Combust/Config.pm	(revision 202)
+++ stable/lib/Combust/Config.pm	(working copy)
@@ -74,6 +74,10 @@
   $cfg->param('db_user') || 'combust';
 }
 
+sub httpd {
+  $cfg->param('httpd') || '/home/perl/apache1/bin/httpd';
+}
+
 #sub config {
 #  $cfg;
 #}
Index: stable/lib/Combust/Control/Basic.pm
===================================================================
--- stable/lib/Combust/Control/Basic.pm	(revision 202)
+++ stable/lib/Combust/Control/Basic.pm	(working copy)
@@ -16,7 +16,7 @@
 #		   ],
 #);
 
-LWP::MediaTypes::read_media_types("/home/perl/apache1/conf/mime.types");
+LWP::MediaTypes::read_media_types("$ENV{APACHEROOT}/conf/mime.types");
 
 sub handler ($$) {
   my ($self, $r) = @_;
Index: stable/bin/make_configs
===================================================================
--- stable/bin/make_configs	(revision 202)
+++ stable/bin/make_configs	(working copy)
@@ -15,6 +15,8 @@
 
 my $dir = "$ENV{CBROOT}/apache/conf/";
 my $local_dir = $ENV{CBROOTLOCAL} ? "$ENV{CBROOTLOCAL}/apache/conf" : '';
+my $apache_root = $config->httpd;
+$apache_root =~ s/\/bin\/httpd$//;
 
 my $include_path = []; 
 push @$include_path, $local_dir if $local_dir;
@@ -30,6 +32,7 @@
 	       root         => $ENV{CBROOT},
 	       root_local   => ($ENV{CBROOTLOCAL} || ''),
 	       root_default => ($ENV{CBROOTLOCAL} || $ENV{CBROOT}),
+	       apache_root  => $apache_root,
 	     };
 
 $params->{dont_edit} = <<EOT;

Navigate in group perl.combust.users at sever nntp.perl.org
Previous Next




  
© No Copyright
You are free to use Anything
Site Maintained by PHP Developer
Powered By PHP Consultants