- May 5, 2003Angie,
Here is how I have my mod_perl server working with ENSIM. Maybe this
configuration will work for you it seems to be working out alright for
me currently. If you are an ENSIM user on a sub account then ENSIM does
only have the single mod_perl/Apache instance running on the box and the
server configuration lays out as follows.
Httpd.conf -> /etc/httpd/conf/httpd_app.conf (main configuration file
which uses the Include directive to pull in the following files)
/etc/appliance/apacheconf - Defines the default
virtual host (Basically Rewrite rules for ENSIM)
/etc/httpd/conf/jserv.conf - Included based on
whether mod_jserv.c is linked in
/etc/httpd/conf/roaming.conf - Included based on
whether mod_roaming.c is linked in
/etc/httpd/conf/asp.conf - Requires mod_perl as
well as being uncommented by administrator
/etc/httpd/conf/virtual - Directory that includes
the virtual host configurations for all other domains/ips
The last directory is the important one it contains at most 2 files
(i.e. siteX/siteX.ssl) which are the virtual host configuration files
for a site numbered X under ENSIM. These contain some very basic info
like servername, administrator, document root, and some redirect rules,
again for ENSIM. The important stuff in here is the User/Group that the
virtual host runs as well as the ssl certificate information. These two
files both Include another directory.
This is the most important of the configuration directories. If I
understand it correctly when you configure a site using ENSIM to use SSI
for example a file is dropped into this directory configuring said
option (i.e. /etc/httpd/conf/site7/cgi/ssi). The same applies for
mod_perl, with the straightforward filename
/etc/httpd/conf/site7/cgi/mod_perl which contains the following
directives on my machine.
Alias /perl /home/virtual/site7/fst/var/www/perl
Allow from All
SetEnv SITE_PERL /home/virtual/site7/fst/var/www/perl
What is important to note here is that no handler is defined so this
will execute as cgi as there are no mod_perl handlers defined. I am not
sure exactly why this is but you must configure some PerlHandler for
this directory if you wish to run mod_perl. It would appear as though
they are really aiming for the use of Apache::Registry but since my
site(s) make copious use of regular handlers I have done the following.
In order to impact the other sites and the overall ENSIM configuration
minimally I have placed a symbolic link from these original files/names
to files in the directory of the user under which the mod_perl site
runs. Something like /etc/httpd/conf/site7 ->
/home/virtual/site7/fst/etc/httpd/conf/virtual/ssl-site.conf. I have
also done the same for the files for SSI, mod_perl, cgi etc. This has
the advantage of allowing you to log in as the sites user and make
alterations to the configurations as needed. Since all of the users for
the virtual hosts in this environment are chroot on login they could not
see/access the configuration files themselves without these
I then added some configuration changes to my mod_perl file including a
startup.pl file that pre-compiles all of my important Perl modules and
specifies the Perl library that I am using (use lib
"/home/virtual/site7/fst/var/www/mod_perl";). If you have the mod_perl
cookbook or online guide you should be familiar with this file. This
configuration has me up and running and has no interaction with the
other sites. If I used ENSIM to remove the mod_perl site everything
would be clean however I have the following problems with this solution:
A.) The user for the mod_perl virtual host cannot reboot the site
themselves. This is a problem if you are running standard handlers as
opposed to an Apache::Registry solution with Apache::RegistryLoader.
This is due to the fact that any updates to code will require a restart
to take effect which is a serious issue if the site is undergoing a lot
of changes. You must log in as root in order to reboot the site.
B.) Apache/mod_perl responds strangely to restarts in this environment.
When I restart the server its memory footprint grows drastically on
every restart. This is something I have not seen before and I would love
to know why it is happening, but I have not had a chance to research it.
This dictates full stop/start whenever changes are made to the Perl
As for some of your specific questions:
1.) Apache::DBI needs to be downloaded and installed. Just install as
root it should not impact any other sites. (If you are really concerned
about putting it in the main Perl installation then install it to the
directory included in the startup.pl file and it should work fine.)
2.) Guides recommended: http://perl.apache.org/docs/1.0/guide/index.html
(This is the one with the real details), mod_perl Developer's Cookbook
by Geoffrey Young (good quick overview, but you will end up looking to
the first for specifics), and CPAN documentation/man pages.
If I had more time to get my own server set-up I think that the optimal
way to not impact the other sites and have your mod_perl Apache server
running would be to install another instance of mod_perl in the file
system of the site and proxy the requests from the main Apache server to
the other instance for mod_perl requests. This would allow complete
configuration of the new server with zero impact to the existing server
and if you ever remove the site using ENSIM everything will be nice and
clean. All that would be necessary is a few mod_proxy directives in the
siteX.conf/ssl-siteX.conf files and everything else is easy. This
certainly would be the ideal and would give you quite a few other
benefits like proxy caching and memory conservation etc. This type of
installation is described in detail in the mod_perl guide referred to in
the url above.
Sorry about being so verbose but explaining this to you helps me
understand where I am at if you know what I mean.
MDK & Associates Inc.
From: Angie Ahl [mailto:angie@...]
Sent: Monday, May 05, 2003 6:50 AM
Hi guys (and gals)
I'm Complete newbie to Linux/Perl/and Mod_perl
(No it's not that bad ;)
I have used apache on OSX for a couple of years now and happy in
httpd.conf / command line
I'm a long time Lasso user looking for something more OO and tied into
apache, and it's got to do regex really really well. I think I found the
I'm currently terrified of having to recompile Apache and mod_perl as
I'm on one of these ensim box things. which seems to have a perl for the
box and one per site. I am the owner of the box, but I want to have as
little impact on other sites (that don't use mod_perl) as possible.
Got mod_perl working, but only with apache:registry, apache:DBI would
appear to not be there for the whole server (not in any of the @inc's
that I can find).
Are there any Ensim users out there who could just point me in the right
direction, would I be right in saying seeing as Mod_perl is installed
and working (I checked the environment things are running through
mod_perl) that I can just add a path to where I want to put my modules
to perl's @INC and then continue as normal.
Sorry if I sound like a complete newbie in some respects (mod_perl) I
But I will persevere and get this working....
any tips from ensim users most welcome
PS feel free to say RTFM... if you could suggest which Manual and which
page that would be even better. I've got about 5 books and the online
docs permanently open at this time.
Thanks so much
- << Previous post in topic Next post in topic >>