Solved

Points  for  AHOFFMAN

Posted on 2002-04-25
12
191 Views
Last Modified: 2010-03-04
Points for help with question.
0
Comment
Question by:kipper7
  • 5
  • 4
  • 3
12 Comments
 
LVL 51

Expert Comment

by:ahoffmann
ID: 6969467
ok, lets continue. I'll try to earn these points ;-)
-------

IIRC the script seems to make trouble when called from apache only. So try following:

  1. login as that user which is used to run apache's httpd
     start the script as follows:  /full/path/to/script
     check if it realy produces what you expect

  2. (if 1. succeded)
     modify the script as follows (please post result then):
     $|=1; # flush output (place this before very first print statement)
     print "<BR>Row:$rowcount<BR>"; $rowcount++; # place this inside the foreach where you process @users
0
 

Author Comment

by:kipper7
ID: 6969711
Thanks
In that case I will bump up the pts :-)
0
 

Author Comment

by:kipper7
ID: 6969734
< . login as that user which is used to run apache's httpd
    start the script as follows:  /full/path/to/script
    check if it realy produces what you expect
>

did that and it works fine (from command line).

< modify the script as follows (please post result then):
    $|=1; # flush output (place this before very first print statement)
    print "<BR>Row:$rowcount<BR>"; $rowcount++; # place this inside the foreach where you process @users >

already tried this (from apache faq), did not work. in fact the addition of the $|=1; no matter where I put it results in no ouptut( from browser). from command line, stil works fine.


0
Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
LVL 51

Accepted Solution

by:
ahoffmann earned 300 total points
ID: 6969773
# have adapted your method of identing reply strings :-)

< did that and it works fine (from command line). >
fine.

< .. $|=1; ... id not work .. >
so I assume that you get no result at all.
This points to my very first comment, you remember?
     "script did not return within server timeout"

In this case we need to have a look into th eworld of debugging inter-process communication ...
Please modify your script in that way that you open a debug/log file, then write each mesage printed on STDOUT to this file too, something like:

     open(F,">/tmp/cgi.log") or print "open cgi.log failed";
     print F "Start logging here at date";

then add a "print F ..." statement in your foreach loop

I'm shure you test this from command line first, as usual ;-)
0
 
LVL 15

Expert Comment

by:samri
ID: 6970279
I thought that this is suppose to be a "here I am", "Accept Comment as Answer" and go home with the pts".  Just kidding guys.


You can try to use mod_cgi
http://httpd.apache.org/docs/mod/mod_cgi.html

* I tried, and it never worked! According to the docs, it should work.

cheers.
0
 
LVL 15

Expert Comment

by:samri
ID: 6970615
kipper,

The scripts works fine, the only difference is originally userid:apache has /bin/false as shell, I just changed it to /bin/sh

OS: rh7.2, apache 1.3.20


0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 6970626
< comment by samri
  perhaps maybe some information in your passwd file that break the <table> tag.  Remember that some properties
                           like homedir, or shell do contain "/", which might have conflicted the HTML tag.
>

I also thought of a problem here, for example if a user is named ROW or TABLE, 'cause of:
     print <<ROW
unusual, but worth a check.
0
 
LVL 15

Expert Comment

by:samri
ID: 6970692
perhaps you could try to revise the code to instead of using

print TABLE;
.
.
TABLE

to
print "<table>\n";
print "<tr>..
.
.
print "</table>\n";

This might reduce the possibilities as commented by ahoffman.
0
 

Author Comment

by:kipper7
ID: 6971266
OK
Have already tried inserting debugging print statments and creating log files. the log files show no problems. the problem is only when trying to display all the data at the browser (thru apache).

the ideas about the table tags are good, but remember this worked fine a few days ago, which leads me further to believe that it is a system problem  or i need to reinstall apache. gonna wait for the next reboot and see what happens. in the meantime I made a plain vanilla script that uses no HTML formatting, so the users can at least get the information they need, not pretty but gets the job done.

Thanks again
0
 

Author Comment

by:kipper7
ID: 6971277
Here is something interesting. If I restart apache, and run the script from the browser it works fine ..ONCE !!
as soon as me or a user tries to run it again, it craps out at the 40th row again !!!

Wierd !!
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 6971972
sounds like a caching problem.

< .. he log files show no problems. >
does this mean that all rows are in the logfile?

BTW, THANKS for grading.
0
 

Author Comment

by:kipper7
ID: 6986076
upgraded to apache 2.0.35 and now works fine !!!
Go figure !
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In my time as an SEO for the last 2 years and in the questions I have assisted with on here I have always seen the need to redirect from non-www urls to their www versions. For instance redirecting http://domain.com (http://domain.com) to http…
If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question