Feeds, issues, packages and code source about emulation and pograming, of VENENUX proyects, Debian related distros and massenkoh!

gambas: como publicar web / how to deploy web

|
(UPDATED!!  construction) (ACTUUALIZADO construccion) Sea como sea, un programa gambas para web tiene gran futuro, porque sigue la sintaxis JSP/VB, pero usa la filosofia Java, lo mejor de los dos mundos actuales.. si el creador de gambas tuviera mas vision este seria el futuro de la tecnologia GNU!

INDEX:
0) Introduction
1) Software requirements
2) Webserver configurations combinations
3) Deployments and testing the web program

0) Introduction/Introduccion:

Please read before: http://qgqlochekone.blogspot.com/2017/03/gambas-web-la-filosofia-web-vs-la.html

El programa generado gambas (el ejecutable que por lo general tiene extesion gambas) es en si un "escupidor de html", este es el que se invoca en el request y este emitira el response.

The gambas program generated (that exec by general have gambas extension) its per se an "html ouput renderer", that its the file called in the request and that emit the response.

From the IDE vs from the webserver! CUIDADO/BEWARE!

No es el mismo, cuidado! el IDE gambas ejecuta el codigo embebido en su propio wervidor http usando puerto 8080, el path server sera el directorio del proyecto, el server web root sera la raiz del url ... es decir corre un servidor web como si fuera entero para el proyecto! Cuando ud despliegue el cgi esto cambia radicalmente confundiendolo!

Not the same, beware! The gambas IDE run the embedded code on its own http web server using port 8080, the server path will be the application path, the server web root will be root of the server runnign from the url  web browser as if the hole only for the project! When the CGI is deployed this radically changes confusing it the developer!

1) SOFTWARE REQUIREMENTS:

We need a webserver, a gambas ide compiler and gambas script interpreter, unless u only make cgi's the scripter are innecesary. The recomended install command must be done open a console and swichting to root:

RequerimentAvailablerecomended and install commandexplanation
Webserverapache2
lighttpd
hiawatha
apt-get install lighttpd apache2.2-utilsprovides the cgi andler and web interface to request to bypass to the cgi produced by gambas, webservers like nginx does not provide good cgi handler and its not supported, hiawatha its not recomended for production large deployments
Compilergambas3-ide
gambas3-runtime
apt-get instal gambas3-runtime gambas3-web gambas3-util-web gambas3-xml gambas3-xml-rcppermits compiling the program tht will be acts as cgi program and produces the html rendering. The ide component was given due install many of the necesary, but in server its not recomended.
Scriptergambas3-scripterapt-get install gambas3-scripterpermits interpret a source files and based on their content as script will render html or not using logic, its only recomended for static content that only need minimal logic, when fails show the source code in webserver
...

2) SERVER GLOBAL CONFIGURATIONS

open console
gin root privilegies: su
run command: apt-get install

Requerimientospaquetevalor inicial y ruta ejecutoramodulo
apacheapache2.2-binScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
AddHandler cgi-script .cgi .sh .pl
a2enmod cgi
lighttpdlighttpd$HTTP["url"] =~ "^/cgi-bin/" {
cgi.assign = ( "" => "" ) }
lighty-enable-mod cgi
hiawatahiawathacgicgi

2.1) Default configurations parameters

configuration by default let only /usr/lib/cgi to permits and as place for cgi scripts...  keep reading to enalbe others or per user
Configuracionapache2lighttpdexplicacion
Solo los ejecutablesOptions +ExecCGIcgi.execute-x-only = "enable"permite en donde lo coloques que cualquier cgi se ejecute, por defecto solo el directoro /cgi-bin/ los ejecuta y el htdocs /var/www/html
Solo algunas extensionesAddHandler cgi-script cgi gbacgi.assign = ("gba" => "gba")
Cgi.assign += ("cgi" => "cgi")
Si por alguna razon no funciona, cambia la extension a “cgi” o “gba” y con esta option los “separas” explicitamente a ejecutar

2.2) User server configure cgi:

Configuracionapache2lighttpdexplicacion
Para el directorio web por usuarios
( ~user)
Options ExecCGI
    SetHandler cgi-scri
$HTTP["url"] =~ "^(/~[^/]+)?/cgi-bin/" {
    cgi.assign = ("" => "")
}

permite en donde lo coloques que cualquier cgi se ejecute, por defecto solo el directoro /cgi-bin/ los ejecuta
Solo interpretar scriptsAddHandler cgi-script gbacgi.assign = ("gba" => "gbs3")
Solo interpretar los script no compilados, y que los ejecute el compilador/interprete gambas con el http server embebido, esto solo se hace para los archivos no compilados.
NOTA: no es seguro, si el script falla, el codigo es escupido al navegador!
..

3) DEPLOYMENT AND GIVE UP RESULTS

3.1) configuring CGI

On standars web server of providers webservers ther's only two paths where the "produced program" (the gambas compiled program u make) can be deployed, in the "/cgi-bin/" web path, and there's two only places for them, globally and per users, theres configurations for both cases:
WebserverInitial/global configsPer user configsScript aditionspackage relatedmodule related
apacheScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ AddHandler cgi-script .cgi .sh .plOptions ExecCGI SetHandler cgi-scriptAddHandler cgi-script .gbs ()apache2.2-bina2enmod cgi cgid alias userdir
lighttpd$HTTP =~ "^/cgi-bin/" { cgi.assign = ( "" => "" ) }$HTTP =~ "^(/~[^/]+)?/cgi-bin/" { cgi.assign = ("" => "") }cgi.assign = ("gbs" => "gbs3")lighttpdlighty-enable-mod cgi alias userdir
() in apache there's still no way to workaround the interpreting of the scrips at the momento of writing this how to

2) producing the program cgioose th
  • In the ide, go to menu->project
  • Create-> executable
  • If u use the "per user configuration" choose the directory output as "public_html" under your home
  • Choose the name of the output program, by default "programname.gambas"
  • If the webserver only permits cgi's porgrams with .cgi extension put in second input: mv $(FILE) $(FILE).cgi
  • The cgi program now can be invoked from url http://localhost/~username/cgi-bin/programname.gambas.cgi
All of this its taking in consideration that inside your home, there's a "public_html" directory, used and handled by the webserver as per user web content, and also under this there's a "cgi-bin" directory, that its for cgi programs, and the webservers software are only apache2 or lighttpd.


CONTINUARA....

0 comments/comentarios:

Publicar un comentario

si vienes de guindo, winbuntu o parecido, limitate y escribe algo util...