<VirtualHost *:80>
#
# /etc/apache2/sites-availble/default
# Apache configuration file
#
# eDokumenty sp z o.o. (c) 2006/2023
# @version 0.8
# @author Jacek Paszek
#
# Base configuration for use of Ready_�
# TODO
# Konfiguracja SVN
# Konfiguracja mod_dav
# 
# Last modified: 23.08.2023
#

ServerAdmin admins@betasoft.pl
ServerSignature Off
#zmienić na właściwą domenę
ServerName example.com
ServerAlias www.example.com

DocumentRoot /home/edokumenty/public_html
DirectoryIndex index.html index.cgi index.pl index.php index.xhtml engine

#Odkomentaowac w przypadku posiadnia certyfiaktu SSL i blokowanie logowania po IP
#RewriteEngine On
#RewriteCond %{HTTPS} off
#RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI}

# Aliasy dla domy�lnych system�w
<IfModule mod_alias.c>
    Alias /edokumenty /home/edokumenty/public_html
    Alias /sync /home/edokumenty/public_html/apps/sync/engine.php
    Alias /vdisk /home/edokumenty/public_html/apps/edokumenty/webdav2.php
    Alias /caldav /home/edokumenty/public_html/dav.php
</IfModule>

# Handler dla plik�w php
<FilesMatch "(.+[.]inc$|.+[.]php$|engine$)">
    SetHandler "proxy:unix:/var/run/php/php8.2-fpm.sock|fcgi://localhost/"
</FilesMatch> 

SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1

# Domy�lny katalog dla redirect                       
<Directory /home/*/public_html/>
    Options -Indexes +FollowSymLinks +MultiViews
    AllowOverride Options
    Require all granted
    # Odwo�ania do nazwy serwera przekieruj� do edokument�w
</Directory>

<Directory "/home/*/public_html/apps/edokumenty/var">
	<FilesMatch "\.(php|inc)$">
		SetHandler none
		Require all denied
	</FilesMatch>
		Options -Indexes +FollowSymLinks +MultiViews
		AllowOverride None
		Order allow,deny
		allow from all
</Directory>

<Directory "/home/*/public_html/apps/edokumenty/var/log">
	<FilesMatch ^>
		SetHandler none
		Require all denied
	</FilesMatch>
</Directory>

<Directory "/home/*/public_html/apps/edokumenty/install-">
    Order deny,allow
    Deny from all
    Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>

ErrorLog /var/log/apache2/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog /var/log/apache2/access.log combined

</VirtualHost>