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
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 PostUnix-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 PostBandwidth 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 PostHow 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.
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 PostSSH 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 PostHow 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
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
2. SNMP basic configuration
Copy the default configuration file to the right location.
Print This Post