E-mails sent from Django appear as webmaster@host.domain.tld

Overview E-mails sent from a Django application may use “webmaster@host.domain.tld” or another erroneous address as the From field. Cause ServerAdmin values are not set in Apache configuration for virtual hosts to prevent unintentional information leakage. Solution Set DEFAULT_FROM_EMAIL and SERVER_EMAIL in your Django settings file. An example configuration follows: EMAIL_HOST=’localhost’ EMAIL_PORT=’587′ EMAIL_HOST_USER=’myadmin@mydomain.com’ EMAIL_PASSWORD=’mysmtppassword’ DEFAULT_FROM_EMAIL=EMAIL_HOST_USER SERVER_EMAIL=EMAIL_HOST_USER Replace EMAIL_HOST_USER and EMAIL_PASSWORD values with your…

Viewing PHP settings

Overview Default PHP settings may be viewed either as a standalone page or within an application using phpinfo() or ini_get(). Default Environment Settings To view your default environment settings, create a file named phpinfo.php inside your document root. Inside this file, include the following line: <?php phpinfo(); ?> Access the URL phpinfo.php from your web…

.htaccess Guide

Overview An .htaccess file contains directives that the web server will apply to a collection of resources before a page is displayed. For example, a .htaccess file may change PHP configuration, deny access, change the page displayed, and even redirect a resource to another URL. These are denoted by a directive. A directive consists of a directive…