Two existing products:
Oxygene
You can check out Oxygene, formerly known as Delphi Prism, formerly known as RemObjects Chrome.
They have found a way to compile a Pascal style language to Java. Not convert Pascal code to Java code, but actually compile it to the bytecode that runs in the Java runtime engine. Apart from that, they can also compile to the .NET runtime.
I don't know if you can use Oxygene for your purpose, but at least their product may give you some inspiration and some insight of the possibilities and difficulties of building something like that yourself.
PascalScript
Maybe you can use PascalScript, also by RemObjects. It is a script interpreter. So you can embed it in a server application. For instance, if you create an ISAPI application that embeds PascalScript, all you need to do is expose some 'write' method to the script to allow it to write output. All the application needs to do is output that output to ISS, and your basis server side Pascal scripting is done. After that, you can expose more convenience functions to the script to make it more useful.
PascalScript can be used in Delphi as well as FreePascal, so maybe you can make it work in Linux as well.