Solved

Points  for  AHOFFMAN

Posted on 2002-04-25
12
189 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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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). #…
If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

708 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

17 Experts available now in Live!

Get 1:1 Help Now