Log on:
Powered by Elgg

wizap :: Blog

November 17, 2008

http://www.linuxweblog.com/blogs/sandip/20081117/c-client-library-

With the recent update of uw-imap from epel repository to uw-imap-2007d-1.el5, I was getting the below error which indicated that uw-imap required 2007d version of c-client.


Below was the error message as logged in "/var/log/messages":

IMAP toolkit crash: c-client library version skew, app=2007d library=2007b


Adding "libc-client2007" to the list of "includepkgs" in yum conf for epel repository and doing a `yum update` resolved the issue by updating libc-client2007-2007b to libc-client2007-2007d.


read more

Keywords: linux blog

Posted by wizap | 0 comment(s)

November 01, 2008

http://www.linuxweblog.com/blogs/sandip/20081101/convert-root-file

I have outlined below the steps taken to move from a normal single disk system and convert to a raid1 using an additional drive:


Note: /boot cannot be on lvm nor any other raids other than raid1 partition.


Don't forget to make the essential backups prior.


Convert / to raid/lvm



  1. fdisk /dev/sdb and make clone of sda (convert partition type to "Linux raid autodetect")

  2. add /dev/sdb1 -- /boot - 13 blocks (100Mb) - type raid

  3. add /dev/sdb2 -- rest - type raid

  4. Create raid partitions:

    partprobe
    mdadm -C /dev/md0 --auto=yes -l 1 -n 2 missing /dev/sdb1
    mdadm -C /dev/md1 --auto=yes -l 1 -n 2 missing /dev/sdb2


  5. Create logical volume and copy / partition and /dev files over:

    pvcreate /dev/md1
    vgcreate vg0 /dev/md1
    lvcreate -L 4G -n lv0 vg0
    mke2fs -j /dev/vg0/lv0
    mkdir /mnt/lv0
    mount /dev/vg0/lv0 /mnt/lv0
    find / -xdev | cpio -pvmd /mnt/lv0
    cp -aux /dev /mnt/lv0


  6. Edit /mnt/lv0/etc/fstab to reflect the new root

    /dev/vg0/lv0           /                      ext3    defaults        1 1


  7. Chroot to new filesystem an create initrd with raid and lvm support

    chroot /mnt/lv0
    mount -t proc /proc /proc
    mount -t sysfs /sys /sys
    vgscan
    vgchange -ay
    mkinitrd -v /boot/initrd-2.6.18-92.1.6.el5.lvm.img 2.6.18-92.1.6.el5


  8. Edit grub.conf to point to new root /dev/vg0/lv0

  9. reboot

Convert /boot to raid1


read more

Keywords: linux blog

Posted by wizap | 0 comment(s)

October 31, 2008

http://www.linuxweblog.com/blogs/sandip/20081031/sata-disks-ahci

When converting from IDE to AHCI in the BIOS to include additional drives, I would get a kernel panic... as by default the bios was setup with the drives as IDE.


Booted using existing IDE and created a new kernel image with support for AHCI via the --preload option to manually specify modules support:


# mkinitrd --allow-missing --preload=ahci --force-scsi-probe /boot/initrd-`uname -r`-custom.img `uname -r`


Then create a new grub boot option to load the new custom kernel image and select it when grub boots up using AHCI.

Keywords: linux blog

Posted by wizap | 0 comment(s)

October 28, 2008

http://www.linuxweblog.com/blogs/sandip/20081027/forcing-apache-li

Recently, I've noticed that in ubuntu (6.06) dapper server with apache-2.0.55, apache by default listens to IPv6, thus was causing slow response times. The response times was much improved by having apache listen to IPv4 instead.


Edit /etc/apache2/ports.conf and specify an IPv4 address on all Listen directives:


Listen 0.0.0.0:80
Listen 0.0.0.0:443

Keywords: linux blog

Posted by wizap | 0 comment(s)

October 17, 2008

http://www.linuxweblog.com/blogs/sandip/20081017/drupal-511-upgrad

With the upgrade to drupal-5.11 the caching feature seemed to have broken SecurePages and the GlobalRedirect modules.


Error:

Fatal error: Call to undefined function: drupal_get_path_alias() in /path/to/includes/common.inc on line 1196



Solution:

Added the below code to the beginning of the securepages_init function in "securepages.module" so paths get loaded if cache is enabled.

  // If cache is enabled we need to load the path system
  if (variable_get('cache', CACHE_DISABLED) != CACHE_DISABLED) {
    drupal_bootstrap(DRUPAL_BOOTSTRAP_PATH);
  }


Reference:

http://drupal.org/node/119009


Error:

Fatal error: Call to undefined function: _menu_item_is_accessible() in /path/to/sites/all/modules/globalredirect/globalredirect.module on line 37



Solution:

Add "function_exists('_menu_item_is_accessible') &&" check in "globalredirect.module":

  if (function_exists('drupal_get_path_alias') &&
      function_exists('_menu_item_is_accessible') &&
      _menu_item_is_accessible(menu_get_active_item()) &&
      isset($_REQUEST['q']) &&
      empty($_POST)) {


Reference:

http://drupal.org/node/301844


read more

Keywords: linux blog

Posted by wizap | 0 comment(s)

September 27, 2008

http://www.linuxweblog.com/blogs/sandip/20080927/sender-policy-fra

Sender Policy Framework (SPF) is an extension to the Simple Mail Transfer Protocol (SMTP). SPF allows software to identify and reject forged addresses in the SMTP MAIL FROM (Return-Path), a typical nuisance in e-mail spam.


The two direct benefits of SPF I found are:



  1. ensuring a spammer/virus/trojan cannot send emails using your email address in the FROM field of the email.

  2. get legitimate emails to go through hotmail (and others of course) junk filter, and not be detected as spam.

Setting up a SPF record


Here is an SPF record template for strict checking. For softfail, use "~all" instead.


v=spf1 a mx ptr ip4:<DomainIP> -all


Where 'DomainIP' is replaced with the IP address for what you're setting this record up for. It can also include a range in CIDR format.

You can read more about other SPF Record Syntax at OpenSPF.org .


So now when people receiving emails from your domain have their SPF checking rule to deny all emails that don't match with this SPF record they should only receive genuine emails from your domain.


If you are a Plesk user, "Switch on SPF spam protection" and next to 'SPF checking mode' select 'Reject mails when SPF resolves to "fail" (deny)'.


To check the SPF record for a particular domain:


$ dig domain.tld txt


read more

Keywords: linux blog

Posted by wizap | 0 comment(s)

September 16, 2008

http://www.linuxweblog.com/blogs/sandip/20080916/analog-filesize-l

I had some trouble with analog monthly stats not showing up for the last week and figured out that analog refuses to parse huge log files. I had one sitting at 3GB without being rotated and analog would error out with:


/usr/bin/analog: Warning F: Failed to open logfile
  /var/log/httpd/access_log: ignoring it


After running gzip on the log file, analog was then able to produce the reports. I think I read somewhere that the limit may be 2GB but have not tested this.

Keywords: linux blog

Posted by wizap | 0 comment(s)

September 03, 2008

http://www.linuxweblog.com/blogs/sandip/20080903/restoring-plesk-s

I have recently had to restore plesk from an offsite filesystem backup due to disk drive failure and loss of data. Below are notes for reference and the corresponding list of important folder/files to be backed up for a successful restore.


It helps if you are restoring sites to the same version of OS and Plesk Control Panel, so reload the OS and version of Plesk as was running prior to the data loss.


SYSTEM:


1. Merge "/etc/passwd", "/etc/group" and "/etc/shadow" for domain user accounts.

2. Bring up all IP aliases:

ifconfig eth0:0 xxx.xxx.xxx.xxx


Note: Keep backup of "/etc".


MYSQL:


1. Reset Plesk "admin" user password to old one.

2. Copy over "/etc/mysql/debian.conf".

3. Import all mysql databases:


Export:

mysqldump --opt --all-databases | gzip > all_db.sql.gz


Import:

gunzip < all_db.sql.gz | mysql -u admin -p


4. Restart mysql.


Note: Keep backup of "/var/lib/mysql" and "/var/log/mysql" (if incase database is corrupted and need to be restored using binary log files).


PLESK:


1. Reload ssl certificates from "/opt/psa/var/certificates/" or reinstall the certs via the control panel.

2. Restore/Merge phpmyadmin config "/opt/psa/admin/htdocs/domains/databases/phpMyAdmin/libraries/config.default.php", the below variables in particular:

$cfg['Servers'][$i]['controluser']
$cfg['Servers'][$i]['controlpass']
$cfg['Servers'][$i]['pmadb']


Note: Keep backup of "/opt/psa".


WEB:


1. Sync "/var/www/vhosts".

2. Check for psaserv and psacln folder permissions on "/var/www/vhosts/domains".

chgrp psaserv /var/www/vhosts/<domain>/httpdocs
chgrp -R psacln /var/www/vhosts/<domain>/httpdocs/*


Note: Keep backup of "/var/www/vhosts".


DNS:

1. Copy over "/var/named/run-root/etc/named.conf".

2. Copy over "/var/named/run-root/var".

3. Set the permissions correct:

chown bind /var/named/run-root/var
chgrp bind /var/named/run-root/var/run


Note: Keep backup of "/var/named".


MAIL:


1. Sync "/var/qmail".


Note: Keep backup of "/var/qmail".


read more

Keywords: linux blog

Posted by wizap | 0 comment(s)

August 15, 2008

http://www.linuxweblog.com/blogs/sandip/20080815/creating-graph-tr

Here is how, I was able to generate graph of the workflow being used in Trac. This helps quite a bit when trying to visualize the workflow that is being setup.


The packages required were ghostscript (ps2pdf conversion) and graphviz (graph creation).


Graphviz is available in DAGs/rpmforge repository, so do an install via:


# yum --enablerepo=rpmforge install ghostscript graphviz graphviz-python


Once graphviz is installed generate config files:


# dot -c


Download the corresponding contrib files from the trac svn:



Make the files executable and run:


./showworkflow /path/to/trac.ini


This should generate a pdf file in the same directory as trac.ini file.


Note: If doing this on a server xpdf will fail, so move the pdf to a web accessible directory to view it.


read more

Keywords: linux blog

Posted by wizap | 0 comment(s)

August 14, 2008

http://www.linuxweblog.com/blogs/sandip/20080814/bridge-networking

1. Host will be open on LAN and guests on WAN. Additionally, there is a bridged LAN for guests.

2. We will be using bridge networking for protecting the Host Network and saving IP addresses, also giving flexibility with the guest network setup.

3. Configure LAN Eth1 port to 192.168.1.2

4. WAN Eth0 port is not assigned any IP address.

6. Install the required bridge-utils package via:


yum install bridge-utils


* Network:

# cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=<host.domain.tld>
GATEWAY=192.168.1.1
GATEWAYDEV="eth1"


* WAN Bridge device br0:

# cat /etc/sysconfig/network-scripts/ifcfg-br0
DEVICE=br0
BROADCAST=xxx.xxx.xxx.xxx
NETMASK=255.255.255.24
NETWORK=xxx.xxx.xxx.xxx
XonBOOT=yes
GATEWAY=xxx.xxx.xxx.xxx
TYPE=Bridge


* WAN eth0 device:

# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=00:30:48:65:12:b4
XonBOOT=yes
TYPE=Ethernet
BRIDGE=br0


* LAN Bridge device br1:

# cat /etc/sysconfig/network-scripts/ifcfg-br1
DEVICE=br1
XonBOOT=yes
TYPE=Bridge
IPADDR=192.168.1.2
NETMASK=255.255.255.0
GATEWAY=192.168.1.1


* LAN eth1 device:

# cat /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
HWADDR=00:30:48:65:12:b5
XonBOOT=yes
TYPE=Ethernet
BRIDGE=br1


read more

Keywords: linux blog

Posted by wizap | 0 comment(s)

<< Back