Solved

Help!!! HTDIG /Apache Set up

Posted on 2003-12-06
16
559 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
> .. 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
Comment Utility
-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
Comment Utility
did you try from command line when logged in as user that owns/runs httpd?
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
LVL 2

Author Comment

by:xybx
Comment Utility
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
Comment Utility
this is exactly what I told you: login as user which runs httpd
0
 
LVL 51

Expert Comment

by:ahoffmann
Comment Utility
<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
Comment Utility
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
Comment Utility
> 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
Comment Utility
Nah... It is not worth arguing over. I'll accept that you helped with that aspect.

regards,
0
 
LVL 51

Expert Comment

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

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

772 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

12 Experts available now in Live!

Get 1:1 Help Now