|
-----Message d'origine-----
De : web400-bounces@xxxxxxxxxxxx
[mailto:web400-bounces@xxxxxxxxxxxx] De la part de
Michael_Schutte@xxxxxxxxxxxx
Envoyé : lundi 8 juin 2009 14:21
À : Web Enabling the AS400 / iSeries
Objet : Re: [WEB400] Basic CGIDEV2 problem
If you are making changes, then yes, it's necessary.
AliasMatch ^/TSTIMS/(.*)\.HTML
$ /QSYS.LIB/WEBLIB.LIB/QHTMLSRC.FILE/$1.MBR
AliasMatch ^/TSTIMS/(.*)\.JS$
/QSYS.LIB/WEBLIB.LIB/QHTMLSRC.FILE/$1.MBR
There's an example of what's in ours hope it helps.
--
Michael Schutte
Admin Professional
Try Bob Evans GRILLING SAUSAGE! This summer's hottest
destination is your own backyard with Bob Evans Brats and
Italian Sausage! For tasty recipes using Bob Evans grilling
sausage, visit http://www.BobEvans.com/Recipes
David FOXWELL
<David.FOXWELL@ag
ipi.com>
To
Sent by: Web Enabling the AS400
/ iSeries
web400-bounces@mi <web400@xxxxxxxxxxxx>
drange.com
cc
Subject
06/08/2009 08:11 Re: [WEB400] Basic
CGIDEV2 problem
AM
Please respond to
Web Enabling the
AS400 / iSeries
<web400@midrange.
com>
Hi Scott ( or anyone else who has been following!)
I've managed to edit my config file to call any program, but
now I've added this :
AliasMatch /htm/(.*)
/qsys.lib/d113712.lib/qhtmlsrc.file/$1
With the idea of being able to type http://myi:8016/htm/myhtmlmbr.mbr
But even if I type http://myi:8016/htm/menu.mbr , I get a NOT
FOUND error in the browser.
Can you see what's wrong?
Thanks.
PS, I'm stopping then restarting the server each time I
modify the configuration file. Is that necessary?
-----Message d'origine-----/ iSeries
De : web400-bounces@xxxxxxxxxxxx
[mailto:web400-bounces@xxxxxxxxxxxx] De la part de Scott Klement
Envoyé : jeudi 4 juin 2009 18:57 À : Web Enabling the AS400
Objet : Re: [WEB400] Basic CGIDEV2 problemtoo hard to
Hi David,
ScriptAliasMatch lines, though.
I wish I fully understood all those Alias and
Alias, AliasMatch, ScriptAlias and ScriptAliasMatch aren't
understand. I'll try to explain them, but please askquestions if you
still don't understand.This is an IFS
BACKGROUND
----------
When you configure Apache, you give it a DocumentRoot.
pathname to the start of your web server. In the simplestDocumentRoot.
configuration, everything on your server would be under
So you might have this:that's all you
DocumentRoot /www/myserver/htdocs
HTTP was designed for fetching documents (originally,
could do, just fetch a document, nothing else). So a browser would/mydir/mydoc.html
code something like this:
http://www.example.com/mydir/mydoc.html
This tells the browser (a) use the http protocol. (b), connect to
www.example.com, and (c) ask for the document named
DocumentRoot to it.
Apache will get that request, but it'll add the
So the actual IFS path to the document will bepart of your
/www/myserver/htdocs/mydir/mydoc.html
That's the simplest behavior. It lets you designate some
IFS (DocumentRoot) where all subfolders will be accessible via URLs.as in the
That's the basic configuration.
ALIAS
-----
What if you want something OUTSIDE of that area to be accessible to
the browser? How would you do it? You declare an Alias.
DocumentRoot /www/myserver/htdocs
Alias /foo /home/scott/bar
This says that all URLs go under /www/myserver/htdocs, just
previous example... EXCEPT for /foo. Any URL starting with/foo will
point to /home/scott/bar/home/scott/foo, so the
So this works just as it did before:
http://www.example.com/mydir/mydoc.html
But this works differently.
http://www.example.com/foo/mydir/mydoc.html
In this second case, the /foo is an alias for
URL points to /home/scott/bar/mydir/mydoc.html.directories in
That's all an alias does. It provides a way to specify
the URL that are "redirected" to another area of the IFS,outside of
the document root.character. An
ALIASMATCH
----------
AliasMatch does the same thing that Alias does, except it allows
"wildcards" (technically... Regular Expressions.) For example, I
could do something like this:
AliasMatch /foo/(.*jpg) /images/jpg/foo/$1
In a regular expression, a single dot matches any one
asterisk says "zero or more of the preceding character".So when you
have .* it matches any number of any character. In thisexample, any
URL that begins with /foo/ and ends with jpg will match the alias.be copied
In Apache, the parenthesis designate a section of the URL o
to the resulting URL. So in this example, the /foo/ is not inwith jpg,
parenthesis, but the .*jpg is. So whatever matches the wildcard of
.*jpg will be considered "variable number 1". You'll notice the
result is
/images/jpg/foo/$1 -- that $1 will be replaced at runtime with
whatever matched the .*jpg pattern.
Example:
http://www.example.com/foo/goofy/scott_dancing.jpg
Once the hostname is removed, it starts with /foo/ and ends
so it matches the Alias. The (.*jpg) part will matchsince they run
goofy/scott_dancing.jpg, so Apache will access the
/images/jpg/foo/goofy/scott_dancing.jpg file in the IFS
FWIW, I tend to avoid AliasMatch (or ScriptAliasMatch)
slower, and IMHO, they're more complicated than I need for myInstead of
projects.
SCRIPTALIAS
-----------
If you understood Alias, then ScriptAlias should be easy.
There's really only one difference. Alias is for fetching a
document... it tells Apache which document in the IFS to fetch. By
contrast, ScriptAlias is for running a script or program.
downloading the program object to the browser (that's whatAlias would
do), ScriptAlias tells Apache to run the program. Theoutput of the
program will be sent to the browser, instead of downloading thedirectory and
program object itself.
Without ScriptAlias:
DocumentRoot /www/myserver/htdocs
http://www.example.com/qgpl/pmu010.pgm
This tells Apache to go to the /www/myserver/htdocs/qgpl
download a program named pmu010.pgm to the browser.With that in
With ScriptAlias:
DocumentRoot /www/myserver/htdocs
ScriptAlias /qgpl /QSYS.LIB/QGPL.LIB
http://www.example.com/qgpl/pmu010.pgm
Hopefully you already understand that /QSYS.LIB in the IFS provides
access to your traditional libraries and their contents.
mind, Apache will build the IFS pathname ofequivalent of
/QSYS.LIB/QGPL.LIB/PMU010.PGM and it will therefore be
CALL PGM(QGPL/PMU010)AliasMatch
SCRIPTALIASMATCH
----------------
Same as ScriptAlias, except it now has regular expressions
("wildcards") available. ScriptAliasMatch is to ScriptAlias what
AliasMatch is to Alias.
The installer for CGIDEV2 likes to set things up like this:
ScriptAliasMatch /mylibp(.*).pgm /qsys.lib/mylib.lib/$1.pgm
/mylibh/(.*)\.htm /QSYS.LIB/MYLIB.LIB/HTMLSRC.FILE/$1.mbr/mylib/ /mylib/
Alias /mylibh/ /QSYS.LIB/MYLIB.LIB/HTMLSRC.FILE/ Alias
(including files,
The ScriptAliasMatch at the top says that any URL that begins with
/mylibp and ends with .pgm should be run as a program in
/qsys.lib/mylib.lib. Contrast these two statements:
ScriptAlias /mylibp /qsys.lib/mylib.lib ScriptAliasMatch
/mylibp(.*).pgm /qsys.lib/mylib.lib/$1.pgm
In the first case, anything that starts with /mylibp
data areas, queues, user spaces, etc) will be run as a program fromnon-program object,
the /QSYS.LIB/MYLIB.LIB library. Of course, if you list a program
object, no problem, it'll run it. If you list a
however, Apache will still try to call it (though, it'llfail with an
error.)objects go
In the second case, only URLs that end in .PGM are called.
Apache will forcibly add the .pgm extension to it when it tries to
call it.
Therefore, non-programs will not match this script alias.
Instead, they'll match this one (also from the configs, above)
Alias /mylib/ /mylib/
This tells it to go to the /mylib/ folder of the IFS instead of the
library. So program objects go to the library, non-program
to an IFS folder. If you left off this extra Alias, it would go toCGIDEV2 provided
the DocumentRoot instead -- and go to /www/myserver/htdocs/mylib.
Shrug... I personally prefer to go in and delete the
instructions and insert my own. I don't like the instructions theymailing list To
provide. They're more complicated than they need to be, IMHO.
But, anyway... hope this all made sense.
--
This is the Web Enabling the AS400 / iSeries (WEB400)
post a message email: WEB400@xxxxxxxxxxxx To subscribe,unsubscribe,
or change list options,--
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/web400.
This is the Web Enabling the AS400 / iSeries (WEB400) mailing
list To post a message email: WEB400@xxxxxxxxxxxx To
subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/web400.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.