How to Install Trusted-CGI on Linux Mint
Trusted-CGI is a web-based system that allows you to write your own server-side scripts on your web server. With this tool, you can execute CGI scripts with the designated user interface, and the scripts' inputs are validated and filtered automatically. This tutorial will guide you through the installation of Trusted-CGI on Linux Mint.
Prerequisites
Before proceeding with the installation process, ensure that your system meets the following requirements:
- A web server, preferably Nginx, Apache, or Lighttpd.
- PHP version 7.4 or higher and PDO extensions.
- Git version control system.
Step 1: Installing the Dependencies
Open the terminal and update the package lists, if not done already, using the following command:
sudo apt updateOnce the update is complete, install the necessary dependencies by running the following command:
sudo apt install php-fpm php-pdo php-json php-sqlite3
Step 2: Installing Trusted-CGI
Clone the Trusted-CGI repository using Git. Type the following command in the terminal:
git clone https://github.com/reddec/trusted-cgi.gitNavigate to the cloned repository using
cdcommand:cd trusted-cgiCreate a new configuration file
config.yml. To create it easily, you can copy the default configuration file:cp config.dist.yml config.ymlVerify that
config.yml.disthas been copied toconfig.yml:lsIf it shows
config.dist.ymlandconfig.ymlin the list, then it has been copied successfully.
Step 3: Configuring Nginx
Open the Nginx configuration file for the default server:
sudo nano /etc/nginx/sites-available/defaultInside the
server { ... }configuration block, add the following server block:location /trusted-cgi { alias /var/www/trusted-cgi/; index index.php; try_files $uri $uri/ /trusted-cgi/index.php?$query_string; } location ~ \.php$ { try_files $uri /index.php =404; fastcgi_pass unix:/var/run/php/php7.4-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; }Save and Exit the file by pressing
Ctrl + X, followed byYand thenEnter.Restart Nginx to apply the changes:
sudo service nginx restart
Step 4: Testing Trusted-CGI
In your web browser, enter
http://localhost/trusted-cgi/to test.If everything is set up correctly, then you should see the Trusted-CGI dashboard:

Conclusion
In this tutorial, you have learned how to install Trusted-CGI on Linux Mint. Trusted-CGI is a web-based system that allows you to write your own server-side scripts on your web server. This tool is incredibly useful for developers who need to create custom applications that require complex server-side processing.