Server configuration

Here's how to set up different web servers.

Apache

The .htaccess configuration file for the Apache web server:


RewriteEngine on

DirectoryIndex index.html yellow.php
RewriteRule ^(cache|content|system)/ error [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ yellow.php [L]

When your website doesn't work, it shows "Datenstrom Yellow requires Apache rewrite module". Please check the following steps. Add RewriteBase to your configuration file, this will fix most Apache web server problems. Here's an example for a subfolder:


RewriteEngine on
RewriteBase /yellow/
DirectoryIndex index.html yellow.php
RewriteRule ^(cache|content|system)/ error [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ yellow.php [L]

When your website still doesn't work and complains about the rewrite module, then please check the Apache web server. You probably have to enable the rewrite module and configure AllowOverride All in the web server settings.

When file access doesn't work, it shows "Datenstrom Yellow requires Apache read/write access". Make sure that the web server can read and write files. You can manually adjust file permissions so that the web server can overwrite files, for example with command chmod -R a+rw *. As an alternative you can assign the group www-data and umask 002 to the web server and users.

Nginx

The nginx.conf configuration file for the Nginx web server:

server {
    listen 80;
    server_name website.com;
    root /var/www/website/;
    index index.html yellow.php;

    location /cache {
        rewrite ^(.*)$ /error break;
    }

    location /content {
        rewrite ^(.*)$ /error break;
    }

    location /system {
        rewrite ^(.*)$ /error break;
    }

    location / {
        if (!-e $request_filename) {
            rewrite ^/(.*)$ /yellow.php last;
            break;
        }
    }

    location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index yellow.php;
        include fastcgi_params;
    }
}

When your website doesn't work, it shows "Datenstrom Yellow requires Nginx rewrite module". Please check server_name and root in the configuration file. If the configuration file has been changed, you need to restart/reload the Nginx web server.

When file access doesn't work, it shows "Datenstrom Yellow requires Nginx read/write access". Make sure that the web server can read and write files. You can manually adjust file permissions so that the web server can overwrite files, for example with command chmod -R a+rw *. As an alternative you can assign the group www-data and umask 002 to the web server and users.

Static website

If you want to create a static website, use the static site generator. This is done by running a build command from within the installation folder. It generates a static website, that works on almost any web server.

You can create a static website from the command line:

  1. Open a terminal window.
  2. Go to your installation folder, where the yellow.php is.
  3. Type the following line: php yellow.php build

This will build a static website in folder public. Upload the folder to your web hosting and build a new version when needed. The URL of the website can be defined in the system settings, for example StaticUrl: http://website/.

As an alternative to a static website you can build a cache. This will speed up your website, but the cache has to be updated repeatedly. Here's an example: php yellow.php build cache. To clean the cache type the following line: php yellow.php clean cache.

Test static website

If you want to test a static website, use the built-in web server. This is especially handy for developers, since everything runs on your own computer. With this philosophy you completely bypass any web server problem.

You can start the built-in web server from the command line:

  1. Open a terminal window.
  2. Go to your installation folder, where the yellow.php is.
  3. Type the following line: php -S localhost:8000 yellow.php

The website is available as http://localhost:8000. Furthermore, you can edited your website in a web browser with http://localhost:8000/edit/. You can browse your website, make some changes and see the result immediately.

Error page

When there are problems an error page is shown. When a web browser requests a file that the web server doesn't find, your website will show an error page with “File not found”. The file system/config/page-error-404.txt defines how this error page looks like:

---
Title: File not found
---
The requested file was not found. Oh no...

Usually there's nothing more to do. If you create a static website with Datenstrom Yellow, there's one additional step. Configure your web server to display your custom error page.

For Apache add the following line to your configuration file:

ErrorDocument 404 /404.html

For Nginx add the following line to your configuration file:

error_page 404 /404.html;

Next: Language configuration →