#1 Re: mORMot 1 » Deploy mORMot server on IIS75+ » 2018-01-15 12:41:22

HollosCs wrote:

Hi, Exilon!
Please explain a bit more this method, I am very beginner in this area.
My test is not working. If possible send a mini mormot server source and explain IIS setting (convert to application, where set domain, port?)
Thanks, Csaba

Hi HollosCs,

You are not limited to use mORMot DB server, you can use any base httpserver as THttpServer (Synopse), TidHttpServer (Indy), etc. Every time IIS opens your AppServer exe, it specifies a port number in commandline. Your AppServer needs to get this port number and use to configure httpserver:

//get port from commandline
Port := ParamStr(1);
//create server with port passed by commandline
myhttpserver := THttpServer.Create(Port,nil,nil,'MyServerName',8);

Make sure you have installed httpplatformhander on your IIS machine.

Configure your IIS site like this (here you can define ip, port and SSL certificate):

IIS Config

Change web.config file as i metioned above.

Configure your assigned application site AppPool as managed code:
IIS Config

Important: If your application needs write to disk or have access to any special resources, you need to configure appPool with an user with enough permissions.

#2 mORMot 1 » Deploy mORMot server on IIS75+ » 2017-11-27 12:02:43

Exilon
Replies: 9

This is a simple solution to deploy mORMot server on IIS and let it control ip restrictions, https certificates, logs, etc...

Instructions to deploy:

- Create you mORMot server to get port number to listen from commandline first parameter.
- Install httpplatformhander https://www.iis.net/downloads/microsoft … ormhandler
- Create a folder and copy your mORMot server exe and files you need
- Configure IIS with domain and port you want to listen, cerfiticates etc. and set site path to folder where you copied your mORMot server.
- Create/edit web.config on this folder like this:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <handlers>
      <remove name="httpplatformhandler" />
      <add name="httpplatformhandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified"/>
    </handlers>
    <httpPlatform stdoutLogEnabled="true" stdoutLogFile=".\logs\ConsoleOut.log" startupTimeLimit="20" processPath=".\mORMotServer.exe" arguments="%HTTP_PLATFORM_PORT%"/>
  </system.webServer>
</configuration>

That's all! You have your app working with IIS!

All you need is a IIS7.5 or up with httpplatformhandler installed. This handler works as a reverse proxy, passing all requests to our application. Azure has installed this handler on its AppService plataform solution.

Benefits from having our app behind IIS:

- Binding on a especific ip, port and hostheader*
- Manage https certificates*
- Write W3C format log with all received requests
- URL Rewriting
- Every worker can raise an instance of your application
*can be managed with netsh, but with IIS is more simple.

This is the simplest way, but you can configure IIS with ARR (Application Request Routing) as a optional solution.

#3 mORMot 1 » RawUTF8 and ISO 8859-1 chars » 2017-07-20 15:40:24

Exilon
Replies: 1

This code doesn't work as i expected...(Same code using string type works)

var
  s : RawUTF8;

begin
    s := 'ángel garcía';
    Writeln(BoolToStr(Pos('á',s) > 0,True)); //shows False

    s := 'ángel gómez';
    Writeln(Uppercase(s)); //shows áNGEL GARCíA
    
    writeln(IntToStr(Length(s))); //shows 14 (length in bytes, not in chars as string.length)
end.

#4 Re: mORMot 1 » THttpApiServer.LogStart() crash » 2017-01-11 13:34:11

Same problem here! sad Is it planned to solve? Did you find an alternative solution?

Board footer

Powered by FluxBB