How to , and other stuff about linux, photo, php … A linux, photography blog. To remember some linux situation, and fix them quickly.

March 31, 2008

How to Update Alexa Thumbnail Images of Your Website

Filed under: Linux — admin @ 2:31 pm

Quicks Way worked fine for me
http://thumbnails.alexa.com/update_thumbnail?url=

Mod_evasive on cpanel server

Filed under: Linux — admin @ 2:30 pm

One way to stop one of the more basic attacks on a server is mod_evasive.This how-to will walk though the process of installing and configuring mod_evasive. This apache module will help protect against people sending too many requests to the webserver in an attempt to flood it. If it detects too many connections the offending ip will be blocked from the accessing apache for This is especially useful when the server is continuously getting attacked. With this default configuration it will block the offending ip for 10 minutes. If it continues to try and flood mod_evasive will automatically add more time to this.

(more…)

How to Change the Timezone in Linux

Filed under: Linux — admin @ 2:30 pm

1. Logged in as root, check which timezone your machine is currently using by executing `clock`. You’ll see something like “Mon 17 Jan 2005 12:15:08 PM PST -0.461203 seconds”, PST in this case is the current timezone.

2. Change to the directory to /usr/share/zoneinfo, here you will find a list of time zone regions. Change to the most appropriate region, if you live in Canada or the US this directory is the “Americas” directory.

(more…)

Add an ip address

Filed under: Linux — admin @ 2:29 pm

This is a quick guide on adding IPs to a system manually. I would only suggest it if you are not using a control panel, such as cpanel, that has a feature to adds ips. If your main ethernet device is eth1 instead of eth0 simply substitute eth1 for eth0. Other then that should be pretty simple to follow, this should work on any standard redhat/centos based system.

Login as root then do the following to add a new ip address to any linux redhat based system. If you have cpanel there is a nice little ip management script that just lets you do it via WHM. For those without cpanel do the following:

cd /etc/sysconfig/network-scripts

Then as a usual precaution I would make a backup of the file
cp ifcfg-eth0 ifcfg-eth0.bak
(you wont need to do anything with the backup)

Then copy the config for your new IP
cp ifcfg-eth0 ifcfg-eth0:1

Then we need to edit the new config
pico -w ifcfg-eth0:1

The lines you need to change:

DEVICE=”eth0″
to
DEVICE=”eth0:1″

Then change the
IPADDR=”xxx.xxx.xxx.xxx”
to be your NEW ip address (it will have your primary ip listed)

Once this is done, press CTRL + X
then press Y and

This will have saved the config for you and the interface is ready to be brought up. This is done with
/sbin/ifup eth0:1

Having done this if you type
/sbin/ifconfig

You should see something like
——code——
eth0 Link encap:Ethernet HWaddr 00:00:00:00:00:00
inet addr:xxx.xxx.xxx.xxx Bcast:xxx.xxx.xxx.xxx Mask:255.255.254.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:55818546 errors:0 dropped:0 overruns:0 frame:0
TX packets:46167836 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:3299680715 (3146.8 Mb) TX bytes:1890963825 (1803.3 Mb)
Interrupt:11 Base address:0xd000

eth0:1 Link encap:Ethernet HWaddr 00:00:00:00:00:00
inet addr:NEW.IP.ADDRESS Bcast:xxx.xxx.xxx.xxx Mask:255.255.254.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:11 Base address:0xd000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:241244 errors:0 dropped:0 overruns:0 frame:0
TX packets:241244 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:66571100 (63.4 Mb) TX bytes:66571100 (63.4 Mb)
——/code——

If you then try to ping your new ip it should all work fine
This should also restart eth0:1 on a reboot as its a direct copy of the eth0 config. So checking for the ONBOOT=”yes” in ifcfg-eth0:1 will ensure it DOES come back up on a reboot.

This guide was originally posted at:

forums.rackshack.net

mysqladmin flush-hosts

Filed under: Linux — admin @ 2:23 pm

Host ‘…’ is blocked Error

If you get an error like this:

Host ‘hostname’ is blocked because of many connection errors.
Unblock with ‘mysqladmin flush-hosts’

This means that mysqld has gotten a lot (max_connect_errors) of connect requests from the host ‘hostname’ that have been interrupted in the middle. After max_connect_errors failed requests, mysqld assumes that something is wrong (like an attack from a cracker), and blocks the site from further connections until you execute a mysqladmin flush-hosts command or issue a FLUSH HOSTS statement.

By default, mysqld blocks a host after 10 connection errors. You can easily adjust this by starting the server like this:

shell> mysqld_safe -O max_connect_errors=10000 &

Note that if you get this error message for a given host, you should first check that there isn’t anything wrong with TCP/IP connections from that host. If your TCP/IP connections aren’t working, it won’t do you any good to increase the value of the max_connect_errors variable!

« Newer PostsOlder Posts »

Powered by WordPress