× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Which port are you using to run CGI?

If you downloaded CGIDEV2 from EASY400.NET and installed it right away, the default port is 8014, in such case CGIDEV2 tutorial should be opened up un your system using:
http://yourdomain:8014/cgidev2/start

Also, make sure that the port 8014 (or the one that you used) opened in your firewall.

Another thing is to make sure that there is not HTTP instances sharing the same port that you used for your CGIDEV2 installation:
ENDTCPSVR SERVER(*HTTP)
STRTCPSVR SERVER(*HTTP) HTTPSVR(CGIDEV2APA)

Just make sure that you do not have pages in production on the web, otherwise you could be hated for stopping the HTTP server.

If you are not sure which port are you using, do:
dspf '/cgidev/conf/httpd.conf'
then search for the 'PART 1', the port is listed in the 'Listen' line (Line ~#26) if you still have your default installation.

May I recommend something? I been playing with http://renaissanceframework.com/, it is an open source framework that helps you to build nice web applications straight from RPG without the hassle of learning HTML, CSS, Javascript; so my recommendation is to play with it.

Jorge Merino

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Kelley Shaddrick
Sent: Wednesday, November 10, 2010 3:02 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: CGIDEV2

Howdy folks,

I've started working with serving web pages from RPG. I started with a very nice tutorial showing how to use the QtmhWrStout API, very easy and produced a basic web page on the first try. However, it limits web page size to the size of the API variable. So, moving on to newer methods I've been working with CGIDEV2 for a couple of days now. Unlike the first method, I've had absolutely no success producing a simple web page with CGIDEV2.

After resolving countless errors (thanks to all those who encountered them long before I did and offered solutions on various websites!), I now get no errors in any log but still no web page is displayed. When I try to run the program via the browser, I get the opening program dialog box with the browser asking me what I want to do with this program. I suspect that I don't have something configured correctly, but frankly don't know what. Any advice on how to proceed would be greatly appreciated.

The RPG is compiled into a library called CGILIB. The HTML is in a folder off the root called /html. It's supposed to display a list of my customer master file. Here is the HTML file and the corresponding RPG file (I took comments and such out to save space):

**********

/$Header

content-type: text/html

<html>

<head>
<title>My Customer List</title>
</head>

<body>
<h1>My Customer List</h1>
<table border="1">

/$List

<tr>
<td>/%Cmcomp%/</td>
<td>/%Cmcust%/</td>
<td>/%Cmname%/</td>
</tr>

/$Footer

</table>
</body>
</html>


**********

H DftActGrp(*no) ActGrp('QILE')
H Option(*nodebugio: *seclvl: *srcstmt: *xref)

D/copy cgidev2/qrpglesrc,hspecsbnd


FCstmas if e k disk usropn

D/copy cgidev2/qrpglesrc,prototypeb
D/copy cgidev2/qrpglesrc,usec

/free

setnodebug(*off);

gethtmlIFS('/html/cstmas.html':'/$');

wrtsection('Header');

open Cstmas;

setll *start Cstmas;
read Cstmas;

dow not %eof(Cstmas);

updHtmlVar('Cmcomp': %char(Cmcomp));
updHtmlVar('Cmcust': %char(Cmcust));
updHtmlVar('Cmname': Cmname);

wrtsection('List');

read Cstmas;

enddo;

close Cstmas;

wrtsection('Footer');
wrtsection('*fini');

eval *inlr = *on;

/end-free

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.