Skip to content

Commit 068c55c

Browse files
committed
Cleanup and Reorganize
1 parent 90eae2e commit 068c55c

24 files changed

+402
-149
lines changed

.bashrc

+99
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# ~/.bashrc: executed by bash(1) for non-login shells.
2+
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
3+
# for examples
4+
5+
# If not running interactively, don't do anything
6+
[[ -z "$PS1" ]] && return
7+
8+
# don't put duplicate lines in the history. See bash(1) for more options
9+
# ... or force ignoredups and ignorespace
10+
HISTCONTROL=ignoredups:ignorespace
11+
12+
# append to the history file, don't overwrite it
13+
shopt -s histappend
14+
15+
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
16+
HISTSIZE=1000
17+
HISTFILESIZE=2000
18+
19+
# check the window size after each command and, if necessary,
20+
# update the values of LINES and COLUMNS.
21+
shopt -s checkwinsize
22+
23+
# make less more friendly for non-text input files, see lesspipe(1)
24+
[[ -x /usr/bin/lesspipe ]] && eval "$(SHELL=/bin/sh lesspipe)"
25+
26+
# set variable identifying the chroot you work in (used in the prompt below)
27+
if [[ -z "$debian_chroot" ]] && [[ -r /etc/debian_chroot ]]; then
28+
debian_chroot=$(cat /etc/debian_chroot)
29+
fi
30+
31+
# set a fancy prompt (non-color, unless we know we "want" color)
32+
case "$TERM" in
33+
xterm-color) color_prompt=yes;;
34+
esac
35+
36+
# uncomment for a colored prompt, if the terminal has the capability; turned
37+
# off by default to not distract the user: the focus in a terminal window
38+
# should be on the output of commands, not on the prompt
39+
#force_color_prompt=yes
40+
41+
if [[ -n "$force_color_prompt" ]]; then
42+
if [[ -x /usr/bin/tput ]] && tput setaf 1 >&/dev/null; then
43+
# We have color support; assume it's compliant with Ecma-48
44+
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
45+
# a case would tend to support setf rather than setaf.)
46+
color_prompt=yes
47+
else
48+
color_prompt=
49+
fi
50+
fi
51+
52+
if [[ "$color_prompt" = yes ]]; then
53+
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
54+
else
55+
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
56+
fi
57+
unset color_prompt force_color_prompt
58+
59+
# If this is an xterm set the title to user@host:dir
60+
case "$TERM" in
61+
xterm*|rxvt*)
62+
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
63+
;;
64+
*)
65+
;;
66+
esac
67+
68+
# enable color support of ls and also add handy aliases
69+
if [[ -x /usr/bin/dircolors ]]; then
70+
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
71+
alias ls='ls --color=auto'
72+
#alias dir='dir --color=auto'
73+
#alias vdir='vdir --color=auto'
74+
75+
alias grep='grep --color=auto'
76+
alias fgrep='fgrep --color=auto'
77+
alias egrep='egrep --color=auto'
78+
fi
79+
80+
# some more ls aliases
81+
alias ll='ls -alF --color=auto'
82+
alias la='ls -A'
83+
alias l='ls -CF'
84+
85+
# Alias definitions.
86+
# You may want to put all your additions into a separate file like
87+
# ~/.bash_aliases, instead of adding them here directly.
88+
# See /usr/share/doc/bash-doc/examples in the bash-doc package.
89+
90+
if [[ -f ~/.bash_aliases ]]; then
91+
. ~/.bash_aliases
92+
fi
93+
94+
# enable programmable completion features (you don't need to enable
95+
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
96+
# sources /etc/bash.bashrc).
97+
#if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
98+
# . /etc/bash_completion
99+
#fi

.docker/apache/Dockerfile

+12-19
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,16 @@
1-
FROM debian:stretch
2-
3-
ENV HTTPD_PREFIX /usr/local/apache2
4-
ENV PATH $HTTPD_PREFIX/bin:$PATH
5-
RUN mkdir -p "$HTTPD_PREFIX" \
6-
&& chown www-data:www-data "$HTTPD_PREFIX"
7-
WORKDIR $HTTPD_PREFIX
8-
9-
RUN apt-get update \
10-
&& apt-get install -y --no-install-recommends \
11-
software-properties-common apache2 curl openssl\
12-
&& rm -r /var/lib/apt/lists/*
13-
RUN a2enmod proxy_fcgi ssl rewrite proxy proxy_balancer proxy_http proxy_ajp
14-
RUN sed -i '/Global configuration/a \
15-
ServerName localhost \
16-
' /etc/apache2/apache2.conf
1+
FROM debian:buster
172

183
COPY entrypoint.sh /entrypoint.sh
19-
RUN chmod 755 /entrypoint.sh
204

21-
EXPOSE 80 443
22-
RUN rm -f /run/apache2/apache2.pid
5+
RUN apt-get update && apt-get install -y --no-install-recommends software-properties-common apache2 curl openssl nano&& \
6+
rm -r /var/lib/apt/lists/* &&\
7+
a2enmod proxy_fcgi ssl rewrite proxy proxy_balancer proxy_http proxy_ajp deflate mime setenvif headers http2 && \
8+
sed -i '/Global configuration/a \
9+
ServerName localhost/a \
10+
' /etc/apache2/apache2.conf && \
11+
echo "Listen 44380" >> /etc/apache2/ports.conf && \
12+
rm -f /var/run/apache2/apache2.pid && \
13+
chmod 755 /entrypoint.sh
14+
15+
EXPOSE 80 443 44380
2316
CMD ["/entrypoint.sh"]

.docker/apache/entrypoint.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#!/usr/bin/env bash
2-
apachectl -DFOREGROUND -e info
2+
apache2ctl -DFOREGROUND -e info

.docker/apache/include/include.conf

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
ServerName ${server_name}
2+
ServerAlias www.${server_name}
3+
4+
<FilesMatch \.php$>
5+
SetHandler "proxy:fcgi://php-fpm:9000"
6+
</FilesMatch>
7+
8+
DocumentRoot ${docRoot}
9+
10+
Alias /.well-known/ ${appRoot}/.well-known/
11+
<Directory "${appRoot}/.well-known/">
12+
Require all granted
13+
Options None
14+
AllowOverride None
15+
ForceType text/plain
16+
</Directory>
17+
18+
<Directory ${docRoot}>
19+
AllowOverride All
20+
Require all granted
21+
DirectoryIndex ${docRoot}/${indexPrefix}.php
22+
<IfModule mod_negotiation.c>
23+
Options -MultiViews
24+
</IfModule>
25+
26+
<IfModule mod_mime.c>
27+
AddType application/x-javascript .js
28+
AddType text/css .css
29+
</IfModule>
30+
<IfModule mod_deflate.c>
31+
AddOutputFilterByType DEFLATE text/plain text/html text/xml text/css application/xml application/xhtml+xml application/rss+xml application/json application/javascript application/x-javascript image/svg+xml
32+
<IfModule mod_setenvif.c>
33+
BrowserMatch ^Mozilla/4 gzip-only-text/html
34+
BrowserMatch ^Mozilla/4.0[678] no-gzip
35+
BrowserMatch bMSIE !no-gzip !gzip-only-text/html
36+
</IfModule>
37+
</IfModule>
38+
Header append Vary User-Agent env=!dont-vary
39+
40+
<IfModule mod_rewrite.c>
41+
RewriteEngine On
42+
43+
RewriteCond %{REQUEST_URI}::$0 ^(/.+)/(.*)::\2$
44+
RewriteRule .* - [E=BASE:%1]
45+
46+
RewriteCond %{HTTP:Authorization} .+
47+
RewriteRule ^ - [E=HTTP_AUTHORIZATION:%0]
48+
49+
RewriteCond %{ENV:REDIRECT_STATUS} =""
50+
RewriteRule ^${indexPrefix}\.php(?:/(.*)|$) %{ENV:BASE}/$1 [R=301,L]
51+
52+
RewriteCond %{REQUEST_FILENAME} !-f
53+
RewriteRule ^ %{ENV:BASE}/${indexPrefix}.php [L]
54+
</IfModule>
55+
56+
<IfModule !mod_rewrite.c>
57+
<IfModule mod_alias.c>
58+
RedirectMatch 302 ^/$ /${indexPrefix}.php/
59+
</IfModule>
60+
</IfModule>
61+
</Directory>
62+
63+
<Directory ${appRoot}/var>
64+
<IfModule mod_authz_core.c>
65+
Require all denied
66+
</IfModule>
67+
<IfModule !mod_authz_core.c>
68+
Order deny,allow
69+
Deny from all
70+
</IfModule>
71+
</Directory>

.docker/apache/sites-enabled/web.conf

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
Define server_name web.local
2+
Define appRoot /var/www
3+
Define docRoot ${appRoot}/public
4+
Define indexPrefix index
5+
Define logdir /var/log/apache2/
6+
7+
ErrorLog ${logdir}/error.log
8+
CustomLog ${logdir}/access.log Combined
9+
10+
Protocols h2c http/1.1
11+
<VirtualHost *:80>
12+
#Should only be Exposed for Dev only
13+
Include /etc/apache2/include/include.conf
14+
</VirtualHost>
15+
16+
<VirtualHost *:443>
17+
SSLEngine on
18+
SSLCertificateFile /etc/http-certs/cert.crt
19+
SSLCertificateKeyFile /etc/http-certs/cert.key
20+
Protocols h2 http/1.1
21+
22+
Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains; preload"
23+
24+
Include /etc/apache2/include/include.conf
25+
</VirtualHost>
26+
27+
<VirtualHost *:44380>
28+
# Redirects port 80 to 443 should be used in Production
29+
ServerName ${server_name}
30+
ServerAlias www.${server_name} lb.${server_name}
31+
32+
<IfModule mod_rewrite.c>
33+
RewriteEngine On
34+
RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [R=301,L]
35+
</IfModule>
36+
37+
<IfModule !mod_rewrite.c>
38+
<IfModule mod_alias.c>
39+
RedirectMatch 301 "^/?(.*)" "https://${server_name}/$1"
40+
</IfModule>
41+
</IfModule>
42+
</VirtualHost>
43+
44+
SSLProtocol all -SSLv3 -TLSv1 -TLSv1.1
45+
SSLCipherSuite ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384
46+
SSLHonorCipherOrder off
47+
SSLSessionTickets off
48+
49+
#SSLUseStapling On
50+
#SSLStaplingCache "shmcb:logs/ssl_stapling(32768)"
51+
52+
SSLOpenSSLConfCmd Curves secp384r1
53+
SSLOpenSSLConfCmd DHParameters "/etc/http-certs/dhparam.pem"
54+
55+
Undefine server_name
56+
Undefine appRoot
57+
Undefine docRoot
58+
Undefine logdir

.docker/apache/vhosts/web.conf

-64
This file was deleted.

.docker/certs/dhparam.pem

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
-----BEGIN DH PARAMETERS-----
2+
MIIBCAKCAQEA//////////+t+FRYortKmq/cViAnPTzx2LnFg84tNpWp4TZBFGQz
3+
+8yTnc4kmz75fS/jY2MMddj2gbICrsRhetPfHtXV/WVhJDP1H18GbtCFY2VVPe0a
4+
87VXE15/V8k1mE8McODmi3fipona8+/och3xWKE2rec1MKzKT0g6eXq8CrGCsyT7
5+
YdEIqUuyyOP7uWrat2DX9GgdT0Kj3jlN9K5W7edjcrsZCwenyO4KbXCeAvzhzffi
6+
7MA0BM0oNC9hkXL+nOmFg/+OTxIy7vKBg8P+OxtMb61zO7X8vC7CIAXFjvGDfRaD
7+
ssbzSibBsu/6iGtCOGEoXJf//////////wIBAg==
8+
-----END DH PARAMETERS-----

.docker/data/log/apache/.gitkeep

Whitespace-only changes.

.docker/data/log/cli/.gitkeep

Whitespace-only changes.

.docker/data/log/fpm/.gitkeep

Whitespace-only changes.

.docker/data/log/mysql/.gitkeep

Whitespace-only changes.

.docker/data/log/nginx/.gitkeep

Whitespace-only changes.

.docker/data/mysql/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)