FAQ
Hi,

I'm currently running a couple of Catalyst applications configured as VirtualHosts in Apache. I have some php software that I'd like to serve from the same server but I've discovered that php and mod_perl don't seem to get along in the same Apache instance.

Mod_proxy looks like a good solution and I've made some progress by following http://wiki.apache.org/httpd/RunningMultipleApacheInstances. That page suggests that the proxy httpd might be configured something like this:

# httpd-proxy.conf
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot /www/wordpress
ServerName blog.company.com
ProxyPass / http://localhost:81/
ProxyPassReverse / http://localhost:81/
[... additional directives here ... ]
</VirtualHost>
<VirtualHost *:80>
DocumentRoot /www/svn
ServerName svn.company.com
ProxyPass / http://localhost:82/
ProxyPassReverse / http://localhost:82/
[... additional directives here ... ]
</VirtualHost>

And the mod_perl httpd as:


# httpd-perl.conf

Listen 81

ErrorLog /var/log/httpd-perl-error.log

LoadModule perl_module libexec/apache22/mod_perl.so

Which, if I am only running one host on the mod_perl server, works perfectly well. I'd like to tweak it further to redirect to the various VirtualHosts that I have been running with mod_perl alone but I'm not familiar enough with Apache to know how. Could anyone offer advice?

Thanks very much,

Matt.

-----------------------------------------------------------------------------------------------------
Please note, that my email address is no longer givenname.surname@bbsrc.ac.uk. Please update your records to reflect my new email address of givenname.surname@jic.ac.uk as shown on this email.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20110729/3ef2a67b/attachment.htm

Search Discussions

  • Tomas Doran at Jul 29, 2011 at 11:10 am

    On 29 Jul 2011, at 12:03, matthew couchman (JIC) wrote:

    Hi,

    I?m currently running a couple of Catalyst applications configured
    as VirtualHosts in Apache. I have some php software that I?d like to
    serve from the same server but I?ve discovered that php and mod_perl
    don?t seem to get along in the same Apache instance.
    Erm, yes they do?

    Cheers
    t0m
  • matthew couchman (JIC) at Jul 29, 2011 at 11:25 am
    Thanks for your reply. Perhaps it was too sweeping a statement but I can only say that for my setup mod_perl works fine through Apache alone as does php but when I combine them it crashes with memory corruption errors.
    -----Original Message-----
    From: Tomas Doran
    Sent: 29 July 2011 12:10
    To: The elegant MVC web framework
    Subject: Re: [Catalyst] Configuring Apache for mod_perl Catalyst and
    php via mod_proxy

    On 29 Jul 2011, at 12:03, matthew couchman (JIC) wrote:

    Hi,

    I'm currently running a couple of Catalyst applications configured
    as VirtualHosts in Apache. I have some php software that I'd like to
    serve from the same server but I've discovered that php and mod_perl
    don't seem to get along in the same Apache instance.
    Erm, yes they do?

    Cheers
    t0m


    _______________________________________________
    List: Catalyst@lists.scsys.co.uk
    Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
    Searchable archive: http://www.mail-
    archive.com/catalyst@lists.scsys.co.uk/
    Dev site: http://dev.catalyst.perl.org/
    -----------------------------------------------------------------------------------------------------
    Please note, that my email address is no longer givenname.surname@bbsrc.ac.uk. Please update your records to reflect my new email address of givenname.surname@jic.ac.uk as shown on this email.
  • Tomas Doran at Jul 29, 2011 at 12:15 pm

    On 29 Jul 2011, at 12:25, matthew couchman (JIC) wrote:

    Thanks for your reply. Perhaps it was too sweeping a statement but I
    can only say that for my setup mod_perl works fine through Apache
    alone as does php but when I combine them it crashes with memory
    corruption errors.
    (At a guess), don't use the threaded MPM.

    Use prefork and everything will be fine.

    Cheers
    t0m
  • Andrew Rodland at Jul 29, 2011 at 2:24 pm
    Another solution, less ugly (IMO) than mod_proxy, is removing mod_php by
    setting up PHP behind mod_fastcgi. In fact, if you remove mod_perl as well
    by putting your Catalyst apps behind mod_fastcgi, you can have all the
    threading you desire.
    On Fri, Jul 29, 2011 at 8:15 AM, Tomas Doran wrote:


    On 29 Jul 2011, at 12:25, matthew couchman (JIC) wrote:

    Thanks for your reply. Perhaps it was too sweeping a statement but I can
    only say that for my setup mod_perl works fine through Apache alone as does
    php but when I combine them it crashes with memory corruption errors.
    (At a guess), don't use the threaded MPM.

    Use prefork and everything will be fine.


    Cheers
    t0m


    ______________________________**_________________
    List: Catalyst@lists.scsys.co.uk
    Listinfo: http://lists.scsys.co.uk/cgi-**bin/mailman/listinfo/catalyst<http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst>
    Searchable archive: http://www.mail-archive.com/**
    catalyst@lists.scsys.co.uk/<http://www.mail-archive.com/catalyst@lists.scsys.co.uk/>
    Dev site: http://dev.catalyst.perl.org/
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20110729/6f38617e/attachment.htm
  • matthew couchman (JIC) at Jul 29, 2011 at 5:03 pm
    Thanks for all the replies, much appreciated.

    From: Andrew Rodland
    Sent: 29 July 2011 15:25
    To: The elegant MVC web framework
    Subject: Re: [Catalyst] Configuring Apache for mod_perl Catalyst and php via mod_proxy

    Another solution, less ugly (IMO) than mod_proxy, is removing mod_php by setting up PHP behind mod_fastcgi. In fact, if you remove mod_perl as well by putting your Catalyst apps behind mod_fastcgi, you can have all the threading you desire.
    On Fri, Jul 29, 2011 at 8:15 AM, Tomas Doran wrote:

    On 29 Jul 2011, at 12:25, matthew couchman (JIC) wrote:
    Thanks for your reply. Perhaps it was too sweeping a statement but I can only say that for my setup mod_perl works fine through Apache alone as does php but when I combine them it crashes with memory corruption errors.

    (At a guess), don't use the threaded MPM.

    Use prefork and everything will be fine.


    Cheers
    t0m


    _______________________________________________
    List: Catalyst@lists.scsys.co.uk
    Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
    Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
    Dev site: http://dev.catalyst.perl.org/

    -----------------------------------------------------------------------------------------------------
    Please note, that my email address is no longer givenname.surname@bbsrc.ac.uk. Please update your records to reflect my new email address of givenname.surname@jic.ac.uk as shown on this email.
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20110729/2926356c/attachment.htm
  • Larry Leszczynski at Jul 29, 2011 at 1:16 pm
    Hi Matthew -

    On Fri, 29 Jul 2011 12:25 +0100, "matthew couchman (JIC)"
    wrote:
    Thanks for your reply. Perhaps it was too sweeping a statement but I can
    only say that for my setup mod_perl works fine through Apache alone as
    does php but when I combine them it crashes with memory corruption
    errors.
    Usually that means that your mod_perl and mod_php have been linked
    against conflicting versions of the same system library or built with
    conflicting compile options. Make sure you have built them using the
    same environment and config options. You'll probably find more useful
    info on the mod_perl mailing list than this list:

    http://perl.apache.org/maillist/modperl.html

    On that page there are also links to searchable archives of the mod_perl
    list, might find some info about your problem in there.


    HTH,
    Larry
  • Tomas Doran at Jul 29, 2011 at 11:11 am

    On 29 Jul 2011, at 12:03, matthew couchman (JIC) wrote:
    Which, if I am only running one host on the mod_perl server, works
    perfectly well. I?d like to tweak it further to redirect to the
    various VirtualHosts that I have been running with mod_perl alone
    but I?m not familiar enough with Apache to know how. Could anyone
    offer advice?
    Doesn't need any extra config.

    The request is passed through by the proxy as-is, and therefore the
    only thing affecting which app gets it on the backend server is the
    vhost config on that backend server.

    Cheers
    t0m

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedJul 29, '11 at 11:03a
activeJul 29, '11 at 5:03p
posts8
users4
websitecatalystframework.org
irc#catalyst

People

Translate

site design / logo © 2021 Grokbase