Skip to Content
Flute CMS v1.0.0 — Получить ключ доступа
GuidesWeb Server

Web Server Setup for Flute CMS

A web server is a program that accepts requests from visitors’ browsers and serves them your website’s pages. The most popular web servers are Apache and Nginx. The key thing to configure correctly is the Document Root (the site’s root folder). Document Root tells the web server which folder on disk contains the files that should be accessible to visitors through a browser.

Proper web server configuration is critically important for Flute CMS to work correctly. This guide covers all popular control panels and servers.

Important! The site’s root folder must point to the public/ folder from the Flute CMS archive, not the project root!

Why specifically public/? This is a security concern. The Flute CMS project root contains configuration files with database passwords, internal folders like storage/, config/, vendor/, and other internal files. If the Document Root points to the project root, any visitor could access these files through the browser. The public/ folder contains only files that are safe to show visitors (index.php, styles, scripts, images).

Hosting Control Panels

FastPanel

FastPanel is a modern hosting control panel with a user-friendly interface.

Log into FastPanel

  1. Open your browser and navigate to your panel address (usually https://example.com:8888)
  2. Enter the administrator login and password

Create a site

  1. In the main menu, select “Sites”
  2. Click “Add Site”
  3. Fill in the fields:
    • Domain: your domain (e.g., example.com)
    • PHP Version: select 8.2 or higher
    • Root folder: leave the default or specify public_html

Configure PHP

  1. Go to the “PHP” section for your site
  2. Make sure the following extensions are enabled:
    • opcache
    • pdo_mysql
    • gd
    • bcmath
    • json
    • ioncube
    • mbstring
    • simplexml
    • zip
    • curl
    • gmp

Upload Flute CMS files

  1. In the “Files” section, navigate to the site folder
  2. Upload the Flute CMS archive
  3. Extract the archive in the site root, keeping the structure with the public/ folder

Configure Document Root

  1. In the site settings, find “Document Root”
  2. Set the path to the public/ folder inside the project (e.g., /home/user/domains/example.com/public or /home/user/domains/example.com/public_html/public if the panel created public_html)
  3. Save the changes

The public/ folder is the only folder that should be accessible from the internet. All other project folders (config/, storage/, vendor/, etc.) contain confidential data and internal code. If the Document Root does not point to public/, attackers could gain access to configuration files containing database passwords and other sensitive information.

Create a database

  1. Go to the “Databases” section
  2. Click “Create Database”
  3. Fill in:
    • Database name: flute_cms
    • User: create a new user
    • Password: generate a strong password
  4. Write down the connection details

FastPanel usually does not require additional .htaccess configuration — everything works automatically.

Direct Web Server Configuration

This section is intended for advanced users who want to configure the web server directly. If you are unsure what you are doing, it is better to use hosting control panels.

Apache

Configuration for the Apache web server.

Virtual Host

Create a virtual host configuration file:

<VirtualHost *:80> ServerName example.com ServerAlias www.example.com DocumentRoot /var/www/flute-cms/public <Directory /var/www/flute-cms/public> AllowOverride All Require all granted # Enable mod_rewrite RewriteEngine On # Route all requests through index.php RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php [QSA,L] </Directory> # Deny access to internal folders <Directory /var/www/flute-cms/storage> Require all denied </Directory> <Directory /var/www/flute-cms/config> Require all denied </Directory> # Logs ErrorLog ${APACHE_LOG_DIR}/flute-cms-error.log CustomLog ${APACHE_LOG_DIR}/flute-cms-access.log combined </VirtualHost>

SSL Configuration

For HTTPS, add:

<VirtualHost *:443> ServerName example.com ServerAlias www.example.com DocumentRoot /var/www/flute-cms/public # SSL settings SSLEngine on SSLCertificateFile /path/to/certificate.crt SSLCertificateKeyFile /path/to/private.key SSLCertificateChainFile /path/to/chain.crt # The rest of the configuration is the same as HTTP <Directory /var/www/flute-cms/public> AllowOverride All Require all granted RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php [QSA,L] </Directory> </VirtualHost>

.htaccess File

Make sure the public/ folder contains an .htaccess file:

<IfModule mod_rewrite.c> RewriteEngine On # Redirect to HTTPS (optional) # RewriteCond %{HTTPS} off # RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] # Request handling RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php [QSA,L] </IfModule> # Security <Files "*.env"> Require all denied </Files> <Files "composer.*"> Require all denied </Files> # Static file caching <IfModule mod_expires.c> ExpiresActive On ExpiresByType text/css "access plus 1 month" ExpiresByType application/javascript "access plus 1 month" ExpiresByType image/png "access plus 1 month" ExpiresByType image/jpg "access plus 1 month" ExpiresByType image/jpeg "access plus 1 month" ExpiresByType image/gif "access plus 1 month" ExpiresByType image/svg+xml "access plus 1 month" </IfModule>

Verifying the Configuration

After setting up the web server, perform the following checks:

1. Check Accessibility

Open your site in a browser. You should see:

  • The Flute CMS installation page (if installation is not complete)
  • The site’s home page (if installation is complete)

2. Check PHP

Create a temporary info.php file in the site root:

<?php phpinfo(); ?>

Open https://example.com/info.php and check:

  • The PHP version (must be 8.2+)
  • That all necessary extensions are present
  • Opcache settings

Delete the info.php file after checking for security!

3. Check Access Permissions

Make sure the web server can write to the following folders:

  • storage/
  • storage/logs/
  • storage/app/cache/
  • public/uploads/

4. Check .htaccess / URL Rewriting

Try opening a non-existent page (e.g., /test). You should see:

  • A Flute CMS 404 page
  • Or the installation page

If you see the web server’s default 404 error, URL rewriting is not configured correctly.

Possible Problems

500 Internal Server Error

Causes:

  • Incorrect access permissions
  • Missing PHP extensions
  • Errors in .htaccess
  • Insufficient PHP memory

Solution:

  1. Check the web server logs
  2. Enable PHP error display
  3. Check access permissions (755 or 777 for storage/)
  4. Increase memory_limit in PHP

404 Not Found Error

Causes:

  • Incorrect Document Root
  • URL rewriting not working
  • Missing index.php

Solution:

  1. Make sure the Document Root points to the public/ folder
  2. Ensure mod_rewrite is enabled (Apache) or try_files is configured (Nginx)
  3. Check that the public/index.php file exists

White Page

Causes:

  • PHP errors
  • Insufficient memory
  • Missing dependencies

Solution:

  1. Enable PHP error display
  2. Check the PHP logs
  3. Make sure the vendor/ folder exists and contains dependencies

File Upload Problems

Causes:

  • Incorrect access permissions
  • PHP file upload restrictions

Solution:

  1. Set permissions to 755 or 777 on public/uploads/
  2. Check the upload_max_filesize and post_max_size settings in PHP
  3. Make sure file_uploads = On in PHP

If the problems persist, seek help in the Discord community  or create an issue on GitHub .

Performance Optimization

After setting up the web server, it is recommended to:

  1. Enable Opcache to speed up PHP
  2. Configure caching for static files
  3. Enable compression (gzip/brotli)

For more details on optimization, see the Performance Optimization section.