<IfModule mod_ssl.c>
<VirtualHost *:443>
	LogLevel debug
	ServerName gwp.bulme.at
	ServerAdmin rai@bulme.at

	ErrorLog /var/log/apache2/error.gwp.bulme.at.log
	LogLevel warn
	CustomLog /var/log/apache2/access.gwp.bulme.at.log combined

	# Set the document root to the live directory, but allow access to other directories via aliases
	DocumentRoot "/var/www/gwp.bulme.at/htdocs/live"
	<Directory /var/www/gwp.bulme.at/htdocs/live>
		Options Indexes FollowSymLinks MultiViews
		AllowOverride None
		Require all granted
		SetHandler "proxy:unix:/run/php/php8.2-fpm.sock|fcgi://localhost/"
	</Directory>
	
	ServerSignature On
	

	Alias /v002 /var/www/gwp.bulme.at/htdocs/v002
	<Directory /var/www/gwp.bulme.at/htdocs/v002/>
		Options FollowSymLinks
		AllowOverride All
		Require all granted
	</Directory>

	Alias /DEV23-RAI /var/www/gwp.bulme.at/htdocs/DEV23-RAI
	<Directory /var/www/gwp.bulme.at/htdocs/DEV23-RAI>
		Options FollowSymLinks
		AllowOverride All
		Require all granted
		<FilesMatch ".+\.ph(ar|p|tml)$">
			SetHandler "proxy:unix:/run/php/php8.3-fpm.sock|fcgi://localhost/"
		</FilesMatch>
	</Directory>
	<LocationMatch "^/DEV23-RAI/.*\.ph(ar|p|tml)$">
		SetHandler "proxy:unix:/run/php/php8.3-fpm.sock|fcgi://localhost/"
	</LocationMatch>

	SSLCertificateFile /etc/letsencrypt/live/gwp.bulme.at/fullchain.pem
	SSLCertificateKeyFile /etc/letsencrypt/live/gwp.bulme.at/privkey.pem
	Include /etc/letsencrypt/options-ssl-apache.conf
	
	Alias /webdav /var/www/gwp.bulme.at/htdocs
	<Location /webdav>
		DAV On
		SSLRequireSSL
		Options Indexes
		AuthType Basic
		AuthName WebDAV
		AuthUserFile /var/www/gwp.bulme.at/htdocs/.htpasswd-webdav
		Require valid-user
		php_flag engine off
		DirectoryIndex disabled
		ForceType text/plain
	</Location>
	
	Alias /webdav-backups /home/wolfgang/backups
	<Location /webdav-backups>
		DAV On
		SSLRequireSSL
		Options Indexes
		AuthType Basic
		AuthName WebDAV
		AuthUserFile /var/www/gwp.bulme.at/htdocs/.htpasswd-webdav
		Require valid-user
		php_flag engine off
		DirectoryIndex disabled
		ForceType text/plain
	</Location>

	Alias /webdav-juc /var/www/gwp.bulme.at/htdocs/juc
	<Location /webdav-juc>
		DAV On
		SSLRequireSSL
		Options Indexes
		AuthName WebDAV
		Authtype Basic
		AuthUserFile /var/www/gwp.bulme.at/.htpasswd-juc
		Require valid-user
		php_flag engine off
		DirectoryIndex disabled
		ForceType text/plain
	</Location>

</VirtualHost>
</IfModule>
