Yes, it is possible to remove websites from Plesk using SSH. Here are the steps you can follow:
Connect to your server using SSH
Navigate to the directory where Plesk stores its configuration files. The location of this directory may vary depending on your server's operating system, but it is typically one of the following:
- On CentOS/RHEL: /etc/httpd/conf/plesk.conf.d
- On Debian/Ubuntu: /etc/apache2/plesk.conf.d
Create a backup of the configuration file that corresponds to the website you want to remove. For example, if the website is example.com, the configuration file might be /etc/httpd/conf/plesk.conf.d/vhosts/example.com.conf. You can create a backup of this file by running the following command:
cp /etc/httpd/conf/plesk.conf.d/vhosts/example.com.conf /root/example.com.conf.bak
Edit the configuration file using your preferred text editor. For example:
Find the section of the file that corresponds to the website you want to remove. This section will typically be enclosed in <VirtualHost> tags and will contain information about the website's domain name, document root, and other settings.
- Delete this section from the file.
- Save the file and exit the text editor.
- Restart Apache using the following command:
systemctl restart apache2
After completing these steps, the website should be removed from Plesk and you should be able to add your new trial license key. Please note that removing a website from Plesk using SSH can be complex and may have unintended consequences, so it is important to proceed with caution and ensure that you have a backup of your server's configuration files before making any changes.