refs #184 Updated Apache2 configuration template

pull/1/head
Alvaro Puente Mella 2024-03-13 10:54:10 +01:00
parent 33b4eaadd6
commit 5f32ddd66f
1 changed files with 24 additions and 20 deletions

View File

@ -1,25 +1,29 @@
# OpenGnsys ogdhcp configuration for Apache.
Alias /opengnsys3/rest OGHDPCDIR
<VirtualHost *:80>
ServerName localhost
DocumentRoot /opt/ogdhcp/public
# PHP-FPM configuration
<IfModule proxy_fcgi_module>
<FilesMatch ".+\.ph(p[3457]?|t|tml)$">
SetHandler "proxy:fcgi://127.0.0.1:9000"
<Directory /opt/ogdhcp/public>
AllowOverride None
Require all granted
Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Methods "GET,POST,OPTIONS,DELETE,PUT"
Header set Access-Control-Allow-Headers "x-requested-with, Content-Type, origin, authorization, accept, client-security-token"
FallbackResource /index.php
</Directory>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^/opengnsys3/rest/dhcp/index\.php - [L]
RewriteRule ^/opengnsys3/rest/dhcp/(.*)$ /opengnsys3/rest/dhcp/index.php [QSA,L]
</IfModule>
<FilesMatch \.php$>
SetHandler "proxy:unix:/run/php/php8.1-fpm.sock|fcgi://localhost/"
</FilesMatch>
</IfModule>
RewriteEngine On
# Default configuration.
<Directory OGHDPCDIR>
Require all granted
Options -Indexes +FollowSymLinks
DirectoryIndex index.php
AddType octet/stream .pkg
Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Methods "GET,POST,OPTIONS,DELETE,PUT"
Header set Access-Control-Allow-Headers "x-requested-with, Content-Type, origin, authorization, accept, client-security-token"
FallbackResource /index.php
</Directory>
ErrorLog ${APACHE_LOG_DIR}/ogdhcp_error.log
CustomLog ${APACHE_LOG_DIR}/ogdhcp_access.log combined
</VirtualHost>