Where I config CNAME in VPS Server without Cpanel

You can't redirect a hostname to an URL with DNS (CNAME record) alone.

There's plenty of things you need to know, but the correct path may be this (or something similar):

  1. You need to find out whether your VPS is the master name server for your domain. If it is:
  2. Lets assume you have BIND. Your file location can be found from /etc/bind/named.conf (or any other config file included there, like named.conf.local). There should be line

    zone "example.com" { type master; file "/etc/bind/db/example.com"; };
    
  3. In the zone file found, you can start by adding * IN CNAME example.com. and updating serial in your @ IN SOA to be in format YYYYMMDDNN with current date and order number.

  4. Reload the changed zone file by command rndc reload.
  5. Add the redirect as VirtualHost on your Apache configuration (e.g. by adding new file in /etc/apache2/sites-available/subdomains.example.com):

    <VirtualHost *:80>
        ServerName subdomains.example.com
        ServerAlias *.example.com
        Redirect / http://example.com/test
    </VirtualHost>
    
  6. Enable site with a2ensite subdomains.example.com and service apache2 reload.

Whether the steps are exactly these or not, there will be all corresponding phases.