Skip to content

Commit

Permalink
Merge branch 'pascal-id:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
luridarmawan authored Jan 19, 2022
2 parents 8a10fb9 + 7b43b11 commit 9031196
Show file tree
Hide file tree
Showing 5 changed files with 98 additions and 2 deletions.
19 changes: 17 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,30 @@ SHELL ["/bin/bash", "-c"]

ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update -qq && \
apt-get install -y build-essential binutils wget tzdata
apt-get install -y build-essential binutils wget tzdata && \
apt-get install -y apache2 git curl libtool zip nano ftp && \
apt-get install --fix-missing && \
apt-get clean

# Apache Setup
ADD config/apache/000-default.conf /etc/apache2/sites-enabled/
RUN a2enmod cgi \
&& ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/ \
&& ln -s /etc/apache2/mods-available/headers.load /etc/apache2/mods-enabled/ \
&& echo "Free Pascal for Docker" > /var/www/html/index.html \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

RUN mkdir -p /projects/
WORKDIR /projects
ADD ./app/ /app

ENV FPC_VERSION="3.2.2"

# trunk: ftp://ftp.freepascal.org/pub/fpc/snapshot/trunk/source/fpc.zip
RUN ARCH=$(uname -m)-linux && \
cd /tmp && \
wget "ftp://ftp.hu.freepascal.org/pub/fpc/dist/${FPC_VERSION}/${ARCH}/fpc-${FPC_VERSION}?${ARCH}.tar" -O fpc.tar && \
wget "ftp://ftp.freepascal.org/pub/fpc/dist/${FPC_VERSION}/${ARCH}/fpc-${FPC_VERSION}?${ARCH}.tar" -O fpc.tar && \
tar xf fpc.tar && \
cd fpc-${FPC_VERSION}?${ARCH} && \
rm demo* doc* && \
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Based on:

- Ubuntu 20.04
- [Free Pascal 3.2.2](https://www.freepascal.org/)
- Apache +modcgi

USAGE:

Expand Down
22 changes: 22 additions & 0 deletions app/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash
#cd /projects/vendors/fastplaz/
#git pull origin development

echo Update done
echo
echo Running Apache ..
echo
echo try from your browser
echo http://localhost:8080
echo
echo ECHO Example
echo http://localhost:8080/echo/?val1=value1
echo
echo Try with any parameters using GET or POST method
echo
echo
echo press Ctrl+C to exit
/usr/sbin/apache2ctl -D FOREGROUND



45 changes: 45 additions & 0 deletions config/apache/000-default.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# FastPlaz
ServerName localhost

<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
ServerName localhost

ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
<Directory /var/www/html/>
Options ExecCGI Indexes FollowSymLinks MultiViews
AddHandler cgi-script .bin
AddHandler cgi-script .cgi
AllowOverride All
Require all granted
# Order allow,deny
# allow from all
</Directory>


# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
13 changes: 13 additions & 0 deletions config/apache/fastplaz.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
ServerName localhost

AddHandler cgi-script .cgi
AddHandler cgi-script .bin

DocumentRoot "/var/www/html"
<Directory "/var/www/html">
Options ExecCGI Indexes FollowSymLinks
AllowOverride All

# alpine
Require all granted
</Directory>

0 comments on commit 9031196

Please sign in to comment.