Solved

Help!!! HTDIG /Apache Set up

Posted on 2003-12-06
16
560 Views
Last Modified: 2013-11-18
I am just trying to get HTDIG searching from the web site. I can run scripts from the CGI-BIN directory (aside from HTSEARCH), and can run htsearch from the command line.


I get "500 - Premature end of script headers: htsearch" when running from a browser. I know that I must have something wrong in my httpd.conf, but I have no idea what. I'm totally Linux newbie-- so don't kill me on this.

My virtual host is as follows:

# WWW
NameVirtualHost ip:80
<VirtualHost ip:80>
    Options All +Includes +Multiviews +FollowSymLinks +ExecCGI
    XBitHack On
    AddoutputFilter INCLUDES .html .shtml
    DirectoryIndex index.html
    ServerAdmin webmaster@site.url
    DocumentRoot /var/www/site
    ServerName www.site.url
    ErrorLog logs/error.log
    CustomLog logs/access.log common
    ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
        <Directory "/var/www/site">
                AllowOverride None
                DAV Off
                Options All +MultiViews +Indexes +Includes FollowSymLinks +ExecCGI
                Order allow,deny
                Allow from all
                AddType text/html .html
                AddoutputFilter INCLUDES .html
                XBitHack On
        </Directory>
        <Directory "/var/www/cgi-bin">
                AlloWOverride None
                #Options +Exec
                Options All +MultiViews +ExecCGI -Indexes
                #Order allow,deny
                Allow from all
        </Directory>
</VirtualHost>


Any help is greatly appreciated.

Thank You
0
Comment
Question by:xybx
  • 8
  • 6
16 Comments
 
LVL 51

Expert Comment

by:ahoffmann
ID: 9888364
500 error indicates either that your script does not produce a valid header (most likely Content-Type), or that it does not finish within apache's timeout
0
 
LVL 2

Author Comment

by:xybx
ID: 9891214
Great. So what do I do to change either of those? I do believe that the error is related to content, but I do not know what to do about it.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 9891656
probably your htdig index file is not good enough, so that search queries take too long.
First check your servers log-files about error messages, also check htdig's log files.
please post relevant messages.
0
 
LVL 2

Author Comment

by:xybx
ID: 9893620
No, it is not about timeouts. This error occurs so fast, that could not be the problem.

The problem, I can almost guarantee, is in the HTTPD.CONF. 500 is a permissions/execute error. I can search from the command line fine.

Here's the error message (frustrating- I get more details on a Windows box):

Premature end of script headers: htsearch

<rant>
That's it! I have endlessly searched on this subject, and no one seems to have any details on how to set this up with Apache.
</rant>

Thanks for your help.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 9895279
> .. 500 is a permissions/execute error.
sometimes.

> I can search from the command line fine.
ok, does it work if you logged in as the user which is used to run apache itself?
Does the file have read and execute permissions?

As said befor: simply look at your log files, the answer, or at least a hint to it, can be found there.
0
 
LVL 2

Author Comment

by:xybx
ID: 9896763
-HTDIG does not keep log files that I know of. Apache only has 'Premature end of script headers: htsearch' in the log. Searching on that error has not brought me to the answer.
-The file has r+x

The problem is in the Apache config file I am pretty sure-- since it searches from the command line and not on the web site. The error occurrs so fast, that I doubt it has anything to do with HTDIG- and I get a 500 which is some form of internal server error.

0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 9897494
did you try from command line when logged in as user that owns/runs httpd?
0
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
LVL 2

Author Comment

by:xybx
ID: 9901834
I ended u solving it another way, but thanks for your help- it ended up being that I had two binaries installed on the system. When I ran it from the command line, of course it worked because it was in the system path. However, the one inside of my cgi-bin was not correct- so I replaced it and it worked.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 9902621
this is exactly what I told you: login as user which runs httpd
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 9902978
<off-topic>
AnnieMod, well done, unambiguous, comment, should be in the list of recommended comments for CVs, Mods, PEs
</off-topic>
0
 
LVL 2

Author Comment

by:xybx
ID: 9904521
I'm telling you that I solved the problem myself. Your suggestion to login as the HTTPD user did not solve my problem. My problem was one where I had duplicate copies of the same executable- and didn't think to run them from the local directory. How did you assist me in that?

If I'm wrong, I'll gladly give you the points.
0
 
LVL 51

Accepted Solution

by:
ahoffmann earned 250 total points
ID: 9904592
> How did you assist me in that?
'cause I assumed that either the PATH and/or the permissions to/on htdig are wrong for user HTTPD, but are correct for another user.
My suggestion does not hit the bulls eye, but it should have shown the right direction.
If you still don't agree, delte the question.
0
 
LVL 2

Author Comment

by:xybx
ID: 9904711
Nah... It is not worth arguing over. I'll accept that you helped with that aspect.

regards,
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 9904723
THANKS.
giving an A was more than fair ;-)
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Preface In the first article: A Better Website Login System (http://www.experts-exchange.com/A_2902.html) I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

914 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

21 Experts available now in Live!

Get 1:1 Help Now