Gossamer Forum
Home : Products : Gossamer Mail : Discussion :

virtual server / mod_perl

Quote Reply
virtual server / mod_perl
the only way i can get mod_perl to run in a virtual server in apache, is with this:

<VirtualHost someiphere>
DocumentRoot /home/site/public_html
ServerName someserver.com
#ScriptAlias /public_html/ /home/site/public_html/
ErrorDocument 404 "Pleae wait..."
ErrorDocument 403 "Pleae wait..."
SetHandler perl-script
PerlHandler Apache::Registry
PerlSendHeader On
#ScriptAlias /cgi-bin/ /home/site/public_html/cgi-bin
<Directory /home/site/public_html>
Options +ExecCGI
SetHandler perl-script
PerlHandler Apache::Registry
PerlSendHeader On
#AllowOverride AllAllowOverride All
</Directory>
</VirtualHost>

When I use this I get dead images. Can anyone help?

Last edited by:

goonz: Aug 19, 2004, 7:44 PM
Quote Reply
Re: [goonz] virtual server / mod_perl In reply to
 
this was a fix post, isnt fixed.

Last edited by:

goonz: Aug 19, 2004, 8:18 PM
Quote Reply
Re: [goonz] virtual server / mod_perl In reply to
Hi.

Where do you get to reference and create your start.pl (or whatever you prefer to call it) ?

Not clear as to why you are having that Exec permission on your entire /publlic_html and are making it ScriptAlias :/

Any special reasons to do so? Additionally, <Location></Location> is what is needed instead of <Directory></Directory> directive... AFAIK.

HyTC

Last edited by:

HyperTherm: Aug 19, 2004, 8:25 PM
Quote Reply
Re: [HyperTherm] virtual server / mod_perl In reply to
In Reply To:
Hi.

Where do you get to reference and create your start.pl (or whatever you prefer to call it) ? I have configured it in the httpd.conf. I can load the start.pl just fine, it preloads the mods correctly.

Not clear as to why you are having that Exec permission on your entire /publlic_html and are making it ScriptAlias :/ The cgi files reside on the document root of the virtual server /home/user/public_html/webmail.cgi That is the only way I can get the cgi to run without 403 errors.
Any special reasons to do so? Additionally, <Location></Location> is what is needed instead of <Directory></Directory> directive... AFAIK. HyTC
When I use the code below, mod perl is not recognized in the admin environment:

<Location /home/myuser/gmail>
SetHandler perl-script
PerlHandler Apache::Registry
PerlSendHeader On
Options +ExecCGI
</Location>

Quote Reply
Re: [goonz] virtual server / mod_perl In reply to
If I past:

<Location /home/myuser/gmail>
SetHandler perl-script
PerlHandler Apache::Registry
PerlSendHeader On
Options +ExecCGI
</Location>

in httpd.conf and mod perl is not recognized by gossamer, where else am I to put it.
Quote Reply
Re: [goonz] virtual server / mod_perl In reply to
Hi.

Safe bet:
Presumption: Your gmail program is installed in cgi-bin in a directory say gmail and all images are outside of cgi-bin. Then your virtualhost section should look like this:

<VirtualHost XX.XXX.XXX.XX>
......
......
......
<Location /cgi-bin/gmail>
SetHandler perl-script
PerlHandler Apache::Registry
PerlSendHeader On
Options +ExecCGI
</Location>
</VirtualHost>
I presume that you are admin of your server or VPS whatever.

Where ever you have your

<IfModule mod_perl.c>
.......
......
</IfModule>

Add the following line:

PerlRequire /path/to/apache/conf/startup.pl

HyTC

Last edited by:

HyperTherm: Aug 19, 2004, 8:59 PM
Quote Reply
Re: [HyperTherm] virtual server / mod_perl In reply to
Thanks for your thoughts hyper. I could get mod_perl working but when it was running, images in all folders uner /public_html were showing up dead. However after searching some more in the forum I found a solution from a link to http://perl.apache.org/..._FilesE_gt__Sections
to have mod perl (1) and not lose image permissions by adding this to my virtual server in httpd.conf:

<FilesMatch "\.(cgi|pl)$">
SetHandler perl-script
PerlHandler Apache::Registry
PerlSendHeader On
Options +ExecCGI
</FilesMatch>

I guess what this means is that files that extensions are .cgi or .pl "hey use mod_perl on these file types". Thats from a dummy perspective.
Quote Reply
Re: [goonz] virtual server / mod_perl In reply to
So you have everything working now?
Are images no more broken?

I am not still very keen on having cgi enabled all across. Normally cgi/pl scripts should be restricted to restricted directory where you don't have certain permissions like viewing the contents of directory etc...

This sort of setup unnecessarily complicates the things as it hsa done in your case.

Anyway, as long as your scripts work and security is taken care of it would be fine :)

HyTC
Quote Reply
Re: [goonz] virtual server / mod_perl In reply to
Hi,

It's generally a bad idea to add mod_perl to the main web server, but instead it should run in a second apache and use rewriterule/proxypass to proxy the request.

To answer your question, the problem is with your config you've got everything running under mod_perl, even images!

Best bet is to just put the sethandler perl-script within a specific directory/location that contains your scripts.

Hope that helps,

Alex

ps: we do offer shared and dedicated server with modperl all configured and setup optimally. ;)
--
Gossamer Threads Inc.