commit 0caa7a6be6078425305feefe55e6dd9e76d51dfa Author: root Date: Sat Nov 20 22:57:17 2021 +0100 masodik diff --git a/README b/README new file mode 100644 index 0000000..af21a48 --- /dev/null +++ b/README @@ -0,0 +1,56 @@ +Border8 - Debian 8 (jessie) / PHP 5.6 docker +================================================================== + +/etc/default/grub +GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0 vsyscall=emulate" + +apt-get install docker.io + +Ha proxy kell: +cp -R docker.service.d /etc/systemd/system/ + +systemctl daemon-reload +systemctl restart docker + +tar xzf border8.tar.gz +cd border8/border8 +make Dockerfile +cd .. + +docker build -t border8 border8 + +cp -i border8.logrotate /etc/logrotate.d/border8 +cp -i border8.service /etc/systemd/system +cp -i border8.init /etc/init.d/border8 +chmod 0755 /etc/init.d/border8 + + +systemctl daemon-reload +systemctl enable border8 + +/etc/init.d/border8 start + + +Apache beállítás +================ + +a2enmod proxy proxy_http macro +systemctl restart apache2 +--- + + + ProxyPass http://localhost:86/$dir/mod/$mod + ProxyPassReverse http://localhost:86/$dir/mod/$mod + ProxyPreserveHost On + + + + + ... + Use Border8 border mod1 + Use Border8 border mod2 + + +UndefMacro Border8 +--- + diff --git a/border8.init b/border8.init new file mode 100755 index 0000000..6b72b02 --- /dev/null +++ b/border8.init @@ -0,0 +1,18 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: border8 +# Required-Start: $remote_fs $syslog docker +# Required-Stop: $remote_fs $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: BORDER Debian8 environment +# Description: BORDER Debian8 environment, built from Debian jessie, +# contains apache2 + php 5.6 +### END INIT INFO + +# Author: ROTTLER Tamas + +. /lib/lsb/init-functions + +echo "Border8 service is systemd-only." >&2 +exit 1 diff --git a/border8.logrotate b/border8.logrotate new file mode 100644 index 0000000..9d126a3 --- /dev/null +++ b/border8.logrotate @@ -0,0 +1,15 @@ +/var/log/border8/*.log { + daily + missingok + rotate 14 + compress + notifempty + create 640 root adm + sharedscripts + postrotate + if systemctl status border8 >/dev/null; then \ + docker exec border8.service apachectl graceful; \ + fi; + endscript +} +# vim: set tabstop=4 shiftwidth=4 expandtab smarttab: diff --git a/border8.service b/border8.service new file mode 100644 index 0000000..2614a75 --- /dev/null +++ b/border8.service @@ -0,0 +1,24 @@ +[Unit] +Description=Border8 container +After=docker.service +Requires=docker.service + +[Service] +TimeoutStartSec=0 +Restart=always +ExecStart=-/usr/bin/docker run --name %n \ + -v /var/www:/var/www \ + -v /var/lib/php/sessions:/var/lib/php5/sessions \ + -v /var/run/mysqld:/var/run/mysqld \ + -v /var/log/border8:/var/log/apache2 \ + -v /var/spool/postfix/maildrop:/var/spool/postfix/maildrop \ + -v /var/spool/postfix/public:/var/spool/postfix/public \ + -p 127.0.0.1:88:88 \ + border8 apachectl -D FOREGROUND +ExecStop=/usr/bin/docker stop %n +ExecStopPost=/usr/bin/docker rm %n + +[Install] +WantedBy=multi-user.target + +# vim: set tabstop=4 shiftwidth=4 expandtab smarttab: diff --git a/border8/000-default.conf b/border8/000-default.conf new file mode 100644 index 0000000..d4aeea3 --- /dev/null +++ b/border8/000-default.conf @@ -0,0 +1,44 @@ + + DocumentRoot /var/www/def/public + + + Options +FollowSymLinks + AllowOverride None + + + Options -Indexes +FollowSymLinks +MultiViews + AllowOverride all + Require all granted + + + ErrorLog ${APACHE_LOG_DIR}/error.log + + # Possible values include: debug, info, notice, warn, error, crit, + # alert, emerg. + LogLevel warn + + CustomLog ${APACHE_LOG_DIR}/access.log combined + + + + ServerName border.interfaktor.hu + DocumentRoot /var/www/ifaktor/public + + + Options +FollowSymLinks + AllowOverride None + + + Options -Indexes +FollowSymLinks +MultiViews + AllowOverride all + Require all granted + + + ErrorLog ${APACHE_LOG_DIR}/error.log + + # Possible values include: debug, info, notice, warn, error, crit, + # alert, emerg. + LogLevel warn + + CustomLog ${APACHE_LOG_DIR}/access.log combined + diff --git a/border8/Dockerfile b/border8/Dockerfile new file mode 100644 index 0000000..a5d8234 --- /dev/null +++ b/border8/Dockerfile @@ -0,0 +1,32 @@ +FROM debian:jessie +MAINTAINER Rottler Tamas +LABEL description="Border on Debian 8" + +ENV DEBIAN_FRONTEND noninteractive + +RUN echo Europe/Budapest > /etc/timezone && \ + dpkg-reconfigure -f noninteractive tzdata + +RUN apt-get update && apt-get install -y \ + libapache2-mod-php5 php5-mysql php5-ldap php5-gd + +RUN apt-get install -y vim + +RUN groupadd -g 116 postfix && \ + groupadd -g 117 postdrop && \ + useradd -u 108 -g 116 postfix +RUN apt-get install -y --no-install-recommends postfix bsd-mailx + +COPY charset.conf /etc/apache2/conf-available/ +RUN a2enconf charset +COPY ports.conf /etc/apache2/ +COPY 000-default.conf /etc/apache2/sites-available/ +COPY hws.php.ini /etc/php5/ +RUN ln -s ../../hws.php.ini /etc/php5/apache2/conf.d/ + +RUN a2enmod rewrite + +RUN apt-get install -y bzip2 mysql-client + +# docker build -t border8 border8 +# vim: set tabstop=4 shiftwidth=4 expandtab smarttab: diff --git a/border8/Dockerfile.tpl b/border8/Dockerfile.tpl new file mode 100644 index 0000000..55743b0 --- /dev/null +++ b/border8/Dockerfile.tpl @@ -0,0 +1,34 @@ +FROM debian:jessie +MAINTAINER Rottler Tamas +LABEL description="Border on Debian 8" + +ENV http_proxy "http://aptget:8972@10.93.171.66:8080/" +ENV https_proxy "http://aptget:8972@10.93.171.66:8080/" +ENV DEBIAN_FRONTEND noninteractive + +RUN echo Europe/Budapest > /etc/timezone && \ + dpkg-reconfigure -f noninteractive tzdata + +RUN apt-get update && apt-get install -y \ + libapache2-mod-php5 php5-mysql php5-ldap php5-gd + +RUN apt-get install -y vim + +RUN groupadd -g {POSTFIX_GID} postfix && \ + groupadd -g {POSTDROP_GID} postdrop && \ + useradd -u {POSTFIX_UID} -g {POSTFIX_GID} postfix +RUN apt-get install -y --no-install-recommends postfix bsd-mailx + +COPY charset.conf /etc/apache2/conf-available/ +RUN a2enconf charset +COPY ports.conf /etc/apache2/ +COPY 000-default.conf /etc/apache2/sites-available/ +COPY hws.php.ini /etc/php5/ +RUN ln -s ../../hws.php.ini /etc/php5/apache2/conf.d/ + +RUN a2enmod rewrite + +RUN apt-get install -y bzip2 mysql-client + +# docker build -t border8 border8 +# vim: set tabstop=4 shiftwidth=4 expandtab smarttab: diff --git a/border8/Makefile b/border8/Makefile new file mode 100644 index 0000000..781a71e --- /dev/null +++ b/border8/Makefile @@ -0,0 +1,6 @@ +postfix_uid = $(shell id -u postfix) +postfix_gid = $(shell getent group postfix | cut -d: -f3) +postdrop_gid = $(shell getent group postdrop | cut -d: -f3) + +Dockerfile: Dockerfile.tpl + sed -n -e 's/{POSTFIX_UID}/$(postfix_uid)/;s/{POSTFIX_GID}/$(postfix_gid)/;s/{POSTDROP_GID}/$(postdrop_gid)/;w Dockerfile' Dockerfile.tpl diff --git a/border8/apt.conf b/border8/apt.conf new file mode 100644 index 0000000..61e482e --- /dev/null +++ b/border8/apt.conf @@ -0,0 +1,2 @@ +#Acquire::http::Proxy "http://aptget:8972@10.93.171.66:8080/"; + diff --git a/border8/charset.conf b/border8/charset.conf new file mode 100644 index 0000000..6f7b788 --- /dev/null +++ b/border8/charset.conf @@ -0,0 +1,6 @@ +# Read the documentation before enabling AddDefaultCharset. +# In general, it is only a good idea if you know that all your files +# have this encoding. It will override any encoding given in the files +# in meta http-equiv or xml encoding tags. + +AddDefaultCharset ISO-8859-2 diff --git a/border8/hws.php.ini b/border8/hws.php.ini new file mode 100644 index 0000000..e87c37d --- /dev/null +++ b/border8/hws.php.ini @@ -0,0 +1,15 @@ +; HWS Border php configuration +[PHP] +memory_limit = 512M +error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT & ~E_NOTICE & ~E_WARNING +error_log = /var/log/php_errors.log +post_max_size = 80M +upload_max_filesize = 80M +default_charset = "ISO-8859-2" + +[Date] +date.timezone = "Europe/Budapest" + +[Session] +session.gc_maxlifetime = 86400 + diff --git a/border8/ports.conf b/border8/ports.conf new file mode 100644 index 0000000..241c0f8 --- /dev/null +++ b/border8/ports.conf @@ -0,0 +1,2 @@ +Listen 88 + diff --git a/docker.service.d/http-proxy.conf b/docker.service.d/http-proxy.conf new file mode 100644 index 0000000..f3c78c3 --- /dev/null +++ b/docker.service.d/http-proxy.conf @@ -0,0 +1,3 @@ +[Service] +Environment="HTTP_PROXY=http://aptget:8972@10.93.171.66:8080/" +Environment="HTTPS_PROXY=http://aptget:8972@10.93.171.66:8080/"