[Gambas-user] Gambas Web-App doesn't work on a real Web-Server

T Lee Davidson t.lee.davidson at gmail.com
Tue Jun 21 23:46:56 CEST 2022

On 6/21/22 11:33, Claus Dietrich wrote:
> Dear Friends
> I developed a web-application with gb.web.gui which so far worked well with the embedded web-server. Today I compiled the 
> project to a Gambas executable with 3.17.90 (master) and copied it into a lighttpd server directory, changed the ownership and 
> rights as required and opened the web-app with a browser. The result was a kind of surprise, because everything looked as usual, 
> but one set of icons where missing while another set of icons was displayed.
> Those icons which were displayed are located in the project directory "Public" and those which are not displayed are located in 
> the project directory "Public/brandlogos/". Why does this happen when I deploy the web-app at a real server and not during 
> development with the embedded web-server?
> Claus

I was just researching this due to an issue Martin is having with loading a style sheet.

With the simple Web App created with the New Project option and with an added style sheet, "style.css", and linking the location 
of the style sheet two different ways on two different servers tested with two different browsers, the following are my results.

If I link the style sheet thus:
<link rel="stylesheet" href="<%=Application.Root%>/style.css">

On Apache/2.4.51 and Lighttpd/1.4.64 the result is the content of style.css is the same as the rendered HTML. It's as if the 
application is not providing the style sheet from it's Public directory, but actually executing itself again.

Firefox console states, 'The stylesheet http://localhost/~user/cgi-bin/webapptest/webapptest.gambas/style.css was loaded as CSS 
even though its MIME type, “text/html”, is not “text/css”.'

If I copy Public/style.css to the application's main directory and link it thus:
<link rel="stylesheet" href="style.css">
Apache chokes on trying to execute it. :-/ If I then move style.css out of the cgi-bin tree and link it appropriately, Apache 
has no problem loading it correctly.

Lighttpd loads the style sheet correctly even if it is within the cgi-bin tree.


More information about the User mailing list