A great linux stuff website

Monthly Archives: April 2013

Outlook is not correctly configured to authenticate when sending email.

Open Outlook
From the Tools menu select Account Settings. The Account Settings box appears.
Verify that the E-mail tab is selected. Your email account appears, usually labeled mail.yourdomain.com
Click on the account to highlight it, and click on the Change icon above it. The Internet E-mail Settings appear.
Click the button More Settings… in the lower right-hand corner. The Internet Email Settings box appears.
Click on the tab Outgoing Server.
Click the check box My outgoing server (SMTP) requires authentication, and verify that the circle-box Use same settings as my incoming mail server is selected.
Click OK to close the Internet Email Settings box.
IMPORTANT: Do NOT use the “Test Account Setting…” button to test the settings. This will fail.
Click the Finish button to close the Internet E-mail Settings box. Click the Close button to close the Account Settings box. SMTP authentication has now been enabled.

Advertisements

Exact issue: email are not being delivered and stay’s in queue, while sending the email forcefully found below error.

# Exim -qff >> use for sending mail quque
2013-04-22 18:41:31 1U9wYO-0004EV-UX Error in system filter: failed to open filter log file “/var/log/filter.log”:
Permission denied (euid=504 egid=32009

Caused : This error is basically due to improper ownership assigned to the file “/var/log/filter.log”.

Check the ownership assigned to the mentioned file

[root@onweblinux ~]# ls -l /var/log/filter.log

-rw-r–r– 1 root root 1009141 April 1 07:23 /var/log/filter.log

Correct the ownership of the file as follows
[root@onweblinux ~]# chown cpaneleximfilter.cpaneleximfilter /var/log/filter.log

Restart the exim service and the mail queue issue should be resolved.

Start Forwarding email queue:

# exim -qff


Create a .htaccess file at the root of your website and add this line:

AddType application/x-httpd-php .html .htm

If your are running PHP as CGI (probably not the case), you should write instead:

AddHandler application/x-httpd-php .html .htm

System Mime Type defaults
Handler Code File Extensions
application/x-hdf hdf
application/vnd.wap.wbxml wbxml
image/x-xbitmap xbm
image/x-icon ico
image/vnd.djvu djvu djv
application/x-troff-me me
application/perl pl plx ppl perl pm
application/x-tcl tcl
image/bmp bmp
text/x-sql sql
image/png png
text/x-log log
audio/x-realaudio ra
application/x-latex latex
application/x-director dcr dir dxr
text/rtf rtf
application/xhtml+xml xhtml xht
application/vnd.ms-powerpoint ppt
application/x-csh csh
image/svg+xml svg
application/x-troff-ms ms
image/x-rgb rgb
application/x-img img
image/jpeg jpeg jpg jpe
image/x-portable-pixmap ppm
text/plain asc txt
image/cgm cgm
application/x-sh sh
application/andrew-inset ez
application/vnd.wap.wmlscriptc wmlsc
text/x-registry reg
video/vnd.mpegurl mxu
image/ief ief
audio/x-pn-realaudio ram rm
image/x-xpixmap xpm
video/mpeg mpeg mpg mpe
text/tab-separated-values tsv
application/rdf+xml rdf
application/x-httpd-php phtml php php3 php4 php5 php6
x-conference/x-cooltalk ice
image/tiff tiff tif
text/richtext rtx
text/css css
application/ruby rb
application/x-wais-source src
application/xml xml xsl
application/voicexml+xml vxml
image/x-portable-graymap pgm
chemical/x-xyz xyz
model/iges igs iges
application/vnd.mif mif
application/mathml+xml mathml
application/x-ustar ustar
application/x-troff-man man
text/vbscript vbs
text/calendar ics ifb
chemical/x-pdb pdb
application/smil smi smil
application/srgs+xml grxml
image/x-portable-anymap pnm
application/x-shockwave-flash swf
audio/mpeg mpga mp2 mp3
video/x-sgi-movie movie
application/cgi cgi
application/x-cpio cpio
application/x-javascript js
text/x-setext etx
audio/basic au snd
text/sgml sgml sgm
application/x-tar tgz tar
application/vnd.mozilla.xul+xml xul
application/x-futuresplash spl
application/xslt+xml xslt
model/mesh msh mesh silo
application/mac-binhex40 hqx
text/vnd.wap.wml wml
image/x-cmu-raster ras
application/x-sv4cpio sv4cpio
audio/x-aiff aif aiff aifc
application/x-gtar gtar
audio/x-ms-wax wax
audio/x-ms-wma wma
image/x-xwindowdump xwd
application/x-cdlink vcd
application/msword doc
video/quicktime qt mov
application/x-bcpio bcpio
application/x-tex tex
text/x-config cnf conf
application/x-sv4crc sv4crc
application/x-dvi dvi
application/x-troff t tr roff
audio/x-mpegurl m3u
application/x-shar shar
audio/mp4 a-latm m4p m4a mp4
application/pdf pdf
application/mac-compactpro cpt
application/vnd.wap.wmlc wmlc
video/x-msvideo avi
application/ogg ogg
text/html html htm shtml
image/gif gif
audio/midi mid midi kar
application/x-pkcs7-crl crl
application/x-chess-pgn pgn
audio/x-pn-realaudio-plugin rpm
application/srgs gram
application/x-koan skp skd skt skm
image/vnd.wap.wbmp wbmp
application/x-netcdf nc cdf
model/vrml wrl vrml
application/x-httpd-php-source phps
application/vnd.ms-excel xls
application/postscript ai eps ps
application/x-texinfo texinfo texi
application/zip zip
image/x-portable-bitmap pbm
audio/x-wav wav
application/x-x509-ca-cert crt
application/oda oda
application/xml-dtd dtd
application/octet-stream bin dms lha lzh exe class so dll iso dmg
text/vnd.wap.wmlscript wmls
application/x-stuffit sit


How to Password Protect the wp-login.php File using two simple steps

First steps o define a password in the .wpadmin file, and then you activate the security in the .htaccess file.

Start 1: Create the Password File

Create a file named .wpadmin and place it in your home directory, where visitors can’t access it. (Please note there is a period preceding the wpadmin in that file name.) The following example is for cPanel. Plesk would require placing the file in /var/www/vhosts or /var/www/vhosts/domain.

EXAMPLE: /home/username/.wpadmin (where “username” is the cPanel username for the account.)

Put the username and encrypted password inside the .wpadmin file, using the format username:encryptedpassword

EXAMPLE: master:s8yjksadkhasda (where “Master” is a username of your choice, and the password shown is encrypted.)

Start A: Generate Password File & Uploading Via File Manager

One way to do this is to generate the file using the website linked below, and then upload it to your site via FTP or File Manager. In the directions below, we will use File Manager, but you could use FTP instead, for those of you familiar with FTP.

Visit: http://www.htaccesstools.com/htpasswd-generator/
Use the form to create the username and password.
Login to cPanel in another window.
Click on File Manager
Select “Home Directory”
Check “Show Hidden Files (dotfiles)” if not already checked.
Click on the “Go” button.
Look for a .wpadmin file.
If one exists, right click on it and select “Code Edit” to open the editor. Click on the Edit button to edit the file.
If one does not exist, click on “New File” at the top of the page, and specify the name as .wpadmin (with the dot at the front) and click on the “Create New File” button.
Paste the code provided from the website in step 2.
Click on the “Save Changes” button when complete.
You can “Close” the file when finished.

Start B: Creating the Password File via SSH / Command Line

To create the encrypted password you will need to use a utility such as the command-line program htpasswd. More detailed technical information about htpasswd can be found at http://httpd.apache.org/docs/current/programs/htpasswd.html.

An example would be to do this:
htpasswd -c /home/username/.wpadmin master

You would then be prompted to enter the password you wish to use for the username “master” in order to access the wp-login page. You can then log into the wp-admin interface as you normally would. There are many other online tools that can be used to convert standard passwords to encrypted for this purpose.

Start 2: Update the .htaccess File

All domains under the home directory will share the common .wpadmin file, and that previous command creates the /home/username/.wpadmin file due to the -c. The last step is to place the following code in the /home/username/.htaccess file:

ErrorDocument 401 “Unauthorized Access”
ErrorDocument 403 “Forbidden”

AuthName “Authorized Only”
AuthType Basic
AuthUserFile /home/username/.wpadmin
require valid-user


Joomla Preconfigured code/configuration for htaccess
Joomla Referral URL : http://docs.joomla.org/Preconfigured_htaccess

##
# @version $Id: htaccess.txt 10492 2008-07-02 06:38:28Z ircmaxell $
# @package Joomla
# @copyright Copyright (C) 2005 – 2008 Open Source Matters. All rights reserved.
# @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
# Joomla! is Free Software
##

#####################################################
# READ THIS COMPLETELY IF YOU CHOOSE TO USE THIS FILE
#
# The line just below this section: ‘Options +FollowSymLinks’ may cause problems
# with some server configurations. It is required for use of mod_rewrite, but may already
# be set by your server administrator in a way that dissallows changing it in
# your .htaccess file. If using it causes your server to error out, comment it out (add # to
# beginning of line), reload your site in your browser and test your sef url’s. If they work,
# it has been set by your server administrator and you do not need it set here.
#
#####################################################

## Can be commented out if causes errors, see notes above.
Options +FollowSymLinks

#
# mod_rewrite in use

RewriteEngine On

########## Begin – Rewrite rules to block out some common exploits
## If you experience problems on your site block out the operations listed below
## This attempts to block the most common type of exploit `attempts` to Joomla!
#
# Block out any script trying to set a mosConfig value through the URL
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
# Block out any script trying to base64_encode crap to send via URL
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
# Block out any script that includes a tag in URL
RewriteCond %{QUERY_STRING} (\|%3E) [NC,OR]
# Block out any script trying to set a PHP GLOBALS variable via URL
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
# Block out any script trying to modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
# Send all blocked request to homepage with 403 Forbidden error!
RewriteRule ^(.*)$ index.php [F,L]
#
########## End – Rewrite rules to block out some common exploits

# Uncomment following line if your webserver’s URL
# is not directly related to physical file paths.
# Update Your Joomla! Directory (just / for root)

# RewriteBase /

########## Begin – Joomla! core SEF Section
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/index.php
RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$ [NC]
RewriteRule (.*) index.php
RewriteRule .* – [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
#
########## End – Joomla! core SEF Section


On the shared/dedicated server seem to have an issue with snmpd logging connection information for each poll on CentOS , like this:
========================================
Mar 31 21:07:03 onlinuxweb snmpd[10564]: Connection from UDP: [12.123.124.125]:39299
Mar 31 21:07:03 onlinuxweb snmpd[10564]: Connection from UDP: [12.123.124.125]:44746
Mar 31 21:07:03 onlinuxweb snmpd[10564]: Received SNMP packet(s) from UDP: [12.123.124.125]:44746
Mar 31 21:07:03 onlinuxweb snmpd[10564]: Connection from UDP: [12.123.124.125]:44746
Mar 31 21:08:59 onlinuxweb snmpd[10564]: Connection from UDP: [12.123.124.125]:56675
Mar 31 21:08:59 onlinuxweb snmpd[10564]: Received SNMP packet(s) from UDP: [12.123.124.125]:56675
Mar 31 21:08:59 onlinuxweb snmpd[10564]: Connection from UDP: [12.123.124.125]:56675
Mar 31 21:08:59 onlinuxweb snmpd[10564]: Connection from UDP: [12.123.124.125]:37456
Mar 31 21:08:59 onlinuxweb snmpd[10564]: Received SNMP packet(s) from UDP: [12.123.124.125]:37456
Mar 31 21:08:59 onlinuxweb snmpd[10564]: Connection from UDP: [12.123.124.125]:37456
Mar 31 21:08:59 onlinuxweb snmpd[10564]: Connection from UDP: [12.123.124.125]:54909
Mar 31 21:08:59 onlinuxweb snmpd[10564]: Received SNMP packet(s) from UDP: [12.123.124.125]:54909
Mar 31 21:08:59 onlinuxweb snmpd[10564]: Connection from UDP: [12.123.124.125]:54909
Mar 31 21:08:59 onlinuxweb snmpd[10564]: Connection from UDP: [12.123.124.125]:60021
Mar 31 21:08:59 onlinuxweb snmpd[10564]: Received SNMP packet(s) from UDP: [12.123.124.125]:60021
Mar 31 21:08:59 onlinuxweb snmpd[10564]: Connection from UDP: [12.123.124.125]:60021
========================================

This isnt necessarily a bad thing, however if you want to turn that off, on a fully updated CentOS-5 machine you can change /etc/sysconfig/snmpd.options to something like this :

# snmpd command line options
OPTIONS=”-LS4d -Lf /dev/null -p /var/run/snmpd.pid”

# /etc/init.d/snmpd restart