Solved

Points  for  AHOFFMAN

Posted on 2002-04-25
12
190 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
 
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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
MDB2 Error: not found 4 157
Forward apache log to Syslog-NG 7 78
Xampp Not Stopping 9 40
Apache,  not running php on top level 14 59
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…
Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

912 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

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now