blog.up-link.ro
17May/100

How To Install Lighttpd with PHP5 and MySQL support on CentOS 5

Lighttpd is an open-source web server optimized for speed-critical environments. It's standards-compliant, secure and flexible. In this tutorial I'll show you how to install Lighttpd on a CentOS 5.4 server with PHP5 support (through FastCGI) and MySQL support.

1. Installing MySQL 5 Server

To install MySQL run this command from the shell:

# yum install mysql mysql-server

Enable MySQL server on boot and start MySQL server:

# chkconfig --levels 235 mysqld on
# service mysqld start

Print This Post Print This Post
13May/100

UNIX Tools: fdupes – Get rid of duplicate files

fdupes is a  tool for identifying or deleting duplicate files residing within specified directories. It first compares file sizes and MD5 signatures, and then performs a byte-by-byte check for verification.

1. Install fdupes

Type the following commands to install fdupes in FreeBSD:

# cd /usr/ports/sysutils/fdupes
# make install clean

Type the following command to install fdupes in CentOS / Fedora / RHEL (make sure you have rpmforge repo enabled):

Print This Post Print This Post
7May/100

Linux Security: Access Rights and Permissions for Files and Directories

1. Introduction

The Linux security model is based on the one used on UNIX operating systems. On a Linux system, every file is owned by a user and a group user. There is also a third category of users, those that are not the user owner and don't belong to the group owning the file.  For each category of users, read, write and execute permissions can be granted or denied.

The file permissions for these three user categories are indicated by the nine characters that follow the first character, which is the file type indicator at the beginning of the file properties line. The first three characters in this series of nine display access rights for the actual user that owns the file. The next three are for the group owner of the file, the last three for other users.

The permissions are always in the same order: read, write, execute for the user, the group and the others.

Print This Post Print This Post
3May/100

Unix-like Tips and Tricks: BASH Redirection

Bash is a POSIX shell with a number of extensions. It is the shell for the GNU operating system from the GNU Project. It can be run on most Unix-like operating systems.

In this article I'll talk about bash redirections.

Print This Post Print This Post
2May/100

Bandwidth Monitoring Tools for FreeBSD and Linux: iftop

Bandwidth represents the capacity of the connection. The greater the capacity, the more likely that greater performance will follow, though overall performance also depends on other factors, such as latency.

iftop is a free open-source tool to measure bandwidth utilization on the network interfaces on your systems. As the name predicts, iftop is what "top" utility is for CPU usage measurement.

To install iftop in CentOS, Fedora, RHEL ( make sure you have DAG repository enabled ):

# yum install iftop

Print This Post Print This Post
1May/100

How To Limit CPU Usage of A Process with cpulimit under Linux

In this tutorial I'll show you how you can limit the CPU usage of a process with cpulimit tool on Debian/Ubuntu Linux.
cpulimit is a program that limit the CPU Usage of a process (expressed in percentage, not in CPU Time). This is very useful to control batch jobs, when you don't want them to use to much CPU. cpulimit is able to adapt itself to the overall system load, dynamically and quickly.

Print This Post Print This Post
29Apr/100

UNIX-like Tips and Tricks: find command

The find program is a search utility on Unix-like operating systems. It searches through one or more directory trees of a filesystem, locating files based on some user-specified criteria. By default, find command returns all files below the current working directory. Further, find command allows the user to specify an action to be taken on each matched file. In this article I'll show you some tips for using the find command.

To begin, let's look at the basic structure of the find command:

find start_directory  test  options  criteria_to_match  action_to_perform

Example:

In the following command, find will search for any file with the "php" extension in the current directory:

# find . -name "*.php" -print

Print This Post Print This Post
27Apr/100

SSH Security Tips – OpenSSH hardening security

In this article I'll show you some tricks to help you securing your OpenSSH service. Here you will find useful information on how to secure sshd and prevent ssh dictionary attack.

1. SSH security by tweaking sshd_config

The OpenSSH server configuration file is located in /etc/ssh/sshd_config. You need to restart sshd after every change you make to that file in order for changes to take effect.

  • Change port number

Moving the SSH daemon off of port 22 protects you against automated attacks which assume that sshd is running on port 22.

Port 34912

  • Allow only SSH protocol 2

Only SSH protocol version 2 connections should be permitted. Version 1 of the protocol contains security vulnerabilities. The default setting shipped in the configuration file is correct, but it's important to check.

Protocol 2

Print This Post Print This Post
26Apr/100

How To Change MAC Address in Linux, BSD, Unix

Media Access Control address (MAC address) is a unique identifier assigned to most network adapters or network interface cards (NICs) by the manufacturer for identification, and used in the Media Access Control protocol sub-layer. If assigned by the manufacturer, a MAC address usually encodes the manufacturer's registered identification number. It may also be known as an Ethernet Hardware Address (EHA), hardware address, adapter address, or physical address.

1. Change MAC Address in Linux ( CentOS, Debian, Fedora, RHEL, Slackware, SuSE, Ubuntu )

# ifconfig [interface name] down
# ifconfig [interface name] hw ether [new MAC address]
# ifconfig [interface name] up

Example:

# ifconfig eth0 down
# ifconfig eth0 hw ether 1A:2B:3C:4D:5E:6F
# ifconfig eth0 up

Print This Post Print This Post
25Apr/100

FreeBSD: How To Install and Configure SNMP in FreeBSD

Simple Network Management Protocol (SNMP) is a UDP-based network protocol. It is used in network management systems to monitor network-attached devices for conditions that warrant administrative attention.

1. SNMP installation using ports

Install net-snmp using this commands:

# cd /usr/ports/net-mgmt/net-snmp
# make install clean

net-snmp

2. SNMP basic configuration

Copy the default configuration file to the right location.

Print This Post Print This Post