blog.up-link.ro android bsd linux unix & open-source world

20Apr/101

How To add Extra Repositories in Ubuntu Linux

A software repository is a storage location from which software packages may be retrieved and installed on a computer.

It's very easy to add extra repositories in Ubuntu Linux. In this article I'll show you how to add some useful repositories to your Ubuntu distribution.

First, we have to backup our sources.list by typing in terminal:

# sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak

To add extra repositories proceed with the next steps.

10Apr/103

How To monitor Apache traffic in real-time with apachetop

Apachetop is a very useful program that displays the stats for Apache in real time. Apachetop can show you how many requests per second are coming in, what files have been accessed and how many times. It can also show you who is hitting the sites and where they are coming from.

1. Installing apachetop

To install apachetop in CentOS, Fedora:

# yum install apachetop

Make sure you have DAG repository enabled.

9Apr/102

How To mount ISO images in FreeBSD and Linux

An ISO image is an archive file (disk image) of an optical disc using a conventional ISO (International Organization for Standardization) format. ISO image files typically have a file extension of .ISO.

The name "ISO" is taken from the ISO 9660 file system used with CD-ROM media, but an ISO image can also contain UDF file system because UDF is backward-compatible to ISO 9660.

1. Procedure to mount ISO images under Linux

You can mount an ISO image via the loop device under Linux. It's possible to specify transfer functions using loop device.

6Apr/100

How To Install Tomcat 6 on Ubuntu

Apache Tomcat is a servlet container developed by the Apache Software Foundation. Tomcat implements the Java Servlet and the JavaServer Pages (JSP) specifications from Sun Microsystems, and provides a "pure Java" HTTP web server environment for Java code to run.

1. Install required packages

# sudo apt-get install tomcat6 tomcat6-admin tomcat6-examples

Tomcat depends on a lot of other packages and the package manager will take care of that.

2. Check the services

Make sure the service is responding by entering the following url in a browser:

http://ipaddress:8080/

Replace ipaddress with the ip address of your server

5Apr/106

How To Set Up VSFTPD virtual users ( Berkeley DB + PAM )

vsftpd is a GPL licensed FTP server for UNIX systems, including Linux and FreeBSD. It is secure, stable and extremely fast.

vsftpd will handle:

  • Virtual IP configurations
  • Virtual users
  • Standalone or inetd operation
  • Powerful per-user configurability
  • Bandwidth throttling
  • Per-source-IP configurability
  • Per-source-IP limits
  • IPv6
  • Encryption support through SSL integration
  • etc...

If you are hosting several web sites, for security reasons, you may want the webmasters to access their own files only.  This article describes how you can install and configure vsftpd to work with virtual users.

A virtual user is a user login which does not exist as a real login on the system in /etc/passwd and /etc/shadow file. Virtual users can therefore be more secure than real users, because a compromised account can only use the FTP server but cannot login to system to use other services such as ssh, telnet or smtp.

2Apr/100

RPM Package manager – Using RPM Commands

RPM Package Manager is a package management system. The name RPM refers to two things: a software package file format, and software packaged in this format.

This document contains an overview of the principal RPM commands for installing, uninstalling, upgrading, querying, listing and checking RPM packages on your Linux system.

To install a RPM package, use the command:

# rpm -ivh foo-1.1-2.i386.rpm

Take a note that RPM packages have a file of names like foo-1.1-2.i386.rpm, which include the package name (foo), version (1.1), release (2), and architecture (i386).

2Apr/100

Installing PowerDNS with MySQL backend and PowerAdmin On CentOS

PowerDNS is a MySQL-based DNS server, written in C++ and licensed under the GPL. PowerDNS can be managed through a web interface (PowerAdmin). This guide shows how to install it on CentOS 5.

1. Installing MySQL

# yum -y install mysql mysql-server

2. Enable MySQL on boot and start MySQL server

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

Make sure the MySQL server is running:

# netstat -tap | grep mysql
tcp        0      0 *:mysql                 *:*     LISTEN   28179/mysqld

3. Set password for user root

# mysqladmin -u root password your_password

1Apr/102

How To Set Up OpenSSH Public Key Authentication

Secure Shell or SSH is a network protocol that allows data to be exchanged using a secure channel between two networked devices. Used primarily on GNU/Linux and Unix based systems to access shell accounts, SSH was designed as a replacement for Telnet and other insecure remote shells.

Before we start, make sure your computer has a SSH client installed and the remote Linux system has SSH installed and sshd running.

1. Generating RSA key

You will need to generate the local RSA key by running the following command:

# ssh-keygen -t rsa

1Apr/100

How To Access SAMBA shares through SSH in Linux

You can access Samba shares by using SSH tunneling. We need a host computer (x.y.z.w) and a destination computer (192.168.0.1, is located in the x.y.z.w network), we'll use adi as username and pass as password.

First we'll create a new mount directory:

# mkdir -p /mnt/share

Now we connect to it:

# ssh -N -L 139:192.168.0.1:139 adi@x.y.z.w

Now we have to run the following commands:

# umount /mnt/share

# mount -t smbfs -o username=adi,workgroup=WORKGROUP,password=pass,port=139,dmask=770,fmask=660,netbiosname=computer1 //localhost/share /mnt/share

x.y.z.w=computer's IP address
192.168.0.1=destination computer
adi=samba username
WORKGROUP=your workgroup
pass=password for the share

1Apr/102

How To change Ethernet network card speed and duplex settings in Linux

This tutorial will explain how to change network card speed and duplex settings in linux. It's working with any linux distributions like Fedora, CentOS, Debian, Ubuntu, etc.

ethtool is an Linux/Unix command allowing to modify the NIC parameters. ethtool can be used to query and change settings such as speed, negotiation and checksum offload on many network devices, especially Ethernet devices.

1. Install ethtool

Install ethtool in Fedora and CentOS:

# yum install ethtool

Install ethtool in Debian:

# apt-get install ethtool

Install ethtool in Ubuntu:

# sudo apt-get install ethtool