Operating System - OpenVMS
1753789 Members
7351 Online
108799 Solutions
New Discussion юеВ

Re: CGI problem with CSWS

 
Jim Crafton
New Member

CGI problem with CSWS

Hi, I've been assigned the task of tracking down a problem with our Apache (version Apache/2.0.52) install on OpenVMS. The server seems to work fine, and I can access regular html files fine. However cgi scripts don't seem to work at all. When you enter a URL into the browser, or through a telnet session, you get nothing at all back. No entry is made in the access_log, error_log, or cgi_log files.

In our httpd.conf we have the default cgibin directory specified:

ScriptAlias /cgi-bin/ "/apache$root/cgi-bin/"

I have made sure that the directory is marked as [rwe, rwe, rwe, rwe] in terms of file protection. Ditto for the actual files inside that I'm trying to execute. The files will run from a command line, and output the expected text.

The directory spec in the conf file is as follows:


AllowOverride None
Options None
Order allow,deny
Allow from all


Loglevel is set at "debug"

suExec is *not* enabled if this matters.

I've installed Apache on unix and windows machiens before without a hitch, so I'm completely lost as to what's going on, and I'm not very familiar with OpenVMS.

Any help would be most appreciated!

Thanks

Jim
11 REPLIES 11
Steven Schweda
Honored Contributor

Re: CGI problem with CSWS

> [...] [rwe, rwe, rwe, rwe] [...]

This looks like a very bad idea, but
otherwise it all looks about like mine.
Around here (old version, 1.x):

alp $ dire /owne /prot APACHE$COMMON:[000000]CGI-BIN

Directory APACHE$COMMON:[000000]

CGI-BIN.DIR;1 [AP_HTTPD,APACHE$WWW] (RWE,RWE,,)

alp $ dire /owne /prot APACHE$COMMON:[CGI-BIN];

Directory APACHE$COMMON:[CGI-BIN]

AUTHOR.DLL;8 [AP_HTTPD,APACHE$WWW] (RWED,RWED,RE,RE)
AUTHOR.EXE;8 [AP_HTTPD,APACHE$WWW] (RWED,RWED,RE,RE)
[...]


I don't know about this one, but some
programs refuse to deal with executables to
which anyone on the planet can write.
Jim Crafton
New Member

Re: CGI problem with CSWS

Steven,

Thanks, I know the global rwe permissions aren't good, but I've been just trying things to get it to work at all. At this point I'm giving up in defeat unless someone else points something out. Even the simplest DCL script fails to run, i.e. a file like this:

test.cgi:
$write sys$output ""
$write sys$output "Hello World"
$write sys$output ""
$ exit

Works from a command line, but then accessed via URL, nothing is sent back, and nothing appears to be executed, it's as if the request just disappears into a black hole (unix's /dev/null).
Hoff
Honored Contributor

Re: CGI problem with CSWS

Reposting as ITRC (again) blew up. Apparently ITRC decided I wasn't logged in, in mid-submit. Go figure.

Given the gremlins I see after the websites I manage, any directories that are owned by or that are otherwise writable by the web server is a Bad Idea. A Very Bad Idea.

My preference is to use an ACE to grant the web server read access (or read and execute for the CGI pieces) to the web-related directories. I use the same technique on the Unix boxes.

As for your question, have a read through Neil Rieck's notes on OpenVMS Apache and Tomcat and such:

http://www3.sympatico.ca/n.rieck/docs/openvms_notes_apache.html

Then (also) check the Apache server logs.

If you're not specifically tied to Apache, then (like Unix offers nginx, lighttpd and such) OpenVMS has the WASD web server available:

http://wasd.vsm.com.au/

I have some DCL CGI posted to my site, but Neil's stuff and the Apache logs should get you going.

Stephen Hoffman
HoffmanLabs LLC
Jim Crafton
New Member

Re: CGI problem with CSWS

I'll check out the link. Unfortunately, absolutely *nothing* is being written to any of the apache logs for any cgi URL request. So access_log, error_log, and cgi_log are all unchanged. I have set the logging level to "debug", so theoretically I should be getting pretty much everything. And for normal URL requests I do see entries made in the access_log or error_log (if it's a bogus url). But for anything in the cgi-bin directory, absolutely nothing.
Is there no way to tell if the file is being executed?

Thanks

Jim
Steven Schweda
Honored Contributor

Re: CGI problem with CSWS

> [...] Unfortunately, absolutely *nothing*
> is being written to any of the apache logs
> for any cgi URL request. [...]

Are you flushing the logs? I'm still running
the older 1.x server, and it had a defect
where the obvious flush operation

@ SYS$STARTUP:APACHE$STARTUP.COM FLUSH

tended to lose log data, but

@ SYS$STARTUP:APACHE$STARTUP.COM graceful

is pretty effective.

> Works from a command line, but then
> accessed via URL, nothing is sent back,

Well, yeah, but it's not really sending back
a proper response, is it? I seem to have an

APACHE$COMMON:[CGI-BIN]TEST-CGI-VMS.COM

which, I assume, came with the Web server,
and which works as expected. If you don't
have one, let me know.

> [...] I'm not very familiar with OpenVMS.

For an explanation of what all that f$fao()
stuff is doing, try:

HELP Lexicals F$FAO *

In particular:
[...]
Special formatting:
!/ None Inserts a carriage return and a line
feed.
[...]

I believe that the CR may be important in
HTTP.
Steven Schweda
Honored Contributor

Re: CGI problem with CSWS

Oh, yeah.

> Is there no way to tell if the file is
> being executed?

It's DCL, so it could do things like create
a file, or send e-mail, or any number of
detectable things.
Jim Crafton
New Member

Re: CGI problem with CSWS

Yes, I have the "TEST-CGI-VMS.COM" file, and again, it does run correctly from the interactive commandline, but when requested in a URL, nothing happens, no data is returned at all, and no data is written to any of the logs, no matter what I do in terms of trying to execute cgi scripts.
In the 2.x apache series the flush option is non-existant, and the graceful option, according to the start.com file, is used to gracefully restart the server. It didn't make any difference.
I have no doubt this will be something mind-numbingly obvious once I find it, but until then I'm up the creek without a paddle.
Hoff
Honored Contributor

Re: CGI problem with CSWS

Please post (attach) the (whole) HTTPD.CONF file.

When "No entry is made in the access_log, error_log, or cgi_log files", is that no entries are made for anything, or is that no entries for (just) the CGI requests?

Are the directory ownership and protection settings correct, from the CGI directory all the way up? The upper levels will need at least execute-only access, or read-execute, for the Apache user.

Jim Crafton
New Member

Re: CGI problem with CSWS

the cgi-bin directory is marked (rwe,rwe,rwe,rwe). Yes I'm aware this is bad, but for the moment I'm just trying to get the damn thing to work.

No entries in the various log files are made for any cgi related request. A regular HTML request for a file from the htdoc dir will show as expected.

I've attached the httpd.conf file.