Bennie Coetzer Posted April 17, 2013 Posted April 17, 2013 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.
Administrators Farshad Mohajeri Posted April 17, 2013 Administrators Posted April 17, 2013 Do you want to set up a site based on Ext JS only?
Bennie Coetzer Posted April 17, 2013 Author Posted April 17, 2013 Basically I want a website based on a Delphi application. Some research indicated that uniGUI could be the way to go and that required Ext JS. From my skills set I would really prefer to do the development in Delphi as that would save a lot of time if this is possible.
Administrators Farshad Mohajeri Posted April 17, 2013 Administrators Posted April 17, 2013 Can you describe your problem? Did you fail to run a uniGUI app or?
Bennie Coetzer Posted April 17, 2013 Author Posted April 17, 2013 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
Variscan Posted April 19, 2013 Posted April 19, 2013 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...
Bennie Coetzer Posted April 20, 2013 Author Posted April 20, 2013 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?
Bennie Coetzer Posted April 20, 2013 Author Posted April 20, 2013 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.
Variscan Posted April 21, 2013 Posted April 21, 2013 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, seehttp://www.unigui.com/doc/online_help/index.html?apache_2_2.htmandhttp://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/
Bennie Coetzer Posted April 22, 2013 Author Posted April 22, 2013 Hi Variscan If I remove the first line it compiles but when running searches for a C:\FMApp\bin\UniISAPIServ.exe Any idea where that file should be found? I cannot find reference to it in any folder that I have Thanks
Administrators Farshad Mohajeri Posted April 22, 2013 Administrators Posted April 22, 2013 You can not run a ISAPI DLL. See deployment guide to see how to deploy ISAPI dlls.
Bennie Coetzer Posted April 29, 2013 Author Posted April 29, 2013 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.
Administrators Farshad Mohajeri Posted April 29, 2013 Administrators Posted April 29, 2013 Alias shows the path to the folder containing your dll. To run your app: http://localhost/alias/myapp.dll or http://localhost:portno/alias/myapp.dll
Administrators Farshad Mohajeri Posted April 29, 2013 Administrators Posted April 29, 2013 Where does the Delphi compiler save the dll? - I cannot find it in the debug folder, is it somewhere else Where the output path is configured.
Bennie Coetzer Posted April 29, 2013 Author Posted April 29, 2013 Do I need to set something else other than commenting out the $define UNIGUI_VCL as it only creates an .exe!
Administrators Farshad Mohajeri Posted April 30, 2013 Administrators Posted April 30, 2013 Do I need to set something else other than commenting out the $define UNIGUI_VCL as it only creates an .exe! In XE2 and further versions you need to close and re-open your project.
Bennie Coetzer Posted April 30, 2013 Author Posted April 30, 2013 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?
Bennie Coetzer Posted May 1, 2013 Author Posted May 1, 2013 When creating a new form or data module, what is the difference between an application form and a free form?
Administrators Farshad Mohajeri Posted May 1, 2013 Administrators Posted May 1, 2013 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.
Bennie Coetzer Posted May 3, 2013 Author Posted May 3, 2013 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.
Recommended Posts