Network & Data Centers Operational (99.98% Uptime) 100% Green Power
Web hosting (DirectAdmin)

Advanced: scripts, permissions, MIME types and Nginx templates

For developers: CGI and Perl scripts, file permissions, Apache handlers, MIME types and Nginx templates.

Updated on 5 November 2026

This article is for developers and advanced users. For a normal website or WordPress you usually do not need it.

Web server and .htaccess

Knippin servers run Nginx in front of Apache. Nginx quickly serves static files; Apache handles the rest. As a result, .htaccess files simply work, for example for redirects or WordPress permalinks.

PHP scripts

PHP files (.php) work in any folder under public_html. For the version and settings, see PHP version and settings. Running a script on a schedule? See Cron jobs.

Paths you will often need:

What Path
Your website /home/username/domains/voorbeeld.nl/public_html
PHP on the command line php (or /usr/local/bin/php)
Perl /usr/bin/perl

CGI and Perl scripts

Put CGI scripts in a cgi-bin folder in public_html; create it if it does not exist yet. Check that CGI Access is on for the domain (Account Manager → Domains → your domain).

  • The first line of a Perl script is #!/usr/bin/perl.
  • Upload the script as text (in FTP: ASCII mode) so the line endings are correct.
  • Give the script permissions 755.

System Info & Files → Perl Modules lists the available Perl modules. Missing one? Create a ticket.

Perl modules in DirectAdmin

File permissions

Change permissions in the File Manager with Set permissions, or in your FTP client.

Permissions For
644 Normal files: HTML, images, PHP files
755 Folders and CGI scripts
600 Files containing passwords, such as a configuration file

Never use 777. That lets anyone on the server change the file. At Knippin, PHP runs as your own user, so 644 and 755 are always enough.

Apache handlers

Advanced Features → Apache Handlers links a file extension to a handler. For example, run .html files as CGI by linking handler cgi-script to extension .html. System handlers shows what is set up by default.

Apache handlers in DirectAdmin

MIME types

A MIME type tells the browser what kind of file it is. Is a file downloaded instead of displayed, or the other way round? Add the right type under Advanced Features → MIME types, for example application/json for extension json. System MIME types lists the defaults.

MIME types in DirectAdmin

Nginx templates

Some applications, such as Laravel or a shop that works without .htaccess, need special Nginx rules. Under Advanced Features → Nginx Templates you turn on ready-made templates with Enable and Add Template: choose a location (folder) and a template.

Nginx templates in DirectAdmin

Not sure which template you need, or looking for a custom rule? Create a ticket.

SSH and Redis

SSH access and Redis are off by default. Need them, for example for Git, Composer or caching? Create a ticket and we will look at the options.

More about Web hosting (DirectAdmin)

Still stuck? Create a ticket in the customer panel or call us on 0475 227 400. We are happy to help. Create a ticket →