Files
local-transcription/server/php/.htaccess
Josh Knapp af1c1231b6 Fix PHP-FPM compatibility and add server diagnostics
Changes to .htaccess:
- Removed php_flag and php_value directives (don't work with php-fpm)
- Simplified DirectoryMatch to FilesMatch for .json files
- Added note about configuring PHP settings in php.ini/pool config
- More compatible with user directories

Added diagnostic.php:
- Tests PHP version, extensions, and configuration
- Checks storage directory permissions
- Tests Server-Sent Events (SSE) connection
- Shows server API type (php-fpm vs mod_php)
- Provides troubleshooting hints for common issues
- Live SSE connection test with detailed logging

Added data/index.php:
- Blocks direct access to data directory
- Returns 403 Forbidden

Fixes:
- php-fpm environments not respecting .htaccess PHP settings
- DirectoryMatch issues in user directories
- Hard to diagnose connection problems

Usage: Navigate to diagnostic.php to troubleshoot server issues
2025-12-26 12:45:23 -08:00

29 lines
797 B
ApacheConf

# Security settings for Multi-User Transcription Server
# Compatible with both mod_php and php-fpm
# Deny access to config file directly (if accessed via URL)
<Files "config.php">
Require all denied
</Files>
# Deny access to .json data files
<FilesMatch "\.json$">
Require all denied
</FilesMatch>
# Disable directory listing
Options -Indexes
# Enable compression
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/json
</IfModule>
# Set MIME types
AddType application/json .json
AddType text/event-stream .php
# NOTE: PHP settings (display_errors, upload limits) must be configured in:
# - For php-fpm: /etc/php/X.X/fpm/pool.d/www.conf or php.ini
# - For mod_php: Can use php_flag/php_value directives here