Author: rpaco

  • SFTP Chroot on CentOS 6.5

    This is to ensure a secure file transfer to users. 1. Create a group called “sftponly” or you can name your group to your desired name. groupadd sftponly 2. Create a user for sftp and assign a password. I will create “user1” as my first user in sftp. useradd user1 passwd user1 3. Add the…

  • postfix-delete.pl scipt

    #!/usr/bin/perl $REGEXP = shift || die “no email-adress given (regexp-style, e.g. bl.*@yahoo.com)!”; @data = qx</usr/sbin/postqueue -p>; for (@data) { if (/^(w+)(*|!)?s/) { $queue_id = $1; } if($queue_id) { if (/$REGEXP/i) { $Q{$queue_id} = 1; $queue_id = “”; } } } #open(POSTSUPER,”|cat”) || die “couldn’t open postsuper” ; open(POSTSUPER,”|/usr/sbin/postsuper -d -“) || die “couldn’t open postsuper”…

  • How to troubleshoot spamming activities on postfix mail server.

    1. To see the mail queue: mailq 2. To flush the mail queue: postfix flush or postfix -f 3. To remove all mails from the queue: postsuper -d ALL 4. To remove all mails in the deferred queue: postsuper -d ALL deferred 5. To delete all queued messages from or to the domain called webserverpage.com:…

  • Plesk 12.0 Installation in Centos 6.5

    1. Download the plesk installer from their website. wget http://autoinstall.plesk.com/plesk-installer 2. Change the permission to executable. chmod +x plesk-installer 3. Run the script. ./plesk-installer To start the installation or upgrade, press N and then press Enter. To quit the installer, press Q and then press Enter. —— IMPORTANT —— * Before installing or upgrading Parallels…

  • Replacing A Failed Hard Drive In A Software RAID1 Array

    Note: In this example I have two hard drives, /dev/sda and /dev/sdb with partitions /dev/sda1 and /dev/sdb1 as well as /dev/sda3 and /dev/sdb3. 1. Check raid health by typing this command “cat proc/mdstat” in terminal. [root@linuxbox /]# cat proc/mdstat Personalities : [raid1] md1 : active raid1 sda3[0] 459025152 blocks [2/1] [U_] md0 : active raid1…

  • Centos High Availability Cluster with OpenVZ, DRBD and Heartbeat – Part 2

    DRBD installation with OpenVZ, plese follow the link below. Centos High Availability Cluster with OpenVZ, DRBD and Heartbeat – Part 1 1.  Download repository. rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm 2. Install HeartBeat yum install heartbeat 3. Create the Heartbeat configuration file ha.cf and copy it to /etc/ha.d/ha.cf on both nodes. # vi /etc/ha.d/ha.cf debugfile logfile /var/log/ha-log logfacility…

  • Centos High Availability Cluster with OpenVZ, DRBD and Heartbeat – Part 1

    Install OpenVZ in both machines, follow the link below How to install OpenVZ in Centos 6.5 DRBD installation. 1. BOTH MACHINES: Install this repository “elrepo-release-6-6.el6.elrepo.noarch.rpm”. rpm -Uvh http://www.elrepo.org/elrepo-release-6-6.el6.elrepo.noarch.rpm 2. BOTH MACHINES: Install DRBD. yum install drbd83-utils-8.3.13 kmod-drbd83-8.3.13 -y 3. BOTH MACHINES: Insert drbd module manually or reboot both machines. /sbin/modprobe drbd 4. BOTH MACHINES: Create…

  • How to install OpenVZ in Centos 6.5

    Install first a fresh OS Centos 6.5 with the partitions below. In this example we will use 1 TB of hardisk. / – 20000mb /swap – 5000mb /vz – All the available space.   Below is the steps on how to install OpenVZ in Centos 6.5 1. Edit the config file below and change SELINUX=enforcing…

  • How to get a list of domains hosted in Plesk control panel.

    How to get a list of domains hosted in Plesk control panel.

  • Fix: Windows Plesk 11 not accessble

    1. Login to your server using RDP. 2. Open command prompt. 3. Run the command below. “%plesk_bin%”websrvmng.exe –configure-plesk-website”