Cann't connect to DB from WEB server

Cann't connect to DB from WEB server

Post by Nebojsa Sev » Wed, 28 Mar 2001 23:25:40



I wrote PERL script index.cgi that connects to my DB and do some job.
Everything is working OK when I run script from command line. But when I try to
execute that script from my Internet Explorer I can not connect to Informix
server. Why?
I am working as user ROOT and user have correct environment (it works on command
line). User ROOT run WEB server.
My configuration:
SERVER:
        Digital Unix
        Netscape Enterprise Server
        Informix 7.3x
        Perl Version 5.006
        DBI Version 1.14
        DBD::Informix Version 1.00.PC1    

CLIENT:
        Microsoft Internet Explorer 5.5

 
 
 

Cann't connect to DB from WEB server

Post by Sergey E. Volko » Thu, 29 Mar 2001 16:06:23


I don't know about Netscape Enterprise Server, but Appache for example make
all jobs as anonimous user.



Quote:> I wrote PERL script index.cgi that connects to my DB and do some job.
> Everything is working OK when I run script from command line. But when I
try to
> execute that script from my Internet Explorer I can not connect to
Informix
> server. Why?
> I am working as user ROOT and user have correct environment (it works on
command
> line). User ROOT run WEB server.
> My configuration:
> SERVER:
> Digital Unix
> Netscape Enterprise Server
> Informix 7.3x
> Perl Version 5.006
> DBI Version 1.14
> DBD::Informix Version 1.00.PC1

> CLIENT:
> Microsoft Internet Explorer 5.5


 
 
 

Cann't connect to DB from WEB server

Post by Jonathan Leffle » Thu, 29 Mar 2001 17:16:03



> I wrote PERL script index.cgi that connects to my DB and do some job.
> Everything is working OK when I run script from command line.

This is normal.

Quote:> But when I try to
> execute that script from my Internet Explorer I can not connect to Informix
> server. Why?

Because the environment is wrong.

Quote:> I am working as user ROOT and user have correct environment (it works on command
> line).

Not relevant.  The environment set by the web server is totally different from
anything it inherited.  Check the cgi-bin/printenv script, for example.  Also, as
Sergey commented, you are probably not running the web server as root -- more likely
as nobody.

Let's put it like this, if your httpd.conf file says that Apache is to run as root,
I strongly recommend going and finding a job cleaning sewers now -- your machine
will not survive an attack from hackers.

When there's a problem with accessing something Informix-related from the web, it is
safe to assume that the problem is environment unless you know you've had the
environment working previously.

Quote:> User ROOT run WEB server.
> My configuration:
> SERVER:
>         Digital Unix
>         Netscape Enterprise Server
>         Informix 7.3x
>         Perl Version 5.006
>         DBI Version 1.14
>         DBD::Informix Version 1.00.PC1

> CLIENT:
>         Microsoft Internet Explorer 5.5

--

Guardian of DBD::Informix 1.00.PC1 -- see http://www.cpan.org/
#include <disclaimer.h>
 
 
 

Cann't connect to DB from WEB server

Post by Paul Watso » Thu, 29 Mar 2001 17:29:43



> I wrote PERL script index.cgi that connects to my DB and do some job.
> Everything is working OK when I run script from command line. But when I try to
> execute that script from my Internet Explorer I can not connect to Informix
> server. Why?

I take it that Netscape is configured to deliver cgi from  that
directory??

If this is the case then your environment for the perl script is wrong,
when
run from the Web.  Either start the Webserver with the correct
environment,
exported obviously, or get the Perl to set it correctly

Quote:> I am working as user ROOT and user have correct environment (it works on command
> line). User ROOT run WEB server.

Never ever ever run a Web Server has root!!!  

Quote:> My configuration:
> SERVER:
>         Digital Unix
>         Netscape Enterprise Server
>         Informix 7.3x
>         Perl Version 5.006
>         DBI Version 1.14
>         DBD::Informix Version 1.00.PC1

> CLIENT:
>         Microsoft Internet Explorer 5.5

--
Paul Watson             #          
Oninit Ltd              # You are only young once
Tel: +44 1436 672201    # but you can be immature
Fax: +44 1436 678693    # for ever
www.oninit.com          #
 
 
 

Cann't connect to DB from WEB server

Post by Paul Watso » Thu, 29 Mar 2001 20:28:45



> I don't know about Netscape Enterprise Server, but Appache for example make
> all jobs as anonimous user.

Only if you tell it too - the user is specified in httpd.conf, you can
change it to any valid (local??) user
[cutting]

--
Paul Watson             #          
Oninit Ltd              # You are only young once
Tel: +44 1436 672201    # but you can be immature
Fax: +44 1436 678693    # for ever
www.oninit.com          #

 
 
 

Cann't connect to DB from WEB server

Post by Nebojsa Sev » Fri, 30 Mar 2001 16:20:43




1. There is NO httpd.conf file in Netscape Enterprise Sever.
2. I am just beginer but I know that it isn't smart to act as user ROOT on
Internet. I didn't know how to set env. variables to connect to Informix DB as
user nobody so I try as root.


>> I wrote PERL script index.cgi that connects to my DB and do some job.
>> Everything is working OK when I run script from command line.

>This is normal.

>> But when I try to
>> execute that script from my Internet Explorer I can not connect to Informix
>> server. Why?

>Because the environment is wrong.

>> I am working as user ROOT and user have correct environment (it works on command
>> line).

>Not relevant.  The environment set by the web server is totally different from
>anything it inherited.  Check the cgi-bin/printenv script, for example.  Also, as
>Sergey commented, you are probably not running the web server as root -- more likely
>as nobody.

>Let's put it like this, if your httpd.conf file says that Apache is to run as root,
>I strongly recommend going and finding a job cleaning sewers now -- your machine
>will not survive an attack from hackers.

>When there's a problem with accessing something Informix-related from the web, it is
>safe to assume that the problem is environment unless you know you've had the
>environment working previously.

>> User ROOT run WEB server.
>> My configuration:
>> SERVER:
>>         Digital Unix
>>         Netscape Enterprise Server
>>         Informix 7.3x
>>         Perl Version 5.006
>>         DBI Version 1.14
>>         DBD::Informix Version 1.00.PC1

>> CLIENT:
>>         Microsoft Internet Explorer 5.5

 
 
 

Cann't connect to DB from WEB server

Post by Paul Watso » Fri, 30 Mar 2001 17:22:59





> 1. There is NO httpd.conf file in Netscape Enterprise Sever.

No but there is an equivalent, <something>.obj from what I remember.
Also there is an equivalent of printenv, which will show you the
environment that Netscape is running in. Somewhere in the admin side
of Netscape there is the option to set the user for running the site
but I don't have access to Netscape admin from here.

Quote:> 2. I am just beginer but I know that it isn't smart to act as user ROOT on
> Internet. I didn't know how to set env. variables to connect to Informix DB as
> user nobody so I try as root.

You do this in Perl then

my($ixdir)  = "/home/informix";
$ENV{INFORMIXDIR}="$ixdr"; unless (defined ($ENV{INFORMIXDIR}));

basically if INFORMIXDIR is not set then set it to /home/informix

[cutting]

--
Paul Watson             #          
Oninit Ltd              # You are only young once
Tel: +44 1436 672201    # but you can be immature
Fax: +44 1436 678693    # for ever
www.oninit.com          #

 
 
 

1. When the ftp task cann't connect server,I can't continue the step

hi

   I get the file from 4 ftp servers programmatically and
if one ftp server is closed I plan to write the ftp name
to a table.

   But when ftp task cann't connect the ftp server,the
process will not stop for ever.So i cann't get the failure
info to continue the next task.

   Who can tell my Why?

   If i should use Execute Process task to do it ,can you
tell me the full steps?I can do the ftp.exe manually,just
cann't programmatically.

    I apprciate any help!!!!!!!
                    Chris Y

2. Lost French Letters

3. Cann't Insert, Update, Delete to DB on SQL Server

4. Toolbar changes not always working

5. Can't connect to oracle db from web/servlet server

6. Looking for utility

7. cann't run stored_proc on a transfered DB

8. Datawerehouse and Oracle

9. IIS web server can not connect to DB server

10. Connecting to SQL Server DB on web server

11. Cann't start MSSQL Server Service

12. cann't install MS SQL Server 2000