Fixing SFTP Not Working After Installing HestiaCP

After installing HestiaCP, SFTP may stop working while SSH continues to function. This issue occurs due to an incorrect SFTP subsystem configuration in the SSH configuration file. This guide explains how to identify and fix the problem.

Step 1: Verify the SFTP Server Location

Run the following command to locate the installed SFTP server binary:

find / -name "sftp-server" 2>/dev/null

The output should display paths similar to:

/usr/lib/openssh/sftp-server /usr/lib/sftp-server

Step 2: Update the SSH Configuration

If the SSH configuration is pointing to a non-existent SFTP subsystem, update it with the correct path.

  • Open the SSH configuration file:

sudo nano /etc/ssh/sshd_config

  • Locate the following line:

Subsystem sftp internal-sftp-server

  • Replace it with the correct SFTP server path found in Step 1, such as:

Subsystem sftp /usr/lib/openssh/sftp-server

  • Save the file and exit (CTRL + X, then Y, then ENTER).

Step 3: Restart SSH Service

Apply the changes by restarting the SSH service:

sudo systemctl restart ssh

Step 4: Test SFTP Connection

Verify that SFTP is working by running:

sftp -v root@your-server-ip

If the connection is successful, the issue has been resolved. If the problem persists, check for firewall rules or Fail2Ban restrictions.

This process restores SFTP functionality after installing HestiaCP, ensuring SSH correctly references the installed SFTP server.

Contact form 7 – Javascript API

Contact Form 7 emits a number of Javascript events that bubble up to the document object. In version 4.1 they can be found in contact-form-7/includes/js/scripts.js. If you’re using jQuery you can access those events like this:

$(document).on('spam.wpcf7', function () {
console.log('submit.wpcf7 was triggered!');
});

$(document).on('invalid.wpcf7', function () {
console.log('invalid.wpcf7 was triggered!');
});

$(document).on('mailsent.wpcf7', function () {
console.log('mailsent.wpcf7 was triggered!');
});

$(document).on('mailfailed.wpcf7', function () {
console.log('mailfailed.wpcf7 was triggered!');
});

Sync AMPPS with multiple machines

Here is a roadmap to establish AMPPS with Dropbox:

  • Download and install the latest version of AMPPS. In the Programs folder will include the folder “var” and “www” are created. In the database files already come “var” folder and “www”, all individual files of your website.
  • Create a folder under your Dropbox account “AMPPS” on it. Move the folder “var” and “www” in your AMPPS folder to your Dropbox folder. The folders are so removed from your Application folder. With the following commands, create a symlink from the Dropbox folder, and the folder AMPPS. To do this to you Mac Terminal.

cd ~ / Dropbox / AMPPS

ln -s ~ /Dropbox/AMPPS/var /Applications/AMPPS/var

ln -s ~ /Dropbox/AMPPS/www /Applications/AMPPS/www

To see if everything is linked correctly, you can check this yet:

cd /Applications/AMPPS

ls -ll

Reset “Use Secure in Front End or Admin” in Database – Magento

I ran into an issue this week where I switched on SSL on a development site and then realized the SSL cert was not installed correctly. This is a big issue in Magento because there is no way to get back to the admin to switch it back off.

If this ever happens do the following to switch back:

1. Open up your admin panel (cPanel or other)
2. Go to phpMyAdmin (if MySql)
3. Find your Magento Database
4. Find table “core_config_data”
5. Look for the columns “web/secure/use_in_frontend” and “web/secure/use_in_adminhtml”
6. Edit both values, make them equal to “0”

After this is done you will be back in action.