Fun at work!

Archive for the ‘System Administration’ Category

Repost: Setup FTP Server step by step in CentOS / RHEL / Scientific Linux 6.3/6.4/6.5

This tutorial shows you how to install and configure FTP server in CentOS 6.5. Though the steps provided here are tested in CentOS 6.5, it should work on RHEL 6.x(x stands for version) and Scientific Linux 6.x too. In this tutorial my ftp server ip and hostname are 192.168.1.200 and mainserver.ostechnix.com respectively. I have already configured a local repository and i am gonna to install FTP from my local repository. For more information navigate to setup your local repoistory in CentOS 6 / RHEL 6 / Scientific Linux.

Read more…

Advertisements

How to check MySQL version?

On the command line, enter the command:

 

# mysqladmin -uroot -p -hlocalhost version

Enter password: ********

mysqladmin  Ver 8.42 Distrib 5.1.73, for redhat-linux-gnu on x86_64
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Server version          5.1.73
Protocol version        10
Connection              Localhost via UNIX socket
UNIX socket             /var/lib/mysql/mysql.sock
Uptime:                 16 hours 18 min 39 sec

Threads: 1  Questions: 296  Slow queries: 0  Opens: 25  Flush tables: 1  Open tables: 18  Queries per second avg: 0.5

 

There you can get the version of MySQL.

Repost: How to check if your Linux server is under DDOS Attack?

Login to your server as root and fire the following command, using  which you can check if your server is under DDOS attack or not:
netstat -anp |grep ‘tcp\|udp’ | awk ‘{print $5}’ | cut -d: -f1 | sort | uniq -c | sort –n
This command will show you the list of IP’s which have logged in is maximum number of connections to your server.

ddos becomes more complex as attackers  use fewer connections with more number of attacking IP’s.In such cases, you should get less number of connections even when your server is under ddos.One important thing that you should check is the number of active connections that your server currently has.For that execute the following command:
netstat -n | grep :80 |wc –l
The above command will show the active connections that are open to your server.

You can also fire the following command :
netstat -n | grep :80 | grep SYN |wc –l
Result of active connections from the first command will vary but if it shows connections more than 500, then you will be definitely having problems. If the result after you fire second command is 100 or above then you are having problems with sync attack.

Once you get an idea of the ip attacking your server, you can easily block it.

Fire the following command to block that ip or any other specific ip:

route add ipaddress reject

Once you block a paricular IP on the server, you can even crosscheck if the IP is blocked or not

by using the following command:

route -n |grep IPaddress

You can also block a IP with iptables on the server by using the following command.

iptables -A INPUT 1 -s IPADRESS -j DROP/REJECT

service iptables restart

service iptables save

After firing the above command, KILL all httpd connection and than restart httpd service by

using following command:

killall -KILL httpd

service httpd startssl

Read more…

Repost: How to install Puppet server and client on CentOS and RHEL

As a system administrator acquires more and more systems to manage, automation of mundane tasks gets quite important. Many administrators adopted the way of writing custom scripts, that are simulating complex orchestration software. Unfortunately, scripts get obsolete, people who developed them leave, and without an enormous level of maintenance, after some time these scripts will end up unusable. It is certainly more desirable to share a system that everyone can use, and invest in tools that can be used regardless of one’s employer. For that we have several systems available, and in this howto you will learn how to use one of them – Puppet.

What is Puppet?

Puppet is an automation software for IT system administrators and consultants. It allows you to automate repetitive tasks such as the installation of applications and services, patch management, and deployments. Configuration for all resources are stored in so called “manifests”, that can be applied to multiple machines or just a single server. If you would like to know more information, The Puppet Labs site has a more complete description of what Puppet is and how it works.

Read more…

Link

Report: Making sense of memory usage on Linux

Report: Making sense of memory usage on Linux

Let’s look at some basic commands that report on memory usage. The first that probably comes to mind is free. The free command will tell you about used and unused memory and about swap space. Physical memory is the random access storage provided by the RAM modules plugged into your motherboard. Swap is some portion of space on your hard drive that is used as if it is an extension of your physical memory.

Read more…

How to fix: “Another MySQL daemon already running with the same unix socket.”

You can see this error when restarting MySQL. The system has detected that MySQL is running when it is not. This is probably due to and hard reboot of the system.

To fix this problem, remove the file /var/lib/mysql/mysql.sock as root user:

# rm /var/lib/mysql/mysql.sock

Then start the MySQL daemon:

# service mysqld start

 or

# /etc/init.d/mysqld start

Link

Repost: Running IPMI on Linux

Repost: Running IPMI on Linux

What is IPMI?

IPMI is standard which allows remote server management, primarily developed by Intel. IPMI cards, known as Baseboard Management Cards (BMCs) are primitive computers in their own right and are operational all the time, so long as the server has a power source. The server itself does not need to be powered on, or the operating system operational for the BMC to work, it just needs a power source to be connected to the server.

The primary benefits of IPMI are:

  • View server chassis and motherboard sensor output remotely, such as chassis status and intrusion detection.
  • Ability to remotely power on, power off, reboot the server and flash the identification light.
  • Ability to set up a console on a serial port and have the BMC redirect that console over a network port, which in cooperation with BIOS level console redirection, gives you the ability to view the BIOS, bootloader, bootup and shutdown procedures and console output should the machine hang or lock up, just as you would if you were interacting with the machine locally. This is called Serial Over Lan (SOL) and is available in IPMI v2.0 as a standard and using non-standard proprietary methods in v1.5.

Essentially, IPMI will save you from a few hundred to over a thousand GBP instead of buying a remote power control unit and SOL will save you the same amount again over buying an IP KVM.

Tag Cloud