Segmentation Fault

[prev] [thread] [next] [Date index for 2005/03/31]

From: =?iso-8859-1?Q?Andreas_Kr=FCger?=
Subject: Segmentation Fault
Date: 16:23 on 31 Mar 2005
Hello there,

I've just installed Apache 2.0.53 with Mod-Perl 2.

I'm trying to write a virtual host system in Perl but I get this error upon
starting Apache.

Starting web server: Apache2/usr/sbin/apache2ctl: line 99:  2799
Segmentation fault      $HTTPD -k start -DSSL


Setup:
------
Apache/2.0.52 (Debian GNU/Linux) 
PHP/5.0.3 
mod_perl/1.999.21 
Perl/v5.6.1

Installed relevant packages:
----------------------------
libdbd-mysql-perl 
libgdbi-dev
libdbi-perl

Httpd.conf:
-----------
LoadModule perl_module /usr/lib/apache2/modules/mod_perl.so
PerlModule Apache2

Line which crashes the machine:
-------------------------------
my $dbh = DBI->connect("dbi:mysql:$db:$host", "$db_user", "$db_password");


Script:
-------
<Perl>
use DBI;

# Declare and initialize variables
my $host = 'localhost';
my $db = 'domains';
my $db_user = 'apache';
my $db_password = 'password';
my $server_admin = 'some@xxxxx.xxx';

# Connect to the requested server
my $dbh = DBI->connect("dbi:mysql:$db:$host", "$db_user", "$db_password");
my $sth = $dbh->prepare("SELECT domain, docroot FROM vhosts ORDER BY domain
ASC");
$sth->execute();

while (($domain, $docroot) = $sth->fetchrow_array()) {
       system("/bin/mkdir -p $docroot");
       system("/bin/mkdir -p $docroot/logs/");
       push @{$VirtualHost{'*'}}, {
               ServerName => "$domain",
               ServerAlias => "www.$domain $domain",
               ServerAdmin => "$server_admin",
               DocumentRoot => "$docroot",
               ErrorLog => "$docroot/error.log",
               CustomLog => ["$docroot/access.log", "combined"],
       };
}
</Perl>


If I out comment this script totally, the server runs fine with mod_perl.

Best Regards,
Andreas

(message missing)

Segmentation Fault
=?iso-8859-1?Q?Andreas_Kr=FCger?= 16:23 on 31 Mar 2005

Re: Segmentation Fault
Rodger Castle 16:54 on 31 Mar 2005

Re: Segmentation Fault
=?iso-8859-1?Q?Andreas_Kr=FCger?= 17:45 on 31 Mar 2005

Re: Segmentation Fault
Rodger Castle 19:33 on 31 Mar 2005

Re: Segmentation Fault
Jonathan Vanasco 19:56 on 31 Mar 2005

Re: Segmentation Fault
Rodger Castle 21:26 on 31 Mar 2005

Re: Segmentation Fault
Jonathan Vanasco 22:13 on 31 Mar 2005

RE: Segmentation Fault
=?iso-8859-1?Q?Andreas_Kr=FCger?= 14:39 on 01 Apr 2005

Re: Segmentation Fault
jonathan vanasco 15:08 on 01 Apr 2005

Re: Segmentation Fault
Rodger Castle 15:40 on 01 Apr 2005

Re: Segmentation Fault
Dan Wilga 21:31 on 04 Apr 2005

Generated at 14:43 on 11 Apr 2005 by mariachi v0.52