Saturday, January 14, 2012

Server Side Spam Filtering with Postfix Spamassasin and Maildrop


Server Side Filtering spam in Postfix to move all spam tagged mails to a user spam / junk folder is pretty simple.
This solution helps in moving all ***** SPAM ***** subject tagged by spamassasin to be moved to junk folder there by the spam tagged mails doesnt appear in INBOX.
Install Maildrop and configure as given below to automatically move those files to a Junk folder.
Steps to set this with Postfix and Spamassassin :-
First, setup your /etc/maildroprc file:
# commands and variables for making the mail directories
maildirmake=/usr/bin/maildirmake
mkdir=/bin/mkdir
rmdir=/bin/rmdir
MAILDIR=$DEFAULT
# make the user's mail directory if it doesn't exist
`test -e $MAILDIR`
if ($RETURNCODE != 0)
{
`$mkdir -p $MAILDIR`
`$rmdir $MAILDIR`
`$maildirmake $MAILDIR`
}
# make the .Junk folder if it doesn't exist
JUNK_FOLDER=.Junk
_JUNK_DEST=$MAILDIR/$JUNK_FOLDER/
`test -d $_JUNK_DEST`
if ($RETURNCODE != 0 )
{
`$maildirmake $_JUNK_DEST`
#auto subscribe. the following works for courier-imap
`echo INBOX.Junk >> $MAILDIR/courierimapsubscribed`
}
# If the Spam-Flag is set, move the mail to the Junk folder
if (/^X-Spam-Flag:.*YES/)
{
exception {
to $DEFAULT/.Junk/
}
}
The comments clearly state what’s going on there.
Once that’s setup, check /etc/postfix/master.cf and make sure the
maildrop unix - n n - - pipe
flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
is not commented out.
Next set the /usr/bin/maildrop file setuid root. This is so maildrop can interact with authdaemon and the mail folders.
#chmod +s /usr/bin/maildrop
Then add this to /etc/postfix/main.cf file:
virtual_transport = maildrop
maildrop_destination_recipient_limit = 1
If there is another virtual_transport line, be sure to comment that out first.
Last, set the permissions on the authdaemon so that maildrop can access it.
chown vmail /var/run/courier/authdaemon


Thursday, January 12, 2012

Services, Application, Server, Cloud & Network Monitoring

Hyperic-hq is application monitoring and performance management for virtual, physical, and cloud infrastructures. Auto-discover resources of 75+ technologies, including vSphere, and collect availability, performance, utilization, and throughput metrics.

Features

* vSphere auto-discovery of all components of virtualized applications
* Automatically discovers, monitors, and manages software and network resources
* Monitors apps on any platform, including Unix, Linux, Windows, Solaris, AIX, HPUX, VMware, and Amazon Web Services
* Built-in support for 75 common components—including databases, application servers, middleware, web servers, network devices and more
* Optimized for virtual environments with integration with vCenter and vSphere


Technologies Managed by Hyperic

* Operating Systems
o AIX Monitoring
o HP/UX Monitoring
o Linux Monitoring
o Solaris Monitoring
o Windows Monitoring
o Mac OSX Monitoring
o FreeBSD Monitoring

* Web Servers
o Apache Monitoring
o IIS Monitoring
o Sun Java System Monitoring

* Application Servers
o WebLogic Monitoring
o WebSphere Monitoring
o JBoss Monitoring
o Apache Geronimo
o ColdFusion Monitoring
o JRun Monitoring
o .Net Runtime Monitoring
o Tomcat Monitoring
o Glassfish Monitoring
o Resin Monitoring

* Databases
o DB2 Monitoring
o SQL Server Monitoring
o MySQL Monitoring
o Oracle Monitoring
o PostgreSQL Monitoring
o Sybase Monitoring

* Messaging Middleware
o ActiveMQ Monitoring
o IBM MQ Monitoring

* Microsoft Technology
o MS Exchange Monitoring
o Microsoft Active Directory Monitoring
o Microsoft .Net Monitoring

* Virtualization
o VMware Monitoring
o XenServer Monitoring

* Mail Servers
o Postfix Monitoring
o Sendmail Monitoring
o Zimbra Monitoring

* Network Management
o Alfresco Monitoring
o Bind Monitoring
o MemCached Monitoring
o Network Device Monitoring
o Network Services Monitoring
o Nagios Monitoring
o NTP Monitoring
o ZXTM Monitoring
o Custom Monitoring

* Application Management
o JMX Monitoring

* Distributed Platforms
o Bind Monitoring
o NTP Monitoring

* Application Platforms
o LAMP Monitoring
o LAM-J Monitoring
o J2EE Monitoring

* Integrated Applications
o ColdFusion Monitoring
o Alfresco Monitoring

Monday, January 9, 2012

Zimbra SSL Certificate expiry downs LDAP

zimbra shows error when i tried to start.

Unable to determine enabled services from ldap.

Unable to determine enabled services. Cache is out of date or doesn't exist.

The reason was i installed SSL with a validity of 365 year ago and forgot to regenerate.
LDAP doesnt start with a expired SSL.

Follow steps below and generate SSL for 3650 days (ten long years)

## Regenerate SSL certificate and deploy as given below

su - zimbra -c 'zmcontrol stop'
rm -rf /opt/zimbra/ssl/*
rm -rf /opt/zimbra/ssl/.rnd
/opt/zimbra/java/bin/keytool -delete -alias my_ca -keystore /opt/zimbra/java/jre/lib/security/cacerts -storepass changeit
/opt/zimbra/java/bin/keytool -delete -alias jetty -keystore /opt/zimbra/mailboxd/etc/keystore -storepass `su - zimbra -c 'zmlocalconfig -s -m nokey mailboxd_keystore_password'`
vi /opt/zimbra/bin/zmcertmgr


# Find line
# SUBJECT="/C=US/ST=N\/A/L=N\/A/O=Zimbra Collaboration Suite/OU=Zimbra Collaboration Suite/CN=${zimbra_server_hostname}"
# and change to your company name - may not be required if host name and is properply configured in etc/hosts

# then find and change you want value days expire cert validation_days=365 to validation_days=3650
# save /opt/zimbra/bin/zmcertmgr

/opt/zimbra/bin/zmcertmgr createca -new
/opt/zimbra/bin/zmcertmgr deployca -localonly
/opt/zimbra/bin/zmcertmgr createcrt self -new
/opt/zimbra/bin/zmcertmgr deploycrt self

su - zimbra -c 'zmcontrol start'

/opt/zimbra/bin/zmcertmgr deploycrt self
/opt/zimbra/bin/zmcertmgr deployca

su - zimbra -c 'zmupdateauthkeys'
/opt/zimbra/bin/zmcertmgr viewdeployedcrt


Thursday, November 3, 2011

Reset Lost Mysql Root Password

Step # 1 : Stop mysql service


# /etc/init.d/mysql stop

Output:


Stopping MySQL database server: mysqld.



Step # 2: Start to MySQL server w/o password:


# mysqld_safe --skip-grant-tables &

Output:



[1] 5988

Starting mysqld daemon with databases from /var/lib/mysql

mysqld_safe[6025]: started



Step # 3: Connect to mysql server using mysql client:


# mysql -u root

Output:


Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 4.1.15-Debian_1-log
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>


Step # 4: Setup new MySQL root user password


mysql> use mysql;

mysql> update user set password=PASSWORD("NEW-ROOT-PASSWORD") where User='root';

mysql> flush privileges;

mysql> quit

Step # 5: Stop MySQL Server:


# /etc/init.d/mysql stop

Output:


Stopping MySQL database server: mysqld

STOPPING server from pid file /var/run/mysqld/mysqld.pid

mysqld_safe[6186]: ended

[1]+ Done mysqld_safe --skip-grant-tables



Step # 6: Start MySQL server and test it


# /etc/init.d/mysql start

# mysql -u root -p



Monday, October 17, 2011

Run Sqlyog on Linux Or Windows application on Linux


To run sqlyog on linux install wine :

Follow instructions from the link :
http://opensourcebyte.blogspot.com/2011/07/wine-installation-on-cent-os.html

Download sqlyog-x.exe

Double click on the exe setup process runs and Sqlyog is ready.


Saturday, July 2, 2011

Wine Installation on Cent OS - Run Windows Applications on Linux

Install Wine and run windows appliations / exe on linux.

The default RPMforge repository does not replace any CentOS base packages. In the past it used to, but those packages are now in a separate repository (rpmforge-extras) which is disabled by default.

You can find a complete listing of the RPMforge package packages at http://packages.sw.be/

Download the rpmforge-release package. Choose one of the two links below, selecting to match your host's architecture. If you are unsure of which one to use you can check your architecture with the command uname -i

*

i386 http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.i386.rpm
*

x86_64 http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm

The preferred rpmforge-release package to retrieve and to install in order to enable that repository is one of the two listed above.

Install DAG's GPG key

rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt

Verify the package you have downloaded

rpm -K rpmforge-release-0.5.2-2.el5.
rf.*.rpm

Security warning: The rpmforge-release package imports GPG keys into your RPM database. As long as you have verified the md5sum of the key injection package, and trust Dag, et al., then it should be as safe as your trust of them extends.

Install the package

rpm -i rpmforge-release-0.5.2-2.el5.rf.*.rpm

This will add a yum repository config file and import the appropriate GPG keys.

Then try to install something like this

yum install wine


Friday, March 4, 2011

MySQL Backup

How to Export or Backup or Dump A MySQL Database

To export a MySQL database into a dump file, simply type the following command syntax in the shell. You can use Telnet or SSH to remotely login to the machine if you don’t have access to the physical box.

mysqldump -u username -ppassword database_name > dump.sql

Replace username with a valid MySQL user ID, password with the valid password for the user (IMPORTANT: no space after -p and the password, else mysqldump will prompt you for password yet will treat the password as database name, so the backup will fail) and database_name with the actual name of the database you want to export. Finally, you can put whatever name you like for the output SQL dump file, here been dump.sql.

The while data, tables, structures and database of database_name will be backed up into a SQL text file named dump.sql with the above command.

How to Export A MySQL Database Structures Only

If you no longer need the data inside the database’s tables (unlikely), simply add –no-data switch to export only the tables’ structures. For example, the syntax is:

mysqldump -u username -ppassword –no-data database_name > dump.sql

How to Backup Only Data of a MySQL Database

If you only want the data to be backed up, use –no-create-info option. With this setting, the dump will not re-create the database, tables, fields, and other structures when importing. Use this only if you pretty sure that you have a duplicate databases with same structure, where you only need to refresh the data.

mysqldump -u username -ppassword –no-create-info database_name > dump.sql

How to Dump Several MySQL Databases into Text File

–databases option allows you to specify more than 1 database. Example syntax:

mysqldump -u username -ppassword –databases db_name1 [db_name2 ...] > dump.sql

How to Dump All Databases in MySQL Server

To dump all databases, use the –all-databases option, and no databases’ name need to be specified anymore.

mysqldump -u username -ppassword –all-databases >
dump.sql