Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Catalog · How the catalog works

Random project

mod_pascal

Apache 2.4 module to allow Pascal program to be executed just like scripting language

View on GitHub

Anyone may press Interesting, signed in or not. It helps others find this project.

Member rating

No ratings yet.

Sign in to rate this project.

README

mod_pascal

Apache 2.4 module implementation which is capable of executing Pascal program just like scripting language. Read mod_pascal documentation for more information.

Requirement

Setup

Compile mod_pascal

pascal
$ git clone https://github.com/zamronypj/mod_pascal.git
$ cd mod_pascal && ./setup.cfg.sh && ./build.sh

If compilation is successful, new executable binary will be created bin/mod_pascal.so.

Add Apache configuration to load module

For example in Debian,

Create pascal.conf file in /etc/apache2/mods-available directory with content as follows,

pascal
<IfModule pascal_module>
    # handle all files having .pas extension
    AddHandler pascal-handler .pas
</IfModule>

Create pascal.load file in /etc/apache2/mods-available directory with content as follows,

pascal
LoadModule pascal_module /path/to/mod_pascal.so

It is important that you use pascal_module to identify mod_pascal module and pascal-handler to identify handler.

Enable mod_pascal

Create symlink to pascal.conf and pascal.load in /etc/apache2/mods-enabled directory

pascal
$ cd /etc/apache2/mods-enabled
$ sudo ln -s /etc/apache2/mods-available/pascal.conf
$ sudo ln -s /etc/apache2/mods-available/pascal.load

Alternatively, you can also use a2enmod command to enable mod_pascal.

pascal
$ sudo a2enmod pascal

Restart Apache

pascal
$ sudo systemctl restart apache2

Execute Pascal program

Create Pascal program, for example /var/www/html/test.pas with content as follows,

pascal
begin
    writeln('Hello from Pascal');
end.

Open URL http://localhost/test.pas from Internet browser, you should see text Hello from Pascal printed in browser. If you do not see text, something is wrong.

Versioning

mod_pascal follows Semantic Versioning 2.0