bugsbunny has asked for the wisdom of the Perl Monks concerning the following question:

hi,

I'm going to host a site, the problem is that on my server I can set the correct startup.pl script and I know the root directory, so that I can set it in Site::Config. example - startup.pl :
use lib qw(/path/to/lib); use Site::Config; 1;
Then I have in vhost.conf :
PerlRequire "/path/to/startup.pl"
But now I want to host the site on hosting company.
The problem is i cant put PerlRequire 'cause I dont have access to apache configration.
How u solve such bootstrap problems.

Retitled by davido.

Replies are listed 'Best First'.
Re: Apache startup file on virtual host
by cLive ;-) (Prior) on Dec 13, 2004 at 22:44 UTC
    I'm a little confused. If you're hosting in a shared environment, it's unlikely the provider will allow mod_perl.

    If you're hosted on a dedicated server, there's no reason why you shouldn't be able to edit httpd.conf

    If it's a maintained box, you could create a directory for apache boot includes, eg:

    /home/username/apachestart
    dump the startup file in there, then ask the ISP to add the line:
    Include /home/username/apachestart/*
    to the httpd.conf file (I think that's the correct syntax).

    Then add in Apache configuration directives as you see fit to call whatever you need at startup.

    But, I have a feeling you're talking shared hosting, in which case you're out of luck :)

    .02

    cLive ;-) </code>

      Thanx all for the answers... if some is interested, here is my solution to bootstraping problem (in CGI environment, not tested will this work under mod_perl)
      BEGIN { my ($ROOT) = $ENV{DOCUMENT_ROOT} =~ m!(^.+)/!; unshift @INC, "$ROOT/lib"; }
Re: Apache startup file on virtual host
by ikegami (Patriarch) on Dec 13, 2004 at 21:15 UTC
    Not quite the same, but you might be able to place it in your directory's .htaccess instead of vhost.conf
Re: Apache startup file on virtual host
by hardburn (Abbot) on Dec 13, 2004 at 21:05 UTC

    I don't think you can. In Apache2, you can change the Apache config from the startup file, which is obviously a problem for hosting companies.

    "There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.