Solved

Help!!! HTDIG /Apache Set up

Posted on 2003-12-06
16
566 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Quiz: What Do These Organizations Have In Common?

Hint: Their teams ended up taking quizzes, too.

 
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
 
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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

729 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