blog.up-link.ro
1Apr/100

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

Print This Post Print This Post
31Mar/100

How To Set Up a FTP server with ProFTPD in Ubuntu

File Transfer Protocol (FTP) is a network protocol used to exchange and manipulate files over a TCP/IP-based network. FTP is built on a client-server architecture and utilizes separate control and data connections between the client and server applications.

ProFTPD is a high-performance and scalable FTP server written from scratch, with a focus toward simplicity, security, and ease of configuration.

ProFTPD Features:

  • Single main configuration file, with directives and directive groups
  • Per directory “.ftpaccess” configuration similar to Apache's ".htaccess".
  • Easy to configure multiple virtual FTP servers and anonymous FTP services.
  • Anonymous FTP root directories do not require any specific directory structure, system binaries or other system files.
  • Designed to run either as a stand-alone server or from inetd/xinetd, depending on system load.
  • No SITE EXEC command. In modern Internet environments, such commands are a security nightmare. ProFTPD does not execute any external programs at any time. The source is available (and must always be available) for administrators to audit.
  • Hidden directories and files, based on Unix-style permissions or user/group ownership.
  • Runs as a configurable non-privileged user in stand-alone mode in order to decrease chances of attacks which might exploit its "root" abilities
  • Logging and utmp/wtmp support with extended logging available.
  • Shadow password suite support, including support for expired accounts.
  • Modular design, allowing server to be extended easily with modules. Modules have been written for SQL databases, SSL/TLS encryption, LDAP servers, RADIUS support, etc.
  • IPv6 support.
Print This Post Print This Post
28Mar/100

FreeBSD: How To Install FreeBSD – FreeBSD 8 Installation Guide

This article is a guide to install FreeBSD 8 using an installation CD/DVD, please make sure you've got a FreeBSD 8 installation CD/DVD.

1.Starting the FreeBSD installation

Start the installation by booting up using the installation disc.

FreeBSD Installation Screenshot 1

FreeBSD Installation Screenshot 1

Press ENTER, the system will start hardware probe process and you will see lots of text messages flying by your screen.
Once the installer has booted up it'll ask you to select the country, system console keymap and the type of installation you want to run. You can use the UP/DOWN arrow key to select and ENTER to continue.

Print This Post Print This Post
26Mar/100

How To Configure NTP Service in FreeBSD

The Network Time Protocol (NTP) is a protocol for synchronizing the clocks of computer systems over packet-switched, variable-latency data networks.

If you only wish to synchronize your clock when the machine boots up, you can use ntpdate. This may be appropriate for some desktop machines which are frequently rebooted, but for servers you should run ntpd.

1. Clock Synchronization using ntpdate

Using ntpdate at boot time is also a good idea for machines that run ntpd. The ntpd program changes the clock gradually, whereas ntpdate sets the clock, no matter how great the difference between a machine's current clock setting and the correct time.

Print This Post Print This Post
25Mar/100

How To keep ports collection up to date in FreeBSD

The FreeBSD Ports collection is a package management system for FreeBSD which provides an easy way of installing software packages on the FreeBSD operating system.

1. Updating the ports collection

a.) Using CVSup method

This is a quick method of getting and keeping your ports collection up to date using cvsup protocol. Make sure /usr/ports is empty before you run cvsup for the first time.

If you never updated ports collection you have to install cvsup utility:

# pkg_add -r cvsup-without-gui

Update ports collection:

# cvsup -L 2 -h cvsup.freebsd.org /usr/share/examples/cvsup/ports-supfile

Above step will take some time to fetch the files.

b.) Using portsnap method

Portsnap is an alternative system for distributing the ports collection.

Install portsnap with the following command:

# pkg_add -r portsnap

Print This Post Print This Post
25Mar/100

How To Set Up a NFS Server in FreeBSD

Network File System (NFS) is a network file system protocol originally developed by Sun Microsystems in 1984, allowing a user on a client computer to access files over a network in a manner similar to how local storage is accessed.

1. Setting up a NFS Server

The first step to setting up a NFS server is to edit the /etc/rc.conf file and add the following lines:

nfs_server_enable="YES"
nfs_server_flags="-u -t -n 4"
rpcbind_enable="YES"
mountd_flags="-r"
mountd_enable="YES"

Next, you have to set up /etc/exports file to define which machines have permission to which folders.  The exports file looks something like this:

/data -maproot=user1 host1 host2 host3
/backup -alldirs host1 host2 host3
/store host2

In this example the machines host1,host2 and host3 are given the privileges of the user1 for the /data directory.

For /backup they are given access to read from all directories within backup. And for /store only host2 is given access to read just the /store directory (make sure you replace hosts with your desired host names).

To start NFS server, enter:

rpcbind
nfsd -u -t -n 4
mountd -r

2. Restarting the NFS Server

Once you have made changes to the exports file you need to restart NFS for the changes to take effect:

kill -HUP `cat /var/run/mountd.pid`
Print This Post Print This Post
24Mar/100

Apache HTTP Server + PHP 5 + MySQL Installation in FreeBSD

1. Install Apache HTTP Server
Go to apache22 port:
# cd /usr/ports/www/apache22
and type:
# make config

Now you can choose the options from the menu.
# make install clean

To enable apache on boot, add the following line to /etc/rc.conf
apache22_enable="YES"

To start apache http server, type
# /usr/local/etc/rc.d/apache22 start

2. Install PHP 5
Go to php port:
# cd /usr/ports/lang/php5
and type:

Print This Post Print This Post
3Mar/100

MySQL Server Installation in FreeBSD using ports

This guide describes how to install MySQL, a very popular relational database, in FreeBSD.

Please make sure the ports collection is up to date. If not, run the following command:
# portsnap fetch update

Then navigate to the ports folder for MySQL:
# cd /usr/ports/databases/mysql51-server
and run:
# make install clean
This command will download required files from the internet and will install MySQL server.

Once the install is finished, we install the database
# mysql_install_db --user=mysql
and we set up the directory permissions
# chown -R mysql /var/db/mysql/
# chgrp -R mysql /var/db/mysql/

Make sure MySQL server start automatically whenever FreeBSD comes up after reboot.
FreeBSD provide this facility via system configuration information. This file lists which services should be started up at system initial boot time.
The file contains the global system configuration information referenced by the start up scripts and is stored in /etc/rc.conf.

Configure FreeBSD to start MySQL at start up
Open /etc/rc.conf file using a text editor ( I use vi but you can use your preferred editor )
# vi /etc/rc.conf
and append following line which will enable MySQL server automatically after each reboot:
mysql_enable="YES"
Save file and exit to shell prompt.

Starting MySQL server
To Start MySQL server under FreeBSD type following command (use script):
# /usr/local/etc/rc.d/mysql-server.sh start

Note: This will work only if you have mysql_enable="YES" in rc.conf. If you don't, use the following command:
# /usr/local/etc/rc.d/mysql-server.sh forcestart

MySQL Password
By default, MySQL super user account has no password. So it’s important to assign the administrator account password. To change the root password, enter the following command:
mysqladmin -u root password newpass

Replace newpass with your own desired password.

Optionally, copy either my-huge.cnf, my-large.cnf, my-medim.cnf or my-small.cnf  (depending on the usage and utilization of your MySQL server) as my.cnf to /etc/ or /var/db/mysql which will enable you to tweak and change the configuration of server-specific MySQL server options by editing the file.

Print This Post Print This Post
12Feb/100

FreeBSD: How To Upgrade FreeBSD 7 to 8 Stable Release

FreeBSD 7.x allows upgrade of existing installation to FreeBSD 8.0-STABLE. Since this is a major version upgrade, it is recommended that you backup your data, database and configuration files.

This guide will walk a user through updating his source to follow FreeBSD's stable branch.  Please make a full backup of the current system before following this guide.

STEP 1: Syncing the source tree

- cvsup installation and configuration

# cd /usr/ports/net/cvsup-without-gui

# make install clean

OR

# pkg_add -r cvsup-without-gui

Copy the sample supfile for Stable to /usr/local/etc/stable-supfile:

# cp /usr/share/examples/cvsup/stable-supfile /usr/local/etc/

Edit file and set host name which specifies the server host which will supply the file updates to your system.

*default host=cvsup1.us.FreeBSD.org

Set release tag to stable 8:

*default release=cvs tag=RELENG_8

Run cvsup to download the latest stable source:

# cvsup -L 2 /usr/local/etc/stable-supfile

When the cvsup has completed, change to the /usr/src directory

Print This Post Print This Post
12Feb/100

FreeBSD: How To boot kernel.old

If you want to boot with an old kernel, because the current one is not working properly, this is what you have to do:
During boot you get a message like:
"Booting kernel in 10 seconds or press enter..."
Just hit any key except the ENTER key and you'll get a prompt.
Type 'unload all' and then 'boot [kernel file]' where [kernel file] is the kernel you want
to boot e.g. 'kernel.old' .

Your FreeBSD machine will boot with the kernel you specified.

Print This Post Print This Post