Jump to content

Struggling to get started


Bennie Coetzer

Recommended Posts

Hi

I have embarked on trying to develop a stateful web application using Delphi and unigui.

I am however struggling to get going as my knowledge of local webservers is letting me down.  I have tried a number of examples on how to set up a local website in IIS and Apache but failed to get even the simplest site going, just executing a script file.  The idea was to get Ext JS going first and then venture on to uniGUI.  Do you have any detailed descriptions on how to install a local website.  Even a good tutorial will help.

Link to comment
Share on other sites

At this point I am not even sure that my local webserver is running.  According to some examples I should be able to run a script such as index.html via my browser through //localhost.  On one computer which used to have Apache on it (but I uninstalled it) IIS reads a completely different html file (One with 'It Works' as content) but not my own even though the default path is set to my own path.  On another computer which never had Apache trying to connect offers a web.config file error.  I have no idea where to set this up.

What I need is a step by step (which I actually had, but it did not work) to set up either IIS or Apache so that I have a local website that I can test on.  Only then can I proceed to install uniGUI and see if I can move along there.

As I said if a detailed description/tutorial is available to set up Apache or IIS (with tools to confirm that I got it right) I would be most grateful

Link to comment
Share on other sites

ExtJS is the underlying framework which UniGU utilizes. You don't have to start up from scratch with the damn complex Javascript library - that's UniGUI's Job!

 

I suggest you try starting with UniGUI's integrated Webserver - UniGUI Apps geniously are able to serve themselves, so you don't need an external webserver during development process!

 

Take a look at UniGUI's basic Unit Servermodule.pas - in Delphi's Object-Inspector (or ServerModule.OnCreate) you can set the port (default is 8077, so http://127.0.0.1:8077 via Webserver gives you access)

 

Always try directly with http://127.0.0.1 as some browser-versions do not correctly translate http://localhost. A wrong configured \Windows\System32\drivers\etc\hosts file might be another reason...

 

Make sure your firewall is not blocking the given port at least for private access on your own computer. If another port like 8078 also doesn't work, temporarily disable your Firewall/Antivirus Software and check again...

Link to comment
Share on other sites

Thanks Vanscan

I am slowly getting going.  After some playing around I realised that the app must be running locally for the browser to access the web server.  So my understanding is that running the app also runs the web server which then allows the browser to access it - is this correct?

If so, I would now like to verify the app running using Apache.  How do I go about achieving this?

Link to comment
Share on other sites

Follow up

While I am able to run a number of demo's from Chrome, Fishfacts won't run and stop at a 'Loading...' point.  Is there any suggestion as to why this is the case.  Fishfacts represents the basic capability that I want to build on so if I can get this running it will put me on the right track.

Link to comment
Share on other sites

Take a look at the very first line of every UniGUI projects code (created by UniGUI Application Wizard), e.g. fishfacts_xe2.dpr:

{$define UNIGUI_VCL} // Comment out this line to turn the project into ISAPI module

{$ifndef UNIGUI_VCL}
library
{$else}
program
{$endif}

FishFacts_XE2;

Then, Delphi's buggy IDE still might show the exe extension in Project Manager - however it compiles it as DLL!

To be able to launch the .DLL via Apache, you need to configure mod_isapi, see
http://www.unigui.com/doc/online_help/index.html?apache_2_2.htm
and
http://httpd.apache.org/docs/2.2/mod/mod_isapi.html

 

Take also a look at the helpful link Gerhard Kimmeringer posted under http://forums.unigui.com/index.php?/topic/3107-helpfiles-wiki-docs/
 

Link to comment
Share on other sites

OK, I am moving forward.  So far I can create a Delphi application and run it using the uniGUI server through my browser.  To complete my trial I now need to be able to run it remotely on another computer running Apache 2.4 web server.

I have modified the https.conf file as shown in the documentation but when I run it locally I only run an html index file.

 

I have the following questions

 

I do not understand the alias command in httpd.conf - it sets some variable to a path.  Is this the path to the isapi dll?

How do I run that variable?  How does it know which dll to run: is it part of the url?

Does the path include the dll's name or just a path?

Where does the Delphi compiler save the dll?  - I cannot find it in the debug folder, is it somewhere else

 

Hope you can help me over the last stumbling block - so far everything is starting to come together.

Link to comment
Share on other sites

Eureka - Website works from any computer on local network.

Some questions: If I want this to run on a server on the web, what is involved. Does one contact a service provider that hosts a site and merely put your stuff in there in a particular folder with some sort of alias?

Is access to the site always by naming the .dll?

How is the local IPv4 address changed to become a world wide IP address?

Link to comment
Share on other sites

  • Administrators

When creating a new form or data module, what is the difference between an application form and a free form?

 

Application form is automatically created when you refer to its global reference, say UniForm1.

On the contrary, a free form must be created manually in code.

Link to comment
Share on other sites

When running on the desktop my application runs fine.  However when running from the s/a server it seems not to show some forms (application forms)  Is there a possible explanation for this.

Also, closing a form does not work the same as in the desktop.

Link to comment
Share on other sites

×
×
  • Create New...