Click to See Complete Forum and Search --> : apache2 and html files from cgi-bin


q933i
08-23-2004, 05:43 PM
Hi, I have apache2 installed and configured successfully for use with ssl and php4. I installed courier (mail server), which requires the courierwebadmin software to reside in /var/www/localhost/cgi-bin/courierwebadmin/. Scripts work find from that directory, but the html files for the admin interface also live along with the scripts. Separating them breaks them, so I'm wondering if anyone knows a way to make apache display html files from cgi-bin! Thanks in advance to anyone who does. Elinor

bwkaz
08-23-2004, 09:16 PM
What does Apache do when you try it as-is?

q933i
08-24-2004, 02:12 PM
It gives me the misconfiguration error in the browser. Premature end of script headers in error_log.

bwkaz
08-24-2004, 07:30 PM
Hmm... almost sounds like Apache is feeding it off to something as a script instead of realizing that it's a text/html file.

Not sure how to fix it, exactly, either... it looks like the fact that a ScriptAlias exists for your /cgi-bin/ directory makes Apache feed everything through an interpreter. I don't know how it would decide which interpreter to use, though... hmm...

Maybe try to remove the ScriptAlias (make it a normal Alias) and then turn on ExecCGI in the Options directive in the appropriate <Directory> section?

q933i
08-25-2004, 05:36 PM
Thanks for your reply. That made perfect sense. When I created the regular alias (not the script alias), it was able to dislpay the html file. Sadly, however, as soon as I enabled CGI in that directory, it broke it again. It was no longer able to display the html file, and the browser gave back the same system configuration error. Any other ideas?

bwkaz
08-25-2004, 06:48 PM
Hmm... no, not really... :(

Anybody?

Maybe you could hack up the HTML files (and actually all the other CGI files also) themselves to be able to separate them?

q933i
08-26-2004, 10:53 AM
Thanks, it worked to use the SetHandler directive within the directory, but it would no longer display the html files. So, I used the following directly from Apache.org's tutorial on CGI. I didn't work to enable CGI at all:

<Directory /usr/local/apache2/htdocs/somedir>
Options +ExecCGI
</Directory>

So, I give up. There is something special about that directory, it would seem. I will configure Courier by hand rather than by Courierwebadmin. Thanks for your help though. Elinor