# Browse /srv/www/systems at http(s)://192.168.1.177/systems/
# Folder listing at each level; if a folder has index.php / index.html, that loads instead.
# Shortcuts: /pinakle → pinakle, /aelni → aelni, /westway → westway
#
# Enable:
#   sudo bash /srv/www/systems/westway/deploy/enable-systems-web.sh

Alias /systems /srv/www/systems
Alias /pinakle /srv/www/systems/pinakle
Alias /aelni /srv/www/systems/aelni
Alias /westway /srv/www/systems/westway

<Directory /srv/www/systems>
    Options +Indexes +FollowSymLinks
    IndexOptions FancyIndexing HTMLTable NameWidth=* FoldersFirst SuppressDescription
    IndexIgnore .??* .*~
    AllowOverride All
    Require all granted
    DirectoryIndex index.php index.html
</Directory>

# Do not expose DB backups (no listing, no download)
<Directory "/srv/www/systems/old databases">
    Options -Indexes
    Require all denied
</Directory>

# Block sensitive files anywhere under systems
<DirectoryMatch "^/srv/www/systems">
    <FilesMatch "(?i)^(\.env|composer\.(json|lock)|.*\.sql)$">
        Require all denied
    </FilesMatch>
</DirectoryMatch>

# Uploaded content: no PHP execution
<DirectoryMatch "(?i)^/srv/www/systems/.+/(uploaded_files|pdf_submissions|quote_attachments|invoice_attachments|project_details_uploads|order_section_images|Admin/backups|uploads|cache)(/|$)">
    SetHandler None
    <FilesMatch "\.ph(?:ar|p|ps|tml)$">
        Require all denied
    </FilesMatch>
</DirectoryMatch>
