My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
WebServer_Embedded  

Featured
Updated Apr 6, 2010 by wanderla...@gmail.com

ExtPascal also supports an embedded (or internal) Web server mode. When an ExtPascal application is compiled with an embedded Web server, you don't have to install and configure a Web server such as Apache or IIS to run the app, although you lose the flexibility and facilities that an Apache or IIS server can offer via its modules.

Steps

Here are the steps for compiling the example app with an embedded Web server:

1. Follow the First Steps on GettingStarted page.

2. Download the Indy 10 source code, if needed.

Indy project
Delphi source
FPC source

Note that Delphi 2006 and later already includes Indy 10.

3. Open ExtPascalSamples.dpr with Delphi or open ExtPascalSamples_embedded.lpi with Lazarus.

  • With Delphi, choose Project | Options.
    1. On the Compiler tab, check "Assignable typed constants".
    2. On the Directories/Conditionals tab, enter the path to Indy in "Search path" (not needed if your Delphi includes Indy 10).
    3. On the same tab, enter WEBSERVER in "Conditional defines".
  • With Lazarus, choose Project | Compiler Options.
    1. On the Paths tab, change Other Unit Files to point to Indy.
    2. On the Other tab, make sure -dWEBSERVER is entered in Custom options.

4. With Delphi, choose Project | Compile. With Lazarus, choose Run | Build.

5. Copy the ExtJS folder below the folder where the ExtPascalSamples executable file is located. Make sure the ExtJS folder is named ext for this example.

6. Start ExtPascalSamples from the command line or by double-clicking it. Note that the embedded server example does not appear to work when run within the Delphi or Lazarus IDE.

7. Start a Web browser and enter http://localhost/Home

Port 80 is used in this example. Other Web servers must be disabled on your machine if they're using port 80. You can also change the port used in the call to TIdExtApplication.Create. For example, if you change the port from 80 to 8080 you would enter http://localhost:8080/Home in the browser.

8. You can shut down the app with Task Manager (Windows) or Activity Monitor (OS X).

Comment by paul.a.norman, Sep 17, 2009

If you change the Port from 80 do you still need to disable other web servers?

Comment by project member wanderla...@gmail.com, Sep 18, 2009

No

Comment by db...@2-mail.com, Feb 12, 2010

If you can't run it from within the IDE, how are you going to debug the app? I don't see the point of going embedded unless you want to create a demo webapp. I'd really like to see embedded working within the IDE. Just my 2 cents. :)

Comment by leledumb...@gmail.com, Feb 14, 2010

> You can shut down the app with Task Manager (Windows) or Activity Monitor (OS X)

Such a dirty way, doesn't the shutdown method work?

Comment by irwin.no...@gmail.com, Feb 10, 2011

Hi. I try to compile it on Delphi XE, but have some errors: Error? IdExtHTTPServer.pas(583): E2003 Undeclared identifier: 'AddSrcCookie?' (ARequest.Cookies.AddSrcCookie?(CookieText?) => I changed AddSrcCookie? -> AddClientCookies?)

Error? ExtPascalSamples?.dpr(63): E2010 Incompatible types: 'class of TIdExtSession' and 'class of TSession' (Application := TIdExtApplication.Create('ExtPascal? Samples ' + ExtPascalVersion?, TSession, 80, 5))

Comment by project member mightydr...@gmail.com, Dec 11, 2011

Hi, i have to made changes in IdExtHTTPServer for the method AddSrcCookie?, the program run and i can connect with my web browser, the problemm is the ExtSamplesEmbedded? no load in the web browser, only show "Loading ExtPascalSamples? 0.9.9...", wath i have to do?


Sign in to add a comment
Powered by Google Project Hosting