Gossamer Forum
Home : Products : Gossamer Links : Discussions :

LinksSQL 2, Apache 2 and mod_perl

Quote Reply
LinksSQL 2, Apache 2 and mod_perl
Having spent the afternoon trying to make this work, I guess I should have asked this earlier:

Is there any reason to believe that LinksSQL 2.1.2 shouldn't work under mod_perl 1.99_09-10.ent on Apache 2.0.46?

It was working previously, and the server has just been upgraded to this spec. Mod_perl appears to get loaded differently now, but basically seems to work the same way. httpd does report the SQL files being loaded into mod_perl when it starts, but I see scripts like search.cgi and page.cgi running in "top" which I didn't previously when they were running successfully under mod_perl, and the environment report in admin doesn't suggest LSQL has found mod_perl.

Upgrades ... ha ha
Quote Reply
Re: [CrazyGuy] LinksSQL 2, Apache 2 and mod_perl In reply to
mod_perl2 support was added in 2.2.0, so you'll have to upgrade for things to work properly.

Adrian
Quote Reply
Re: [brewt] LinksSQL 2, Apache 2 and mod_perl In reply to
Thanks - that would explain it.

I downloaded the 2.2.1 manual to see if there are likely to be any issues with this upgrade, but it's the 3.0 manual.

Anything I need to know about this upgrade?
Quote Reply
Re: [CrazyGuy] LinksSQL 2, Apache 2 and mod_perl In reply to
Well, this is still not working and I'm just going round in circles with my tech guys now.

The story so far:

Have installed LSQL 2.2.1

The mod_perl config from previous version is still implemented:
httpd.conf contains the line:
Code:
PerlRequire /home/virtual/sitexx/fst/var/www/cgi-bin/startup.pl
and that file contains
Code:
use lib '/home/virtual/sitexx/fst/var/www/cgi-bin/admin';
use Links::mod_perl;

1;

The mod_perl notes with this new version include a new snippet:

Code:
<Location /url/to/links/cgi>
SetHandler perl-script
PerlHandler Apache::Registry
PerlSendHeader On
Options +ExecCGI </Location>

BTW, the LSQL site is on a dedicated server, but is a name-based site (Ensim CP-talk) sharing an IP with other sites.

Adding that snippet to the site's config file /etc/httpd/conf/sitexx/general with the relative URL of the site's cgi-bin

Code:
<Location /cgi-bin>
SetHandler perl-script
PerlHandler Apache::Registry
PerlSendHeader On
Options +ExecCGI
</Location>
results in server errors for all cgi on that site. My tech guys maintain that Apache wants full paths not URLs and want to replace that snippet with:

Code:
<Directory /home/virtual/sitexx/fst/home/*/public_html/cgi-bin>
SetHandler perl-script
PerlHandler Apache::Registry
PerlSendHeader On
Options +ExecCGI
</Directory>

This doesn't do any harm, but LSQL still doesn't think it's running under mod_perl
Changing the first line to a more direct
<Directory /home/virtual/sitexx/fst/home/var/www/cgi-bin> makes no difference.

So at this point we're about at the end of our wits. Getting mod_perl working is pretty crucial to managing the server load. I'd be grateful to anyone who can either see any glaring faults in what we're doing, compare it with their installation, or suggest any alternatives to try.

Thanks in advance.

Last edited by:

CrazyGuy: May 31, 2005, 4:25 AM
Quote Reply
Re: [CrazyGuy] LinksSQL 2, Apache 2 and mod_perl In reply to
/home/virtual/sitexx/fst/var/www/cgi-bin/admin

You are sure, what is it a correct path. At me it raises the doubts after viewing this line:
/home/virtual/sitexx/fst/home/*/public_html/cgi-bi

What full path in Links SQL?
Answer, and I shall try to help with this problem

BR,
Bigpat

_________________________________________________________________________________________________________________
Web directory and search engine | Dirlist.net Directory - Add your link today.

Last edited by:

Bigpat: May 31, 2005, 10:25 AM
Quote Reply
Re: [Bigpat] LinksSQL 2, Apache 2 and mod_perl In reply to
Thanks

The full server path to Links SQL admin scripts is:
/home/virtual/sitexx/fst/var/www/cgi-bin/admin

The full server path to Links SQL "public" scripts (jump.cgi, add.cgi etc is
/home/virtual/sitexx/fst/var/www/cgi-bin

The path
/home/virtual/sitexx/fst/home/*/public_html/cgi-bin only confuses matters as there are various symbolic links automatically created for each site, so all paths ending ...*/public_html/cgi-bin are the same as ...var/www/cgi-bin. The tech guys used it as a "good practice" flexible catch-all, but with only one user created for the site in question, the path /home/virtual/sitexx/fst/var/www/cgi-bin can be used. However, as I say, replacing the wildcard path with this changes nothing.



Quote Reply
Re: [CrazyGuy] LinksSQL 2, Apache 2 and mod_perl In reply to
The server works under WHM (CPanel)?

Then it is necessary to change not a file httpd.conf.
Need change httpd.conf,v:

Alias /perl/ /home/virtual/sitexx/fst/var/www/cgi-bin
perlModule Apache::Registry

<Location /cgi-bin>
SetHandler startup.pl
PerlHandler Apache::Registry
PerlSendHeader On
Options ExecCGI
allow from all
</Location>

PerlRequire /home/virtual/sitexx/fst/var/www/cgi-bin/startup.pl




_________________________________________________________________________________________________________________
Web directory and search engine | Dirlist.net Directory - Add your link today.
Quote Reply
Re: [Bigpat] LinksSQL 2, Apache 2 and mod_perl In reply to
No, the server uses Ensim WebAppliance, not CPanel.

However, I think you are referring to the site-specific Apache config file - which is what /etc/httpd/conf/sitexx/general is.

Interestingly, trying to load Apache::Registry in that file threw a bunch of not found errors, prompting me to run a list of installed modules - which it turns out does not include Apache::Registry. It does however show a bunch of ModPerl:: modules including ModPerl::Registry.

So I'm now more confused than ever as to which files actually make up mod_perl.

Is there a definitive way of confirming mod_perl is actually installed and running on a server?
Quote Reply
Re: [CrazyGuy] LinksSQL 2, Apache 2 and mod_perl In reply to
Read here:
http://perl.apache.org/...r/config/config.html

BR,
Bigpat

_________________________________________________________________________________________________________________
Web directory and search engine | Dirlist.net Directory - Add your link today.

Last edited by:

Bigpat: May 31, 2005, 8:59 PM
Quote Reply
Re: [Bigpat] LinksSQL 2, Apache 2 and mod_perl In reply to
No, the docs don't really clear this up.

The startup.pl stage is working, and if I look at /perl-status I see the GT and Links scripts/modules loaded into mod_perl, but those are the admin and behind-the-scenes scripts, which may be why LSQL still says it isn't running under mod_perl.

In any case, the big load-generators we need to get into mod_perl are things like search.cgi and page.cgi.

Trying to get those to work ... all the examples I see in docs assume scripts to be run under mod_perl will be put in a /perl/ directory, but obviously the location of the GT scripts is not that. The GT docs (and your examples) refer to Apache::Registry but this is replaced in mod_perl 2 by ModPerl::Registry which has some differences.

I've restarted Apache so often today I need to leave it up for a while - probably until I find someone who has this working in a similar environment.
Quote Reply
Re: [CrazyGuy] LinksSQL 2, Apache 2 and mod_perl In reply to
Start this command and there came messages which appear after that:
/usr/local/apache/bin/apachectl start


_________________________________________________________________________________________________________________
Web directory and search engine | Dirlist.net Directory - Add your link today.