Skip to content
Apache 2.4 module to allow Pascal program to be executed just like scripting language
Pascal Shell Batchfile
Branch: master
Clone or download

Latest commit

Latest commit fb5e3a3 Mar 18, 2020

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin add stub file Mar 14, 2020
docs
src
.gitignore add capability to parse header Mar 16, 2020
LICENSE
README.md edit readme Mar 17, 2020
build.cfg.sample remove main_handler unit Mar 14, 2020
build.cmd
build.dev.cfg.sample
build.prod.cfg.sample
build.sh remove main_handler unit Mar 14, 2020
setup.cfg.cmd
setup.cfg.sh

README.md

mod_pascal

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

Requirement

Setup

Compile mod_pascal

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

Add Apache configuration to load module

For example in Debian,

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

<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,

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

$ 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.

$ sudo a2enmod pascal

Restart Apache

$ sudo systemctl restart apache2

Execute Pascal program

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

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 test.pas is downloaded then you do not register mod_pascal with Apache correctly.

You can’t perform that action at this time.