help files
Z505 | PasWiki | FUQ | Search | Main Docs | API Guide



Notes

Remote Deployment

To build a program on a Unix server from your Windows/Mac machine without having to ssh/telnet into it:

Web Based Compiler Studio kit

In addition to fpw/fpwserv there is a very simple web based compiler and editor.

One can edit or upload source files for a compiler online, and have a program generated for them at a website, without compiling on a local machine. The server can compile the program and even launch the program inside the web browser as a CGI, or the program could be downloaded.

Note: The compile-studio just proves that a compiler can easily run on any typical server, and it is not the entire system. It is just a temporary but fully functional demo that hints at what comes next - a more advanced editor.

Currently available is a demo that shows you why this is easy and powerful for web developers looking to build fast native FPC/GCC cgi programs on remote servers in some country across the world:

You only need to upload an FPC compiler to your CGI-BIN, along with the RTL units that you need, and an FPC cfg file. It takes 5-15 minutes to upload FPC and the RTL, depending on your internet connection to do all this, and then you never would worry again about cross platform web development issues. It is really easy, actually, and once you have done it on one server you will know how to do it on any server (cpanel, plesk, or other typical hosting accounts).

This system could also work with GCC/D/Ada or other compilers too.

What about a proper offline IDE?

Although the above little demo video shows using an online web editor where you can copy/paste pascal source files into the Edit Box.. there is nothing stopping you from using your favorite offline editor like delphi/lazarus/MSEIDE/editplus/textpad. You would simply upload your .PAS files using FTP to some directory, then compile the programs using the compile-studio. Or use fpw/fpwserv directly from your IDE or at the command line instead.

The advantage of the .PAS files over .PHP files is that with .PAS files and our system, we have strong typing and extra safety checks. One can compile their program and check for errors before launching it live.

FPC tunneling over HTTP

See fpw/fpwserv.

The HTTP tunneling system lets you edit your source files in your favorite IDE or text editor on your PC, but you don't have to compile the program on your local machine.. you just upload source files to the server, and the server precompiles it for you - similar to PHP/ASP development but the programs run as true native programs!

Tunneling/fpw.exe Hints

Remote server compiler details

Note: no telnet/ssh is required. A typical hosting account with cgi bin will work.

Pretend you have a Linux server (cpanel/plesk, etc), but you are working on a Windows Desktop (windows xp, windows 98, windows 2000, etc).

First you would upload a linux fpc/ppc386 compiler somewhere in cgi-bin, along with the RTL units. We will provide this compiler if you don't have a copy form the fpc website (linux or the target you require).

The only thing you have to do was modify the main fpc.cfg file to point to the units relative to the ppc386 compiler. If the ppc386 elf compiler is in:

  cgi-bin/compile-studio/fpc204/
  
  ...the fpc.cfg file should be placed in that same directory.
Then, the units could be placed in
  cgi-bin/compile-studio/fpc204/units/i386-linux/
..or somewhere similar.. it is up to you. Place them relative to ppc386 executable.

Before uploading the fpc.cfg file, first modify the -Fu paths:

  -Fuunits/$fpctarget/rtl/
  -Fuunits/$fpctarget/*/
  etc.
Why can I do this without supplying absolute path?
  -Fu/absolute/path/cgi-bin/units/
Because the fpc.cfg file is located in the same directory as ppc386... and it knows about relativity. The Units/ folder is relative to PPC386 executable.

How it works

The compile-studio program simply connects to the fpc compiler and launches it, creates a pipe, and spits out the output. This output can be trapped and sent many places including your web browser, an IDE, or even to your cell phone (but let's not get that silly). The compile studio was created in one evening and is not complicated, it just takes advantage of piping techniques. It was more the idea that counted - it took longer to think this one up than to actually program it

Still don't want to compile?

Although this system shown in the video still requires compilation, we have even plans to design a system that makes compilation unnecessary (the program is compiled automatically when you try to run the CGI first, it is sort of like JIT/Just In Time). However, we haven't finished this system or the installer for it yet.

One advantage of using something like compile-studio is that you get to see your typo/typechecking errors before deploying the application, whereas without any compilation you would risk deploying a live application with typo/typechecking issues..(many PHP scripts for example give you the typical "error on line 5" message).

Security Notes

Some of the features in compile-studio are password protected (the program is rusty right now). The compile-studio cgi program is meant for private access only, by you or your team of developers. Do not offer a public compile studio app for anyone to play with on the internet - that is asking for some serious trouble. Password protect the directory with .htaccess or similar.

Obviously that doesn't mean your web programs that you produce with compile studio have to be private... of course you can make them public.






lufdoc, Powtils, fpc, freepascal, delphi, kylix, c/c++, mysql, cgi web framework docs, Z505