[DOC] Apache2 configuration
floviolleau opened this issue · 3 comments
floviolleau commented
Hi,
Can you please provide in documentation a sample of an apache2 config?
Thanks a lot
marienfressinaud commented
Unfortunately, I don't use Apache and I'm not sure what's the correct configuration. I think you can adapt the configuration suggested by Symfony (https://symfony.com/doc/current/setup/web_server_configuration.html#apache) as the requirements are similar.
floviolleau commented
Hi,
I managed to make it working. I use a reverse proxy + installation in subpath mode.
Proxy config:
<VirtualHost *:80>
Protocols h2 h2c http/1.1
ServerAdmin <redacted>
ServerName <redacted>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
ErrorLog ${APACHE_LOG_DIR}/<redacted>/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/<redacted>/access.log combined
</VirtualHost>
<VirtualHost *:443>
Protocols h2 h2c http/1.1
ServerAdmin <redacted>
ServerName <redacted>
SSLEngine on
SSLCertificateFile <redacted>
SSLCertificateKeyFile <redacted>
Alias /proxy-errors /var/www/html/public/errors
ProxyPass /proxy-errors/ !
ProxyRequests Off
ProxyVia Off
<Proxy *>
Options -Indexes
AddDefaultCharset off
Order deny,allow
Allow from all
</Proxy>
ProxyPass /flusio http://<redacted>:8080/flusio/ retry=1 acquire=3000 timeout=600 Keepalive=On
ProxyPassReverse /flusio http://<redacted>:8080/flusio/
[...]
</VirtualHost>
Server config:
<VirtualHost *:8080>
Protocols h2 h2c http/1.1
ServerAdmin <redacted>
ServerName <redacted>
ErrorLog ${APACHE_LOG_DIR}/<redacted>/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/<redacted>/access.log combined
DocumentRoot /var/www/html
<Directory />
Options -Indexes +FollowSymLinks +MultiViews
AllowOverride None
Order allow,deny
allow from all
LimitRequestBody 0
</Directory>
<Location /flusio>
Options -Indexes -MultiViews +SymLinksIfOwnerMatch
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/(.*)$ index.php?/$1 [L,NC]
</Location>
RequestHeader set "X-Forwarded-Proto" expr=%{REQUEST_SCHEME}
ProxyRequests Off
ProxyPreservehost on
[...]
.env
# Must be the (sub)domain which will serve flusio
APP_HOST=<redacted>
# The next line can be uncommented and be set if you plan to serve flusio on a
# subpath.
APP_PATH=/flusio
marienfressinaud commented
Thnaks for sharing your config! I've never installed flusio under a subpath, so I'm glad if it works well 👍