overhaul webserver: use rootless, simplify apache conf

lektura
max.mehl 2021-04-29 12:21:05 +02:00
parent c84fd76bc8
commit afa7b7fc00
No known key found for this signature in database
GPG Key ID: 2704E4AB371E2E92
5 changed files with 21 additions and 33 deletions

View File

@ -18,9 +18,9 @@ steps:
validate: true
- name: deploy
image: docker/compose:1.24.0
image: docker/compose:1.29.1
commands:
- docker-compose up --build -d
- docker-compose -p pmpc-website up --build -d
volumes:
- name: dockersock
path: /var/run/docker.sock

View File

@ -1,24 +0,0 @@
<VirtualHost *:80>
ServerName www.publiccode.eu
Redirect permanent / https://publiccode.eu/
</VirtualHost>
<VirtualHost *:80>
ServerName publiccode.eu
RedirectMatch permanent "^/zh_tw/?(.*)$" "/zh-tw/$1"
ServerAdmin contact@fsfe.org
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /var/www/html/>
Options FollowSymLinks Includes
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

View File

@ -1,9 +1,5 @@
FROM php:7-apache
FROM bitnami/apache:2.4
COPY site/public/ /var/www/html
COPY site/public/ /app/
COPY 000-default.conf /etc/apache2/sites-enabled/
RUN a2enmod rewrite
CMD apache2-foreground
COPY publiccode.eu.conf /vhosts/

13
publiccode.eu.conf 100644
View File

@ -0,0 +1,13 @@
<VirtualHost *:8080>
ServerName publiccode.eu
ServerAdmin contact@fsfe.org
DocumentRoot /app
<Directory /app/>
Options FollowSymLinks Includes
AllowOverride All
Require all granted
</Directory>
</VirtualHost>

View File

@ -1,6 +1,9 @@
RewriteEngine On
RewriteBase /
# redirect wrong language code we used before
RewriteRule ^zh_tw/?(.*)$ /zh-tw/$1 [L,R=301]
# redirect all requests to non-existing translations to EN
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d