THAT'S COOL! RPG-XML SUITE TIPS & TRICKS FOR DEVELOPERS
How to create longer named URLs
Sometimes longer URLs are necessary to make a web service name more meaningful than an acronym coupled with a number (i.e. RXS3). This RPG-XML Suite tip details how to modify your Apache configuration to facilitate longer named URLs by using the ScriptAlias directive.
Modify your Apache config to have the below ScriptAlias tag, replacing mylongprogramname and rxs3.pgm with the appropriate name of your longer URL name and the actual name of the program you want that longer URL to map to. Note that this will require a restart of the Apache server.
To edit from the green screen side use the EDTF command:
EDTF '/www/myrxs/conf/httpd.conf'
To restart the MYRXS Apache server first issue the ENDTCPSVR command below. Look in the QHTTPSVR subsystem and make sure that all MYRXS jobs have ended before issuing the STRTCPSVR command below.
ENDTCPSVR SERVER(*HTTP) HTTPSVR(MYRXS)
STRTCPSVR SERVER(*HTTP) HTTPSVR(MYRXS)
IFS File Contents: /www/myrxs/conf/httpd.conf
Listen *:8181
DocumentRoot /www/MYRXS/htdocs
CGIConvMode %%EBCDIC/EBCDIC%%
ScriptAlias /MYRXS/mylongprogramname /qsys.lib/MYRXS.lib/rxs3.pgm
ScriptAliasMatch ^/MYRXS/(.*) /qsys.lib/MYRXS.lib/$1.pgm
<Directory />
Options None
order deny,allow
deny from all
</Directory>
<Directory /www/MYRXS/htdocs>
order allow,deny
allow from all
<FilesMatch "\.html(\..+)?$">
Options +Includes
SetOutputFilter Includes
</FilesMatch>
</Directory>
<Directory /qsys.lib/MYRXS.lib>
allow from all
order allow,deny
options +ExecCGI
</Directory>
See the below screen shot showing how to invoke it from the Web Service Tester application included with your zip file download.
