Skip to content

Web Server

QUIQQER generates web server routing files for the installation. Operators should change custom rules through the supported custom files and then regenerate the generated server file.

Apache HTACCESS

Generate the Apache .htaccess file from the installation root:

shell
./console htaccess

See Console for the general command calling pattern.

The generated file includes custom rules from:

text
etc/htaccess.custom.php

Put local Apache customizations into that custom file instead of editing the generated .htaccess directly. Regenerate .htaccess after changing the custom file.

See Configuration for the role of etc/ files.

The generator creates a backup of an existing .htaccess below var/backup/ before writing the new file. Keep custom rules in etc/htaccess.custom.php; the generated root .htaccess can be replaced during updates or regeneration.

Apache And PHP-FPM

QUIQQER's generated Apache rules route virtual URLs to index.php and map special paths such as /bin, /lib, and /admin to the Core package directories.

When Apache is used with PHP-FPM or another proxy/FastCGI setup, make sure:

  • rewrite rules are processed before the QUIQQER front controller receives the request
  • PHP receives the original request URI and query string
  • static package assets below /packages/, /bin/, and generated media paths stay readable
  • the web server user and PHP-FPM user can write runtime directories that need writes

If a static path is handled by QUIQQER instead of the web server, add an early exception in etc/htaccess.custom.php and regenerate .htaccess.

Static Directories

When a static directory should be served before QUIQQER handles the request, add the exception near the top of etc/htaccess.custom.php.

Example for a static documentation directory under /docs:

apache
<IfModule mod_rewrite.c>
    RewriteEngine On

    RewriteRule ^docs/?$ /docs/index.html [END]

    RewriteCond %{DOCUMENT_ROOT}/docs/$1 -f
    RewriteRule ^docs/(.*)$ - [END]

    RewriteCond %{DOCUMENT_ROOT}/docs/$1 -d
    RewriteRule ^docs/(.*)$ - [END]

    RewriteCond %{DOCUMENT_ROOT}/docs/$1/index.html -f
    RewriteRule ^docs/(.*)/?$ /docs/$1/index.html [END]

    RewriteCond %{DOCUMENT_ROOT}/docs/$1.html -f
    RewriteRule ^docs/(.*)$ /docs/$1.html [END]
</IfModule>

This lets Apache serve existing files, directories, directory index pages, and extensionless static HTML pages under /docs before the QUIQQER front controller handles the request.

NGINX

QUIQQER also provides a console tool for NGINX configuration generation:

shell
./console --tool=quiqqer:nginx

Use the generated output as the basis for the web server configuration and keep local server-specific changes in the server configuration managed by operations.

The generator writes the main example configuration to:

text
etc/nginx/nginx.example.conf

It also creates include files below:

text
etc/nginx/conf.d/

Use these include files for local server-specific changes such as PHP-FPM, redirect, SSL, whitelist, and server configuration. Replace the generated example PHP-FPM socket path with the real PHP-FPM socket or upstream used by the server.

The generated NGINX routing uses virtual path checks. Missing real files are rewritten to QUIQQER's front controller, while known static paths and admin paths are handled separately.

After Web Server Changes

After changing routing rules:

  • regenerate the generated server file when Apache .htaccess is used
  • reload the web server when the server configuration changed
  • test the public homepage
  • test the administration interface
  • test static directories and assets
  • check the web server error log

Troubleshooting

SymptomCheck
Static files return a QUIQQER pageAdd an early Apache/NGINX exception for the static path before the front-controller rewrite.
Extensionless static docs return 404Add a rewrite from the extensionless path to the generated .html file.
Admin or frontend returns 403 after web server changesCheck generated deny rules, custom rules, document root, and whether the request is rewritten to the expected target.
NGINX returns 502/504Check the PHP-FPM socket/upstream path in etc/nginx/conf.d/ and PHP-FPM availability.
CLI generation works but web requests failCompare CLI user, PHP-FPM user, file ownership, and web server include paths.

Released under GPL-3.0-or-later.