Thursday, April 23, 2015

Thoth Gateway moved to GitHub, now supports Apex 5.0

As with the Alexandria PL/SQL Utility Library, the source code for the Thoth Gateway, a mod_plsql and Apex Listener/ORDS equivalent for Microsoft IIS, now has a new home on GitHub. This should make it easy for anyone to look at and perhaps contribute to the code.

If you don't care about the source code, you can head straight to the releases page to download just the binaries. Updated installation instructions for IIS 8 will be forthcoming, but deploying the Thoth Gateway is really as easy as just dropping the binaries into the wwwroot and using IIS Manager to turn the folder into an application.

Also, there were a few minor tweaks needed to support Apex 5.0. As far as I can tell from my own testing, everything now works, but do let me know if you have any issues.

Download the lastest version of the Thoth Gateway with Apex 5.0 support here.


Marco Wolschke said...

Thank you! It works fine.

Thomas said...

That's great! I really appreciate that you keep Thoth up to date with new versions of APEX and IIS. We have been using Thoth a couple of years now, and it works perfectly!

Emanuele said...

Is there anyone that could help me?
I've downloaded the latest version 1.4.1 but if I try to follow the doc on your website seems that are referring to previous(and probably with different structure) versions of thoth
Many thanks in advance

Morten Braten said...

@Emanuele: Note that with version 1.4.0 and later, you no longer need an Oracle client so the installation is as easy as putting the binaries in a folder and turning that folder into an ASP.NET application. See this post for more info:

Let me know which steps you took to install, and what error message you got, then we can take it from there.

- Morten

Emanuele said...

I've download thoth-gateway 1.4; I've windows server 2008 with IIS7
What do I have to do?
I've copied the download files into c:\inetpub\wwwroot\thoth
Now what?? The installation guide says something about install folder, create virtual directory and seems it's referring to something old (previous version?)

Could you please figure me out all the steps needed to let thoth working?

Frédéric Boudineau said...

Great development, is it still maintained? do you have a configuration documentation
Best regards

Anonymous said...

Downloaded v1.4.1 and installed under IIS 7.5 on 2008R2 server. Works beautifully and can access apex v4.2 on oracle 10.2 (remotely) and apex v5.0.3 on oracle xe 11g (locally).

But i need to run an app other than f?p=4550 (developed under apex, sid=102). Can someone advise on how to format the DatabaseConnectString parm? i tried different formats but getting either syntax errors or that tns can not resolve. Also, i'm a newbie to Oracle.

Any advise will be greatly appreciated.

Morten Braten said...

@Frédéric: The project is still maintained. Look in the /doc/installation_guide.htm document for how to configure. Note that as of version 1.4.x you can skip step 2 (install ODP.NET) as it now uses the ODP.NET Managed Driver which is just a single DLL which lives in the same folder as the application (Thoth Gateway) itself.

- Morten

Morten Braten said...

@Anonymous: Great to hear that you got it working. But I think you are confusing the concepts of database connections and APEX application IDs. In your web.config file you add a "DAD" (Database Access Descriptor) for each database you want to connect to. The "SID" is the database identifier (typically "XE" for Oracle Express Edition, and default "ORCL" for Oracle Standard/Enterprise Edition). In your case you have two databases, so you need to add two different DAD sections to the web.config. The name of the DAD becomes the second part of the URL, after the folder you put the Thoth Gateway in. For example, if you put the Thoth Gateway in a folder called "pls" and you added a DAD called "mydad", then the URL to access that database would be http://myserver/pls/mydad/

Once you have set up the DAD you can run any APEX application in that database. Each APEX application has its own ID, starting with 100 for the first application you make, then 101, 102 and so on. The APEX Application Builder that you use to create APEX applications is itself created in APEX, and it has the number 4550. To access any APEX application you just add the ID to the end of the URL, like this: http://myserver/pls/mydad/f?p=12345

Key point: You don't need to change the DatabaseConnectString to run other APEX applications, you just change the ID of the application in the URL. You can read more about the concepts here:

Hope this helps,

- Morten

Anonymous said...

Morten, thank you very much for this detailed and simple explanation. It makes a lot of sense, even for an Oracle newbie like me.

After trying your suggestions, i have been able to access 3 apps on our production oracle server, 2 of which use AD authentication.

Again, many thanks for your explanation and quick reply. And many thanks for the Thoth gateway too!!!


Frédéric Boudineau said...

I am convinced that Thoth Gateway has a huge potential.
In my case the same IIS server can manage the main APEX application and others ASP or WCF .Net module. Great!
With ords, you need GlassFish, Windows WCFService and NGINX as proxy. Really complicated.

I will look on features specific to ords like restful.

Haris said...

Can this gateway run on .NET Core under Linux

Morten Braten said...

@Haris: Good question. It depends on how much of the ASP.NET request pipeline is supported in .NET Core, and also if the Oracle ODP.NET Managed Driver is supported on .NET Core. Also, you would need to host the gateway in a server process. On Windows with regular .NET web apps, this is IIS. On Linux with .NET Core, this would be the "Kestrel" webserver behind an Apache or Nginx proxy. Unless you want to do some customization of the Thoth source code using .NET on Linux, why not just use ORDS on Tomcat behind Apache or Nginx?

- Morten

Anton Ard said...

Help me please with installation.
I use Windows Server 2012 R2 with IIS8 x64, Oracle XE 11.2, Apex 5.1.4...
I try to install thoth gateway (1.4.2) and have 404 error when try to open http://localhost/pls/apex/. In Application pool I choose .NET CLR Version 4.0, Integrated mode. PLSQLGatewayModule.Log is empty.

When I downgrade thoth to version 1.3.7 and in Application pool I choose .NET CLR Version 2.0 I see this message:

"X-ORACLE-IGNORE: IGNORE X-ORACLE-IGNORE: IGNORE X-ORACLE-IGNORE: IGNORE X-ORACLE-IGNORE: IGNORE Content-Type:text/html; charset=utf-8 Cache-Control:no-store Pragma:no-cache Expires:Sun, 27 Jul 1997 13:00:00 GMT Set-Cookie:ORA_WWV_USER_220151653909509=ORA_WWV-VxrWZYr-puWaDXKa0CJa618M; path=/pls/apex; HttpOnly Status:302 Location:f?p=4550:1:14813344110427:::::".

I think the problem is IIS headers before app. Also I see new lines in log file.

Old version of thoth works incorrect, new version does not work at all. :(

Can you help me?

Morten Braten said...

@Anton: Thoth Gateway version 1.3.7 does not work with APEX 5.0 or newer due to different formatting of HTTP headers (that's why you see the headers getting printed on the page).

If you use APEX 5.0 or newer you should use Thoth Gateway 1.4.0 or newer.

You say you get a 404 error when trying to open http://localhost/pls/apex/ -- please check the Windows Event Log to see if you get an ASP.NET error there. Also set the log level in the Thoth Gateway web.config to "DEBUG" to get detailed error messages. Ff the error happens before the gateway is invoked you'll not see anything in the gateway log, but you should see something in the Windows Event Log.

- Morten

Anton Ard said...

Thank you, for your answer, Morten. I started 1.4.2 version, it works fine.I uninstalled .net 3.5 framework at all (in server roles and features) and thoth started without problem. Thank you for your support.

Lee said...

Hi, Good day.

I would like to configure APEX5.1 with IIS7.
If I am not wrong, I need to install full version i.e. 1.3.7 then upgrade to 1.4.2.
May I ask where can I download version 1.3.7?
I tried on Google Code Archive but hit 404.

Please advise.

Morten Braten said...

@Lee: There is no need to install an earlier version and then upgrade. You can install the latest version directly. Just download the latest version from and install as per the instructions in the doc/installation-guide.htm file after you have unzipped.

Note you can skip step 2 (installing ODP.NET) as this is now (starting with the 1.4.0 release) included as described here

- Morten

Thijs said...

I like this gateway but absolutely can't get it to work.

I have a clean IIS 10.0 installation on Windows Server 2016. Downloaded the "thoth-gateway-1-4-2-bin" created a new website with folder "pls" in it. Copied contents of "web" folder from zip into this pls folder. Changed "pls" to an application. Edited web.config with database connection, user and password. But only get 404 error. No log4net log file exists. Don't see any Windows Event Viewer.

I have no clue what to try next. Any ideas?

Morten Braten said...

@Thijs: Try accessing an URL via the gateway on the server itself (localhost), it should show you the real error message rather than a generic 404 error page.

Also, make sure you have the ASP.NET feature enabled on the IIS server, it is not enabled by default on a minimal IIS install.

- Morten