Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

logicals and APACHE

Willem Grooters
Honored Contributor

logicals and APACHE

Suppose several versions of an application, where both programs and data are fully, or in part, seperated. But all versions use the same logicals, referring to their execuatble- and datapaths. Some are /SYSTEM, others are /JOB, or /PROCESS.
For web-access, there is ONE document root for al versions, one index.html file that allows the user to choose the version, and one CGI-procedure that handles ALL requests. Each appliaction version has a tree below Apache, but that contains only the files required to create HTML output.
After the user has chosen the version to work in, everything is handled by that CGI-script; all references are passing that proceduree because the right environemnt needs to be set.
It implies that there is NO direct reference to the data and executable environment of the appliaction, and therefore there is no reference in httpd.conf to the appliaction versions.
Hyperlinks to graphical data (images) however could not be handled that way (see http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=972859) there IS a requirement.
Images are located in a location pointed to by process logical BPS$FOTO. A plain line:
imgnam.jpg doesn't work, since there is no reference to this location in httpd.conf.
imgnam.jpg van be used byt MUST be handled by the script - but that failed.
When BPS$FOTO is defined in httpd.conf, as:
Alias /bps$foto/ "/BPS$FOTO/"
I get "Forbidden" - since BPS$FOTO is NOT a system logical - and cannot be (because it is version dependent). So the definition of a version-independent alias is NOT possible. You must specify:
Alias BPS$FOTO_ "///FOTO/" or similar, and references must be likewise....

Makes sense - since the file will be read by Apache at startup - but it is a limitation I would like to get rid off.

any ideas?
Willem Grooters
OpenVMS Developer & System Manager
5 REPLIES
Anton van Ruitenbeek
Trusted Contributor

Re: logicals and APACHE

Willem,

First: Get rid off the '$' logicals. These are DIGITAL/HP depended.
Second: Is there a possibility to do this bij JOB or GROUP logicals ? I'm thinking this because sometimes this are executed in a job and subprocesses by Apache. The first you are using must be in the .CONF .
So BPS$FOTO must bij in the CONF. Maybe you can make a common top, and per version (possible logical) share beneath it.

AvR
NL: Meten is weten, maar je moet weten hoe te meten! - UK: Measuremets is knowledge, but you need to know how to measure !
Willem Grooters
Honored Contributor

Re: logicals and APACHE

I know that logicals containing "$" are "better not used" because it _may_ cause a conflict with Digital/Compaq/HP-used logicals. But you can safely use them, if no conflict exists. After all, a "$" is just some character, and it has a meaning in the application environment and has so for the last 10 years - at least; it tells system management this is a required logical ;-)

I have thought of defining BPS$FOTO /SYSTEM, or /GROUP, and give it some fake contents on starttime, but that wouldn't work either. The problem seems to be that at runtime, the location, rererenced by the logical in the HTML file must be the same location as aliassed in httpd.conf. For example:
Alias /BPS$FOTO/ "/APPLROOT/FOTO/" in httpd.conf, requires at runtime that BPS$FOTO, as used in "href="BPS$FOTO:...""
refers to APPLROOT:[FOTO] as well.
You _may_ think that APPLROOT could be set in the CGI-script, but I found that to be impossible. Odd, non-VMS indeed, but in some respect, obvious, because you will have to tell Apache also, how that directory should be handled:

(statements concering browsability and access)

This is loaded at startup, and therefore, APPLROOT _must_be_known_ at start time otherwise Apache won't start. Hence, APPLROOT must be defined at least as /GROUP (that is: AP_HTTPD), and another value for APPLROOT at run-time is not possible. "Forbidden" - as the page says.

So if APPLROOT has to refer to different (in my case: version dependent) locations, you have to define a APPLROOT_ Alias line for each version in httpd.conf, and add each directory as stated above. In the HTML output, use the appropiate reference in the href-lines. The second is no problem at all (I have the version at hand so I can generate the right name) but I simply dislike the requirement of multiple references to application-based, version dependent locations in httpd.conf.
It would be nice if Apache could handle the differences on the fly. But 1.34 cannot and I doubt 2.0 can (and I fear 2.1 won't be able to cope with this either)

BTW - I found a way to get around it - have all dependencies handled by the CGI-scripts, so I could remove all dependencies from httpd.conf.
Willem Grooters
OpenVMS Developer & System Manager
Jan van den Ende
Honored Contributor

Re: logicals and APACHE

Willem,


This is loaded at startup, and therefore, APPLROOT _must_be_known_ at start time otherwise Apache won't start.


Just an idea, which may or may not work, but have you tried defining the version logical /TRANS=CONC.
If it really gets physically loaded at boot, this will not help, but if part of it is handled by native VMS, the description IN APACHE MEMORY does not change, so you WILL get the value as valid during use.
If however that value gets cached, you will never be able to use any tranlated version...
Maybe worth a try, but no promises!

Another reason to implement using RMS into CSWS :-)

fwiw,

Proost.

Have one on me.

jpe
Don't rust yours pelled jacker to fine doll missed aches.
Willem Grooters
Honored Contributor

Re: logicals and APACHE

Retried:

in httpd.conf:
...
Alias /bps$foto/ "/BPS$FOTO/"

Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all

...
(Ok, apache does start - whether BPS$FOTO is defined or not)
Now access the application, choose this version (2004a), and now the CGI-script will $ DEFINE BPS$FOTO dka200:[BPS.2004a.FOTO], and generate a reference in HTML containing:

1234AA

Click on the hyperlink, got "Forbidden".

in Httpd.conf:

Alias /bps_foto/ "/BPS$FOTO/"

Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all


and in HTML:

1234AA

does the same.

But if in httpd.conf:

Alias /bps$foto_2004a/ "/dka200/bps/2004a/foto/"

Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all


and the reference is:
1234AA

I get my picture.

using system logicals is no problem since the application is under apache$root, also used:

ScriptAlias /cgi-bin/ "/apache$root/cgi-bin/"
AllowOverride None
Options None
Order allow,deny
Allow from all


and that one is defined (/SYSTEM, at start of Apache) and does NOT change...
Willem Grooters
OpenVMS Developer & System Manager
Willem Grooters
Honored Contributor

Re: logicals and APACHE

I found that SWS requires logicals:
- Need to be properly defined at server startup
- Cannot hold a search list
- Connaot be chnaged on the fly once the server is started.

This applies for both SWS 1.3 and 2.1.
Willem Grooters
OpenVMS Developer & System Manager