Posts

Showing posts from March, 2012

Migration Email Server

 postfix/pipe[14916]: 863524FD92: to=<user@example.com>, relay=maildrop, delay=0.02, delays=0.01/0/0/0.01, dsn=5.1.1, status=bounced (user unknown. Command output: Invalid user specified. ) FIX : COMPILE MAILDROP uncomment line: WITH_AUTHLIB=yes NOTE: compile maildrop so it will have:   maildrop 2.5.5 Copyright 1998-2005 Double Precision, Inc. GDBM/DB extensions enabled. Courier Authentication Library extension enabled. Maildir quota extension are now always enabled. This program is distributed under the terms of the GNU General Public License. See COPYING for additional information.     Virtual Domains and Users w/ Postfix / Courier-IMAP / MySQL Introduction Disclaimer MySQL Install MySQL Setup Create the database Create the Tables Create the Alias Table Create the Domain Table Create the Mailbox Table Populate the Tables Postfix Install Postfix Setup main.cf mysql_virtual_alias_maps.cf mysql_virtual_domains_maps.cf mysql_virt

loops back to myself

Trying to fix an error : loops back to myself Hope this works on monday   Postfix virtual ALIAS example: separate domains, UNIX system accounts With the approach described in this section, every hosted domain can have its own info etc. email address. However, it still uses UNIX system accounts for local mailbox deliveries. With virtual alias domains , each hosted address is aliased to a local UNIX system account or to a remote address. The example below shows how to use this mechanism for the example.com domain. 1 /etc/postfix/ main.cf : 2 virtual_alias_domains = example.com ...other hosted domains ... 3 virtual_alias_maps = hash:/etc/postfix/virtual 4 5 /etc/postfix/virtual: 6 postmaster@example.com postmaster 7 info@example.com joe 8 sales@example.com jane 9 # Uncomment entry below to implement a catch-all address 10 # @example.com jim 11 ...virtual aliases for more domains... Notes: Line 2: the vi

Restart apache if not running

#!/bin/bash RESTART="/sbin/service httpd restart" PGREP="/usr/bin/pgrep" HTTPD="httpd" $PGREP ${HTTPD} if [ $? -ne 0 ] # if apache not running then $RESTART fi

Can't load Perl module Apache::compat for server

Can't load Perl module Apache::compat for server Can't locate Apache/compat.pm in @INC (@INC contains: /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 . /etc/httpd) at (eval 2) line 3.\n Go to directory $ cd /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi Rename the folders $ mv Apache -> ApacheOld $ mv Apache2 -> Apache

resize xen guest

dd if=/dev/zero of=file.img bs=1M conv=notrunc count=1 seek=5000   # 5GB losetup /dev/loop1 file.img #loop1 had to be used as xen was already running a different domU via loop0. e2fsck -f /dev/loop1 resize2fs /dev/loop1 e2fsck -f /dev/loop1 losetup -d /dev/loop1       5GB

modsecurity

How to instal modsecurity in centos $ yum install modsecurity ( use atomic repo or other repository dont compile ) Download the base rules on modsecurity official site extract it in /etc/httpd/modsecurity/ Edit your /etc/httpd/conf.d/00-modsec (some file like this) add the path of the folder of the standard base rules just copy the existing path and edit restart apache $ service httpd restart This will block almost all sql so if you have a website like oscommerce, joomla, wordpress be sure to edit the rules, I haven't so I cant put it here :)

Caching Only Name Server

Image
Caching-only name servers are servers not authoritative for any domains except 0.0.127.in-addr.arpa , the localhost. A caching-only name server can look up names inside and outside your zone, as can primary and slave name servers. The difference is that when a caching-only name server initially looks up a name within your zone, it ends up asking one of the primary or slave names servers for your zone for the answer. http://www.faqs.org/docs/securing/chap21sec164.html How To: Configure Caching Nameserver (named)   The necessary files to setup a simple caching name server are: named.conf db.127.0.0 db.cache named script To configure the /etc/named.conf file for a simple caching name server, use this for all servers that dont act as a master or slave name server. Setting up a simple caching server for local client machines will reduce the load on the network's primary server. Many users on dialup connections may use this configurati