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:

Step 1: Installing the Dependencies

  1. Open the terminal and update the package lists, if not done already, using the following command:

    sudo apt update
    
  2. Once 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

  1. Clone the Trusted-CGI repository using Git. Type the following command in the terminal:

    git clone https://github.com/reddec/trusted-cgi.git
    
  2. Navigate to the cloned repository using cd command:

    cd trusted-cgi
    
  3. Create a new configuration file config.yml. To create it easily, you can copy the default configuration file:

    cp config.dist.yml config.yml
    
  4. Verify that config.yml.dist has been copied to config.yml:

    ls
    

    If it shows config.dist.yml and config.yml in the list, then it has been copied successfully.

Step 3: Configuring Nginx

  1. Open the Nginx configuration file for the default server:

    sudo nano /etc/nginx/sites-available/default
    
  2. Inside 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;
    }
    
  3. Save and Exit the file by pressing Ctrl + X, followed by Y and then Enter.

  4. Restart Nginx to apply the changes:

    sudo service nginx restart
    

Step 4: Testing Trusted-CGI

  1. In your web browser, enter http://localhost/trusted-cgi/ to test.

  2. If everything is set up correctly, then you should see the Trusted-CGI dashboard:

    Trusted CGI

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.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!