Saturday, October 27, 2018

smtplib.SMTPServerDisconnected: Connection unexpectedly closed: [Errno 104] Connection reset by peer

Django Python Error : SMTP Connection closed abruptly

If you are using Yandex smtp to send mails, here are the settings.

EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_USE_TLS = True
EMAIL_HOST = 'smtp.yandex.com'
EMAIL_HOST_USER = 'username@domain.com'
EMAIL_HOST_PASSWORD = 'password'
EMAIL_PORT = 587


Do not use port 465, try with port 587.

If still it does not work, you need to check the environment variables. Have you defined DEFAULT_FROM_EMAIL or HOST in OS environment files i.e. ~/.bashrc or /etc/environment
If they are there, it may be the issue, you need to comment them and loginto the new terminal as updated settings will be affected, now restart your web server (Python) and try again sending mails.

Monday, October 15, 2018

Databases created in cpanel mysql are not visible in cpanel phpmyadmin

Solution :

  • Confirm that databases are visible under mysql section of cpanel.
  • Logout from cpanel
  • Login into cpanel again.
  • Open phpmyadmin.

Now databases should be visible in phpmyadmin

Thursday, September 6, 2018

AH01797: client denied by server configuration

If you get this message in your logs, it means mentioned Directory or File has been prohibited by server configuration. 

You have mentioned that this directory or file should not be accessible by user.

In many cases, most common forbidden file is xmlrpc.php of wordpress because it may be one reason of DDOS attack. That's why system administrators block this file to access using GET method.

Other forbidden object can be uploads or config directory.