Posts

Error: iptables v1.3.5: can’t initialize iptables table `nat’: Table does not exist (do you need to insmod?)

Sometimes you get the following error while configuring “Port forwarding” rules” in a VPS: ~~~~~~~ Error: iptables v1.3.5: can’t initialize iptables table `nat’: Table does not exist (do you need to insmod?) ~~~~~~~ Fix: You need to run the following command to fix the issue: ~~~~~~~ vzctl set <VPS_ID> –-iptables “iptable_nat iptable_filter iptable_mangle ip_conntrack ipt_conntrack ipt_REDIRECT ipt_REJECT ipt_multiport ipt_helper ipt_LOG ipt_state” –-save ~~~~~~~ P.S:- Replace <VPS_ID> to your actual VPS id. The issue should be fixed now. :)

How to install ffmpeg on CentOS or RHEL

To install ffmpeg on CentOS or RHEL/Redhat Enterprise Linux, you need to follow the steps mentioned below: # vi /etc/yum.repos.d/dag.repo Insert the following: [dag] name=Dag RPM Repository for Red Hat Enterprise Linux baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag gpgcheck=1 enabled=1 Add the /usr/local/lib to /etc/ld.so.conf Then run: # ldconfig -v Then run the following: # rpm -Uvh http://apt.sw.be/packages/rpmforge-release/rpmforge-release-0.3.6-1.el4.rf.i386.rpm # yum update # yum install ffmpeg ffmpeg-devel Done. :)

How to create an FTP Account in Linux

Create a FTP user group. eg: ftpaccounts #/usr/sbin/groupadd ftpaccounts Add a new user to this group, and set the default path of that user to /home/user/. #/usr/sbin/adduser -g ftpaccounts -d /home/user/ testuser Set a password for the newley created user. #passwd testuser Set ownership of /home/user to the testuser and ftpaccounts. #chown testuser:ftpaccounts /home/user Give Read/Write access to testuser and all members in ftpaccounts #chmod 775 /home/user Edit /etc/vsftpd/vsftpd.conf file and make sure 'local_enable=YES' is uncommented. Restart the vsftpd service. #/etc/init.d/vsftpd restart

Outlook mail settings

Sometimes your emails are working fine in your webmail but in any email client, its not working. Please follow the steps given below to verify the email account settings in outlook. 1) Open Outlook, click Tools -> Account Settings 2) Click on the relevant email account and click the Change button at the top of the window 3) Under server information, use the following settings. Incoming mail server: mail.yourdomain.com Outgoing Mail Server: mail.yourdomain.com 4) Click on the More Settings button 5) Select the Outgoing Server tab 6) Check the option "My server requires authentication" 7) Check the option "Use same settings as my incoming mail server" 8) Select the Advanced tab and use port 25 for outgoing port. 9) Incoming port should be 110 for pop3 configuration and 143 for IMAP configuration. 10) Save the configuration by clicking on the Ok button.  The emails should work in Outlook now. If you still find any issue, you need to contact your ser...

How to add new servers to Nagios

Steps to add new servers to Nagios: To add a host 1. Go to the folder /usr/local/nagios/etc 2. Add entires in following files. > hosts.cfg > hostgroups.cfg > services.cfg Note: Please make sure that you are backing up these files with date & time before modifying it. To check syntax # cd ../libexec # /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg Finally, restart Nagios as given below. Stop Nagios. # /usr/local/etc/rc.d/nagios stop Check whether Nagios is running. # ps aux | grep nagios If so, kill all Nagios. # kill -9 `pgrep nagios` Start Nagios again. # /usr/local/etc/rc.d/nagios start Thank you.

The update of Parallels Panel has failed

Issue: After clicking on ‘Update’ button in Plesk Control Panel, browser opens a new tab at the URL https://server_address:8447. But it never opens and the browser displays a blank page. In Parallels Plesk Panel version 10, port 8447 is used for autoinstaller wizard. Please make sure that port 8447 is not blocked on your server by firewall using the following commands: # iptables -L | grep 8447  # telnet localhost 8447 # netstat -anp |grep 8447 The issue occurred as the service 'autoinstaller' which is used to upgrade Plesk stopped running in the server. This service listens on port 8447. Hence when the service is not running, the connection to it will be refused. Run the following script to fix the issue: ~~~~~~~~~~ # /usr/local/psa/admin/bin/autoinstaller --service-mode=update --enable-xml-output ~~~~~~~~~~ The issue should be fixed now. You need to upgrade Plesk always from the back end to avoid this issue. Thank you.

How to configure private IP in the Linux server

To configure private IP address in a Linux server, you need to edit the file "/etc/sysconfig/network-scripts/ifcfg-eth1" as follows: root@server[~]# vi /etc/sysconfig/network-scripts/ifcfg-eth1 DEVICE=eth1 BOOTPROTO=static ONBOOT=yes IPADDR=YOUR_PRIVATE_IP_ADDRESS NETMASK=255.255.0.0 Give the actual private IP address you want to configure in the section 'IPADDR'. root@server[~]# service network restart Then to get the IP up immediately, or for other distros, run the following command: root@server[~]# ifconfig eth1 PRIVATE_IP netmask 255.255.0.0 root@server[~]# ifconfig eth1 up P.S:- Ubuntu 7/8/9 - Add the above ifconfig commands to rc.local to automatically bring the private lan connection up after reboot. Gentoo 2008 - Add the above ifconfig commands to etc/conf.d/local.start Thank you.

How to configure a Private IP for an OpenVZ VPS

1. Enter the OpenVZ hardware node. 2. To allow the VE to access the rest of the LAN, we must enable forwarding and masquerading, as all activity on the LAN must look like it is coming directly from host (with its IP address). ------------------------------- [host-node]# echo 1 > /proc/sys/net/ipv4/ip_forward [host-node]# iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE -------------------------------- 3. Type the command "vzlist" and find the CTID of the VM in question. 4. Use the following command to add ip address to the VM. ----------------------------- [host-node]# vzctl set CTID --ipadd private_ip --save eg:- [host-node]# vzctl set 101 --ipadd 192.168.2.1 --save ----------------------------- 5. Restart the VM [host-node]# vzctl restart CTID eg:- vzctl restart 101 6. Test the IP address by pinging from the host. Thank you.

ip_conntrack: table full, dropping packet

If you ever see the following error in the 'dmesg' or '/var/log/messages' log files, it means the server is dropping packets and will look like a network issue. ~~~~~~ printk: 167 messages suppressed. ip_conntrack: table full, dropping packet. ~~~~~~ This error has to do with the value in '/proc/sys/net/ipv4/ip_conntrack_max' set to low, and letting the system only handle a few connections at once. This value is usually imposed when APF is installed, and the following should be done to correct it: root@server[~]# echo "138304" > /proc/sys/net/ipv4/ip_conntrack_max add the following to /etc/sysctl.conf: sys.net.ipv4.ip_conntrack_max = 138304 If you are running APF, modify the following line to: SYSCTL_CONNTRACK="138304" To check what the current value is you can use: root@server[~]# cat /proc/sys/net/ipv4/ip_conntrack_max Thank you.

How to partition a disk, set its file system type & mount it

1) To know all the disks attached to VPS/Server type  # parted --list  It will show you all the disk along with the unpartitioned disk. Let, we attached a new disk "/dev/xvdb" to server. It will show "unrecognised disk label" message on "parted --list".  ----  root@server [~] parted /dev/xvdb  GNU Parted 1.8.1  Using /dev/xvdb  Welcome to GNU Parted! Type 'help' to view a list of commands.  (parted) print free  Error: Unable to open /dev/xvdb - unrecognised disk label.  ----  2) Execute the following command to edit disk "/dev/xvdb":  # parted /dev/xvdb  3) Type "mklabel msdos"  It creates a new disk label of type "msdos". The new disk label will have no partitions. This command won't technically destroy your data, but it will make it will make it basically unusable.  ----  (parted) mklabel msdos  ----  4) Type "print free" to know the partition details.  ---- ...