Post by admin

MySQL skip duplicate replication errors

MySQL replication will stop if an error occurs when running a query on the slave. The reason is so you can resolve the problem, thus keeping the data consistent with the master. You can skip those errors if you know those queries and why they are failing. Skip one query mysql>SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE; [...]

Changing Timezones

# rm /etc/localtime # ln -s /usr/share/zoneinfo/Asian/SaiGon /etc/localtime # hwclock –systohc Incoming search terms:change lighttpd timezone (1)lighttpd timezone (1)

[HOW] Apache Security – Local attack prevent

First of all , login to root account : Open the file “php.ini” by nano editor nano /usr/local/lib/php.ini Find the word “safe_mode” [ Ctrl + W and type "safe_mode" ] Change Off to On [ "safe_mode = Off" to "safe_mode = On" ] Find “disabled_functions” [ Ctrl + W and type "disabled_functions" ] and add [...]

sed Case Insensitive Search Matching

Q. How do I perform a case-insensitive search using sed under UNIX / Linux? I’d like to match all combination of word – foo, FOO, FoO and so on while replacing or performing other operations. A. GNU sed and other version does support a case-insensitive search using I flag after /regex/.   UNIX / Linux: [...]

memcached: Failed To Set rlimit For Open Files Error and Solution

‘m using RHEL 6 / CentOS 6.x and install the memcached server. However, whey I try to start the server using service memcached start command, I get the following error: Starting memcached: failed to set rlimit for open files. Try running as root or requesting smaller maxconns value. [FAILED] How do I fix this problem? [...]

Linux: 20 Iptables Examples For New SysAdmins

Linux comes with a host based firewall called Netfilter. According to the official project site: netfilter is a set of hooks inside the Linux kernel that allows kernel modules to register callback functions with the network stack. A registered callback function is then called back for every packet that traverses the respective hook within the [...]

cPanel server: “hostname resolves to” alert email

The “hostname resolves to. It should resolve to xx.xx.xx.xx” alert is sent by cPanel if the hostname of your server is not resolving to your server IP. The message send by cPanel is as follows: IMPORTANT: Do not ignore this email. The hostname (server.domain.tld) resolves to .  It should resolve to xx.xx.xx.xx.  Please be sure [...]

How to Restrict System Access from Servers and Networks

Usually a firewall is used to protect a server from other servers and networks. However, in some cases you may also want to protect a server within a network by using a TCP Wrapper. The Xinetd super server that comes with most Linux distributions includes a built-in TCP wrapper. It can be used to explicitly [...]

Detecting DoS / DDoS Attack on a Windows 2003 / 2008 Server

Question: How do I detect a DDOS (Distributed denial of service) / DOS attack on a Windows Server 2003 / 2000 / 2008? Can I use Linux netstat command syntax to detect DDoS attacks? Answer:A denial-of-service attack (DoS attack) or distributed denial-of-service attack (DDoS attack) is an attempt to make a computer resource unavailable to its intended users. [...]

XenServer create local ISO Repository (LVM)

Local ISO Repository To create a local ISO Repository for XenServer you can use any directory on the filesystem. The Problem is that the Operating System has normally about 2GB free space left which is too less. To use the “Local Storage” LVM space you can do it in the following way: Check the free [...]