Posts

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