Posts

Showing posts from 2012

Option FollowSymLinks not allowed here

Option FollowSymLinks not allowed here Virtualmin: To fix change FollowSymlinks to SymLinksIfOwnerMatch

E: The package XXXXX needs to be reinstalled, but I can't find an archive for it.

E: The package XXXXX needs to be reinstalled, but I can't find an archive for it. Solution: sudo gedit /var/lib/dpkg/status Search for the broken / problematic package and delete the lines (a paragrah like or something like that whatever you might call it. Then save.

cannot open `/usr/share/sendmail-cf/m4/cf.m4

m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf /etc/mail/sendmail.mc:10: m4: cannot open `/usr/share/sendmail-cf/m4/cf.m4': No such file or directory Reason :  sendmail-cf    is not installed yum install sendmail-cf

Redirect apache request to another domain

if you have example portal.tenerife.com portal.mazaredo.com portal.antolines.com and you want to redirect it to www.mazaredo.com in httpd.conf put this line RewriteEngine on RewriteCond %{HTTP_HOST} !^portal\.!^\.com$ [NC] RewriteRule ^(.*)$ http://www.mazaredo.com/$1 [R=301,L] As you can see the the url has 3 parts    portal, domain, com  !^portal\.!^\.com$ first part is !^portal\     you can also remove portal so any .com request going to your site will be redirected. second part is !^\ where it is like * anything. last part is .com$

Xen Hvm Multi Home Different Subnet, Guest Multi Home Different Subnet Crap!

Setup: Centos 5.8 HVM Xen (Use Default Installation) My ethernets are eth1 and eth2 since somethings wrong with eth0 so change eth numbers to your needs 1. Edit Xen Config : xend-config.sxp edit the network script to (network-script network-xen-multi-bridge) 2. Copy network-bridge to network-bridge.xen in scripts folder ---- network-xen-multi-bridge script---- #!/bin/sh # network-xen-multi-bridge # Exit if anything goes wrong. set -e # First arg is the operation. OP=$1 shift script=/etc/xen/scripts/network-bridge.xen case ${OP} in start)         $script start vifnum=1 bridge=xenbr1 netdev=eth1         $script start vifnum=2 bridge=xenbr2 netdev=eth2         ;; stop)         $script stop vifnum=1 bridge=xenbr1 netdev=eth1         $script stop vifnum=2 bridge=xenbr2 netdev=eth2         ;; status)         $script status vifnum=1 bridge=xenbr1 netdev=eth1         $script status vifnum=2 bridge=xenbr2 netdev=eth2         ;; *)         echo 'Unknown c

Virtualmin / Usermin Error Logging In Connection Reset

http://www.virtualmin.com/node/21964#comment-99307 https://www.virtualmin.com/node/21963#comment-99306 Problem on logging in on usermin https://domain.com:20000 connection reset Probable solution is Edit /etc/usermin/miniserv.conf And add this line to the end: no_pam=1 After that, restart Usermin: /etc/init.d/usermin restart Solution by : andreychek on bugtracker

mod evasive not logging not sending mail

To enable logging and mail, 1. Set the desired configuration in mod_evasive conf or in httpd conf (depending on your distribution 2. Create a folder on /var/log $ mkdir mod_evasive $ chown apache:apache mod_evasive 3. Set the path on mod_evasive conf / httpd.conf to /var/log/mod_evasive 4. Restart httpd / apache ---- EOF ----

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

Linux Fedora Check Hard Drive Check Disk

On terminal go super user $ su - $ palimpsest

Linux File System

Directory Description bin Essential command binaries boot Static files of the boot loader dev Device files etc Host-specific system configuration lib Essential shared libraries and kernel modules media Mount point for removable media mnt Mount point for mounting a filesystem temporarily opt Add-on application software packages sbin Essential system binaries srv Data for services provided by this system tmp Temporary files usr Secondary hierarchy var Variable data

grep messages , grep maillog

grep "^Jan.*d\:" /var/log/messages|tail -n 14 grep "^Jan.*d\:" /var/log/maillog|tail -n 14    

Change Linux Boot Image

$ convert -resize "800x640" wallpaper.jpg wallpaper2.jpg $ convert -crop "640x480+40+0" +repage  wallpaper2.jpg  grub-in.jpg $ convert -colors 14 grub-in.jpg grub-menu.xpm $ gzip grub-menu.xpm

injected php code

DDOS Deflate fix for wrong email format sent

This one is a fix for the wrong email sent by ddos deflate. edit the configuration and use this line. netstat -ntu | grep ':' | awk '{print $5}' | sed 's/::ffff://' | cut -f1 -d ':' | sort | uniq -c | sort -nr

DDOS Deflate fix for wrong email format sent

This one is a fix for the wrong email sent by ddos deflate. edit the configuration and use this line. netstat -ntu | grep ':' | awk '{print $5}' | sed 's/::ffff://' | cut -f1 -d ':' | sort | uniq -c | sort -nr

error: Failed dependencies: /bin/systemctl is needed by courier-imap-4.10.0-1.i386

error: Failed dependencies:     /bin/systemctl is needed by courier-imap-4.10.0-1.i386 Dont use 4.10.0-1 on Centos use only this on fedora

Howto install Windows on Linux (tired of linux?)

This is how to install windows on linux (forgive me) on Redhat based system ex. Centos, Fedora, try $ yum install "Windows Xp" on Debian based system ex. Ubuntu, Kubuntu, $apt-get install "Windows Xp" Then cross fingers hope all gets installed!!! Grab a beer and smash on monitor CHEERS! yum install windows xp apt-get install windows xp aptitute install window xp

DDOS DEFLATE

http://deflate.medialayer.com/ netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n