Apache 2.4 module implementation which is capable of executing Pascal program just like scripting language. Read mod_pascal documentation for more information.
$ 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
.
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.
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
$ sudo systemctl restart apache2
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 you do not see text, something is wrong.
mod_pascal follows Semantic Versioning 2.0