Gossamer Forum
Quote Reply
2 copies of LinksSQL
Just wondering if anyone else has had this problem. Basically, I just setup another LinksSQL install on one of my sites (a copy of the live site, so I can develop on it). Now, the main installation has mod_perl setup on it.. which seems to make a nice speed difference :)

The problem now though, seems to be that because the first (original) copy is registered with mod_perl; the other (new) one is too. This has been causing me some major headaches :(

Basically, when your restart apache;

service httpd restart

... it says its rebooting... but the startup.pl file (which is run on startup), only has;

Code:
use lib '/home/cgi-bin/admin';
use Links::mod_perl;

1;


Has anyone ever had this problem before? To me, it looks like the latest copy is using the OLD modules (in /home/cgi-bin/admin), instead of the newer ones :(

Has anyone had any experience in this?

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] 2 copies of LinksSQL In reply to
Hi Andy,

Just add another line to your startup file

use lib '/path/to/new/lib';

Laura.
Quote Reply
Re: [afinlr] 2 copies of LinksSQL In reply to
Thanks for the reply Laura. Won't that just cancel out the previously loaded "lib" though? i.e if there are;

/cgi-bin/admin/Links/Payments.pm

...and;

/cgi-bin/dev/admin/Links/Payments.pm

.. wouldn't one or the other "take over" ?

TIA for your reply.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] 2 copies of LinksSQL In reply to
Yes - you have to make sure that they are loaded in the right order so that the newest one is loaded first. See this thread: http://www.gossamer-threads.com/...i?post=263164#263164 (actually having read that it suggests that you put all the paths into one command). It applies just as much to multiple installations as different applications.

Laura.
Quote Reply
Re: [afinlr] 2 copies of LinksSQL In reply to
Thanks. So something like;

Code:
use lib '/home/cgi-bin/admin',
'/home/cgi-bin/sitebuilder/admin';
use Links::mod_perl;

1;

.. but it doesn't seem to work :/ (no errors, but it still seems to be using /home/cgi-bin/admin as the main lib file).

Thanks for your help so far.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] 2 copies of LinksSQL In reply to
I think you want the paths the other way round.

Before you do this though - as far as I understand both installations will then use the first path except for extra modules like plugins. If you are trying to change one pm file so that it is only used in one installation, I don't think you can do that under mod_perl.
Quote Reply
Re: [afinlr] 2 copies of LinksSQL In reply to
Is it possible to just "turn off" mod_perl for a copy of LSQL? Maybe a setting somewhere I'm missing? Developing on a non-mod_perl enviroment would make my life a million times easier :) (as I'm sure you can vouch for).

Thanks for your help on this.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] 2 copies of LinksSQL In reply to
It depends how you have set up mod_perl. In your httpd_conf file you must have something that says what should be run under mod perl. So you could just change this so that it doesn't include your new installation.
Quote Reply
Re: [Andy] 2 copies of LinksSQL In reply to
Are you attempting to run two different versions of Links SQL under mod_perl? That won't work (I've updated the mod_perl guide post to indicate this, as it has come up before). Assuming you're trying to play with multiple versions, I recommend taking the testing one _out_ of mod_perl, at least until the main one is upgraded to the same version.

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [Jagerman] 2 copies of LinksSQL In reply to
In Reply To:
Are you attempting to run two different versions of Links SQL under mod_perl? That won't work (I've updated the mod_perl guide post to indicate this, as it has come up before). Assuming you're trying to play with multiple versions, I recommend taking the testing one _out_ of mod_perl, at least until the main one is upgraded to the same version.

Exactly. Unfortunatly, I don't know how to stop mod_perl from being used in the dev version. Are there specific files in LSQL that I can just edit?

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] 2 copies of LinksSQL In reply to
Unfortunately it's very specific to your apache configuration. The easiest thing might be to simply install Links SQL in a /cgi-bin instead of a /perl path.

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [Jagerman] 2 copies of LinksSQL In reply to
Doh :(

Quote:
The easiest thing might be to simply install Links SQL in a /cgi-bin instead of a /perl path.

And that means? ;) This isn't on my GT server BTW.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] 2 copies of LinksSQL In reply to
Hi Andy,

You need to go back to when you were setting up mod_perl in your httpd.conf file and see how you told it which files to run under mod_perl. As Jason indicated, you *probably* added a directive to say that everything under /perl should be run under mod_perl - but it really depends what you actually did.
Quote Reply
Re: [afinlr] 2 copies of LinksSQL In reply to
Thnks. I've managed to get it going now. I'm not getting an error when restarting Apache though;

Code:
[root@dot2 root]# service httpd restart
Stopping httpd: [ OK ]
Starting httpd:
Preloading Links SQL modules into mod_perl:
. . . . . . . .
All modules loaded ok!
Compiling all functions ... All modules compiled and loaded okay!

[Thu Jun 24 14:47:17 2004] [alert] httpd: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
[ OK ]

The only occurence of 127.0.0.1 I can find is;

Code:
#
# ServerName allows you to set a host name which is sent back to clients for
# your server if it's different than the one the program would get (i.e., use
# "www" instead of the host's real name).
#
# Note: You cannot just invent host names and hope they work. The name you
# define here must be a valid DNS name for your host. If you don't understand
# this, ask your network administrator.
# If your host doesn't have a registered DNS name, enter its IP address here.
# You will have to access it by its address (e.g., http://123.45.67.89/)
# anyway, and this will make redirections work in a sensible way.
#
# 127.0.0.1 is the TCP/IP local loop-back address, often named localhost. Your
# machine always knows itself by this address. If you use Apache strictly for
# local testing and development, you may use 127.0.0.1 as the server name.
#
#ServerName localhost

Any ideas? :/ ( as you can tell, I'm a mod_perl virgin ;)).

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] 2 copies of LinksSQL In reply to
Just had this from the server guy;

Quote:
You could either try adding an entry in /etc/hosts for the server's IP address or add a ServerName directive to the httpd.conf file.

FTP doesn't seem to be working at all now :( (apache is running, and sites/perl scripts all show up fine) ... Unsure

TIA

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [afinlr] 2 copies of LinksSQL In reply to
Fixed it :)

/etc/hosts (for future reference);

Code:
# Do not remove the following line, or various programs
# that require network functionality will fail.
195.188.15.121 dot2.domain.net dot2
127.0.0.1 localhost.localdomain localhost

Thanks for everyones help on this :)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] 2 copies of LinksSQL In reply to
ServerName should be set.

In my case I have:
ServerName theukhighstreet.com

Edit: Or change the hosts file! Wink

Last edited by:

afinlr: Jun 24, 2004, 7:35 AM