Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Help!!! HTDIG /Apache Set up

Posted on 2003-12-06
16
Medium Priority
?
568 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
Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

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

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

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

I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses

721 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