#
# Bareos WebUI Apache configuration file
#

# Environment Variable for Application Debugging
# Set to "development" to turn on debugging mode or
# "production" to turn off debugging mode.
<IfModule env_module>
	SetEnv "APPLICATION_ENV" "production"
</IfModule>

Alias /bareos-webui /var/www/localhost/htdocs/bareos-webui/public

<Directory /var/www/localhost/htdocs/bareos-webui>

	Options FollowSymLinks
	AllowOverride None

	<IfModule mod_authz_core.c>
		<IfModule mod_access_compat.c>
		    Order deny,allow
		</IfModule>
		Require all granted
	</IfModule>

	#<IfModule mod_rewrite.c>
	<IfModule rewrite_module>
		RewriteEngine on
		RewriteBase /bareos-webui
		RewriteCond %{REQUEST_FILENAME} -s [OR]
		RewriteCond %{REQUEST_FILENAME} -l [OR]
		RewriteCond %{REQUEST_FILENAME} -d
		RewriteRule ^.*$ - [NC,L]
		RewriteRule ^.*$ index.php [NC,L]
	</IfModule>

	<IfDefine PROXY>
		<FilesMatch "\.php$">
			SetHandler "proxy:unix:/var/run/php-fpm/www.sock|fcgi://localhost"
		</FilesMatch>

		# Set it to handle the files
		<IfModule mime_module>
			AddHandler application/x-httpd-php .php .php5 .phtml
			AddHandler application/x-httpd-php-source .phps
		</IfModule>

		DirectoryIndex index.php index.phtml
	</IfDefine>
</Directory>
