#################################################################################################
## Racine des documents statiques du CMS
## HTTPS : Pour mettre en place le https, activer le module SSL si ce n'est pas fait: sudo a2enmod SSL
## HTTPS : Décommenter le bloc suivant
##
#
# ServerName cms.mondomaine.com
# RewriteEngine On
# RewriteCond %{HTTPS} off
# RewriteCond %{SERVER_NAME} =cms.mondomaine.com
# RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,QSA,R=permanent]
#
#################################################################################################
## Racine des documents statiques du CMS
## HTTPS : Décommenter le bloc suivant et commentez le bloc port 80
##
#
#################################################################################################
## Racine des documents statiques du CMS
##
DocumentRoot /home/cms/Ametys_CMS/application/cms
Require all granted
ServerName cms.mondomaine.com
UseCanonicalName On
AddDefaultCharset UTF-8
#################################################################################################
## Activation de la compression sur certains type
##
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css image/svg+xml text/javascript application/javascript
#################################################################################################
## SSL Configuration
## Ne pas modifier les noms de fichiers dans ce fichier car c'est un fichier de macro
## qui peut etre utilisé pour gérer plusieurs sites.
## HTTPS : Décommenter les lignes suivantes et ajuster les noms de fichiers/chemins
##
#Include /etc/apache2/ssl/options-ssl-apache.conf
#SSLCertificateFile /etc/apache2/ssl/cms.mondomaine.com.crt
#SSLCertificateKeyFile /etc/apache2/ssl/cms.mondomaine.com.key
#SSLCertificateChainFile /etc/apache2/ssl/SSLCertificateChainFile.crt
## HTTPS : Restart Apache
## HTTPS : Finally update site configuration in BO Ametys _admin
RewriteEngine On
ProxyRequests Off
ProxyPreserveHost On
#################################################################################################
## Remove headers for better security
##
Header unset "X-Powered-By"
Header unset "Server"
Header unset "X-Cocoon-Version"
Header unset "X- Generator"
#################################################################################################
## Reject TRACE method for better security
##
RewriteCond %{REQUEST_METHOD} ^(PUT|TRACE) [NC]
RewriteRule .* - [F]
#Reject all the access to php files to improve performances and security
RewriteRule .*\.php - [F,L]
#################################################################################################
## SOLR ##
##
## Generate a password with : sudo htpasswd -c /etc/apache2/conf/htpasswd mysolr
#
# AuthType Basic
# AuthName "Authorization Required."
# AuthName "Authorization Required."
# AuthUserFile /etc/apache2/conf/htpasswd
# Require user mysolr
#
#################################################################################################
## Filtrage IP pour l'acces à SOLR
#RewriteCond %{REMOTE_ADDR} !^10\.10\.10\.9[8-9]$
#RewriteCond %{REMOTE_ADDR} !^10\.10\.10\.10[0-2]$
#RewriteCond %{REQUEST_URI} ^/solr/(.*)$
#RewriteRule .* - [F]
#RewriteCond %{LA-U:REMOTE_USER} !^$
#RewriteCond %{REQUEST_URI} ^/solr/(.*)$
#RewriteRule ^/solr/(.*)$ http://127.0.0.1:8983/solr/$1 [P,L]
#################################################################################################
## the default timeout is 5 minutes, but it do exists very long operations (building live workspace) where the js timeout is set to 10 hours.
##
ProxyTimeout 36000
#################################################################################################
## These lines are used to allow access to /_admin only to the specified IPs
##
##
#RewriteCond %{REMOTE_ADDR} !^10\.10\.10\.9[8-9]$
#RewriteCond %{REMOTE_ADDR} !^10\.10\.10\.10[0-2]$
#RewriteRule ^/_admin/.* - [F]
#################################################################################################
## Proxy for HTTP
##
RewriteRule ^(/.*)$ http://localhost:8080$1 [P,L]
ProxyPassReverse / http://localhost:8080/
# Autorisation locale de proxification
Require all granted
#################################################################################################
## Proxy for HTTPS
##
#RewriteRule ^(/.*)$ http://localhost:8082$1 [P,L]
#ProxyPassReverse / http://localhost:8082/
#
# Require all granted
#
#################################################################################################
## Logs
##
LogFormat "%h %l %u %t \"%r\" %>s %b %D \"%{Referer}i\" \"%{User-Agent}i\"" bo-detailed
ErrorLog /var/log/apache2/cms.mondomaine.com-error.log
CustomLog /var/log/apache2/cms.mondomaine.com-access.log bo-detailed