<VirtualHost *:80>

#ServerName www.example.com

ServerAdmin webmaster@localhost

ErrorLog ${APACHE_LOG_DIR}/stat-error_log
TransferLog ${APACHE_LOG_DIR}/stat-access_log

#don't enable redirect to HTTPS!!!
RewriteEngine Off

DocumentRoot /opt/Eye/html

<Directory "/opt/Eye/html">
    Options -Indexes -FollowSymLinks
    AllowOverride All
    Require all granted

    AddType application/x-httpd-php .php

# Redirect to local php-fpm if mod_php is not available
<IfModule !mod_php8.c>
<IfModule proxy_fcgi_module>
    # Enable http authorization headers
    <IfModule setenvif_module>
    SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=$1
    </IfModule>

    <FilesMatch ".+\.ph(ar|p|tml)$">
#    SetHandler "proxy:unix:/run/php/php8.2-fpm-eye.sock|fcgi://127.0.0.1:9002"
    SetHandler "proxy:fcgi://127.0.0.1:9002"
    </FilesMatch>

    <FilesMatch ".+\.phps$">
        # Deny access to raw php sources by default
        # To re-enable it's recommended to enable access to the files
        # only in specific virtual host or directory
        Require all denied
    </FilesMatch>
    # Deny access to files without filename (e.g. '.php')
    <FilesMatch "^\.ph(ar|p|ps|tml)$">
        Require all denied
    </FilesMatch>
</IfModule>
</IfModule>

</Directory>

<Directory /opt/Eye/html/log>
    <IfModule mod_authz_core.c>
    Require all denied
    </IfModule>
</Directory>

<Directory /opt/Eye/html/tmp>
    <IfModule mod_authz_core.c>
    Require all denied
    </IfModule>
</Directory>

<Directory /opt/Eye/html/session>
    <IfModule mod_authz_core.c>
    Require all denied
    </IfModule>
</Directory>

AddDefaultCharset UTF-8

</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
