mod_perl and vhost configs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Greetings -

   I'm having a great time with this. We're implementing our new infrastructure, which is backended with a san via clustered nfs. Thus, I figured why not do some dynamic configuration, right? Do, I have this code, which is just the vhost include. It's below. When I start the httpd I get :

Syntax error on line 2 of /efs/www/predev/app/apache/2.2.9/conf/extra/httpd-vhosts.conf:
Unknown type 'Apache2::ServerRec' for directive s at /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/Apache2/PerlSections.pm line 197.\n
httpd not running, trying to start

Not so sure where this break is, or even if my config is done correctly. It seems to be pretty basic perl, of which I'm pretty veteran. Does anyone know what's going on ? Here's the code:


<Perl>
    use Sys::Hostname;
    use File::Basename;
    use Apache2::ServerUtil;
    $s = Apache2::ServerUtil->server;


Apache2::ServerUtil->server->add_config(['NameVirtualHost *:80']);

##################################################
# Get site/configuration paths using hostname()
#

    $hostname=hostname();
    $hostname=~s/^(.*)\d+\d+\..*$/$1/;

##################################################
# Where's cronolog?

    $cronolog="/efs/www/$hostname/app/cronolog/1.6.2/sbin/cronolog";

##################################################
# Go through the environments "CONF" directory
# to find out what sites we should load.
#
    @sites=`find /efs/www/$hostname/conf/ -type f`;
    foreach $site (@sites){
        $site_conf=$site;
        $site_name=$hostname . "\." . basename($site);
        chomp ($site_name,$site_conf);

##################################################
# This is the actual Apache Virt Configuration.
# Standard BASE configs are here, site details
# are in the $site_conf file.
        if (-e $siteconf){$include="Include $siteconf"}else{$include="";}
        Apache2::ServerUtil->server->add_config(['<VirtualHost *:80>',
                'ServerName ' . $site_name,
                'ServerAdmin peterm\@nypl.org',
                'DocumentRoot "/efs/www/'.$hostname.'/sites/'.$sitename.'/"',
                $include,
                'ErrorLog "|'.$cronolog.' /var/apache/logs/error/'.$sitename.'/%Y-%m-%d.error.log',
                'CustomLog "|'.$cronolog.' /var/apache/logs/access/'.$sitename.'/%Y-%m-%d.access.log" combinedio',
        '</VirtualHost>']);
        }
</Perl>



Thanks!


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux