Sei sulla pagina 1di 198

http://ubuntuguide.

org/wiki/Ubuntu_Edgy#How_to_install_MYSQL_Database_Server
http://dev.mysql.com/doc/refman/5.1/en/index.html

apt-get install openssh-server

Ubuntu 6.10 (Edgy Eft) LAMP Server Installation with Screenshots


Edubuntu Linux Installation With Screenshots
F-Prot Antivirus with Web Interface
Install Swiftfox Web Browser for faster Browsing
Install Iceweasel Web Browser in Debian and Ubuntu
Install Skype Instant messanger in Debian and ubuntu
P2P file-sharing Software in Ubuntu
Applications Installation in One Click using Easyubuntu
Install Opera Web Browser and Realplayer 10 in Ubuntu
Apache2 web server with php support in ubuntu
Ubuntu 6.06 (Dapper Drake) LTS Desktop Screenshots Tour
Install KDE Desktop in Ubuntu
Install .rpm Files in Debian and Ubuntu
Find which Debian or ubuntu Linux Version you are running
Install Mplayer in Ubuntu Linux
Install libdvdcss and w32 video codecs in Debian and ubuntu
Enable and Disable Ubuntu Root Password
Running Internet Explorer in Debian and ubuntu Linux
Debian and Ubuntu Linux Run Levels
Latest Webmin Installation Review
ClamAV Installation and Configuration
Adding Ubuntu Repositories
Mysql Database Server Installation and Configuration in Ubuntu
Webmin Installation and Configuration in Debian and Ubuntu Linux
It's also possible to search from the command-line like it is in Synaptic. Try this:

apt-cache search ABC


aptitude search ABC

To uninstall a package:

sudo apt-get remove ABC and sudo aptitude remove ABC

Removing configuration files as well:

sudo apt-get remove --purge ABC and sudo aptitude purge ABC

How To Search For Missing Packages With apt-file On Debian and Ubuntu

apt-get install apt-file

Now let's search for the package containing the file gtk/gtk.h. You could search like this:

apt-file search gtk.h or


apt-file search gtk/gtk.h
apt-get install libgtk2.0-dev

Debian package - use the command dpkg


dpkg -i /home/carl/Desktop/test.deb

If the user carl wants to install an RPM called test.rpm


alien -i /home/carl/Desktop/test.rpm
?
?
http://www.howtoforge.com/perfect_setup_ubuntu_6.06
Configuring Static ip address in Ubuntu server

Ubuntu installer has configured our system to get its network settings via DHCP, Now we will change t
Edit /etc/network/interfaces and enter your ip address details (in this example setup I will use the IP a

sudo vi /etc/network/interfaces

and enter the following save the file and exit

# The primary network interface

auto eth0
iface eth0 inet static
address 172.19.0.10
netmask 255.255.255.0
network 172.19.0.0
broadcast 172.19.0.255
gateway 172.19.0.1

Now you need to restart your network services using the following command

sudo /etc/init.d/networking restart

vi /etc/hosts
add:
127.0.0.1 localhost.localdomain localhost
192.168.0.100 server1.example.com server1

You need to setup manually DNS servers in resolv.conf file when you are not using DHCP.

sudo vi /etc/resolv.conf

You need to add look something like this

search domain.com

nameserver xxx.xxx.xxx.xxx
0

10 .

11
12 .

13

14
see below 1st
deb http://mirror.ubuntulinux.nl edgy-seveas all

Enable The root Account


sudo passwd root

sudo apt-get update


sudo apt-get upgrade

Installing ntfs-3g
apt-get install ntfs-config
gksu ntfs-config

cp /etc/fstab /etc/fstab.bak
gksu gedit /etc/fstab

Now one more thing you want your windows (NTFS) drive to be mounted automatically add the follow
/dev/ /media/ ntfs-3g defaults,locale=en_US.utf8 0 0

. Making Windows see your Linux partition


You can get Ext2 file system for windows at the following link : -
(www.fs-driver.org/download.htm)

Installing flash-plugin
sudo apt-get install -y flashplugin-nonfree

5. Installing Microsoft True Type Fonts


apt-get install -y msttcorefonts

Installing unrar
apt-get -y install unrar

Installing mpg123
apt-get install -y mpg123

Installing Adobe Reader


http://www.adobe.com/support/downloads/product.jsp?product=10&platform=unix

Installing DVD playback support


aptitude install libdvdcss2

Installing the extra multimedia codecs,players

apt-get install gstreamer0.10-pitfdll gstreamer0.10-ffmpeg gstreamer0.10-gl gstreamer0.10-plugins-b


plugins-bad gstreamer0.10-plugins-bad-multiverse gstreamer0.10-plugins-ugly gstreamer0.10-plugins
vlc mplayer

Updating the system


go to (System > Administration > Update Manager)

Installing beagle
apt-get install -y beagle

Installing gdesklets
apt-get install -y gdesklets

aptitude install ssh samba

vi /etc/samba/smb.conf

Now in this file you specifically want to pay attention to the to the homes share:

[homes]
comment = Home Directories
browseable = yes
writable = yes

Before anyone can do anything with Samba, we also have to create the necessary Samba account firs

smbpasswd -a your_username

creating a public_html directory in your /home directory. So do

mkdir public_html

Install Mplayer in Ubuntu Linux

by Admin @ 10:58 am. Filed under General, Other Linux

MPlayer is a movie and animation player that supports a wide range of codecs and file formats, includ
RealAudio/Video up to 9, Quicktime 5/6, and Vivo 1/2. It has many MX/SSE(2)/3Dnow(Ex) optimized na
XAnim’s and RealPlayer’s binary codec plugins, and Win32 codec DLLs. It has basic VCD/DVD playbac
supports many text-based subtitle formats too. For video output, nearly every existing interface is sup
to raw/divx/mpeg4 AVI (pcm/mp3 audio), and even video grabbing from V4L devices.

Install Mplayer in Ubuntu Dapper


You need to add the following lines to /etc/apt/sources.list file

gedit /etc/apt/sources.list

enter these two lines and save your file

deb http://archive.ubuntu.com/ubuntu dapper universe multiverse


deb-src http://archive.ubuntu.com/ubuntu dapper universe multiverse
Install Mplayer in Ubuntu Edgy eft

You need to add the following lines to /etc/apt/sources.list file

gedit /etc/apt/sources.list

enter these two lines and save your file

deb http://archive.ubuntu.com/ubuntu edgy universe multiverse


deb-src http://archive.ubuntu.com/ubuntu edgy universe multiverse

Now you need to run the following command to update the source list

sudo apt-get update

Install mplayer using the following command

sudo apt-get install mplayer

if you want to open mplayer just type

gmplayer

or

You can Open from Applications—>Sound&Video—> Mplayer Movie Player

Once you open the mplayer you should see the mplayer opened in the following screen

mplayer.png

If you want to install Mplayer with plug-in for Mozilla Firefox run the following command

sudo apt-get install mozilla-mplayer

Install libdvdcss and w32 video codecs in Debian and ubuntu

by Admin @ 12:01 pm. Filed under General

w32codecs this is a package of codecs needed to play multiple formats, notably DivX. (disponible. M

libdvdcss is a highly portable library for accessing and unscrambling DVDs encrypted with the CSS sy
by VLC and all other open source DVD players such as Ogle, xine-based players and MPlayer.

Installing w32codecs in Debian


#wget http://www.debian-multimedia.org/pool/main/w/w32codecs/w32codecs_20060611-0.0_i386.deb

#dpkg -i w32codecs_20060611-0.0_i386.deb

Installing liddvdcss2 in Debian

#wget http://www.debian-multimedia.org/pool/main/libd/libdvdcss/libdvdcss2_1.2.9-0sarge0.0_i386.de

#dpkg -i libdvdcss2_1.2.9-0sarge0.0_i386.deb

You can download Any hardware Architecture from Here

If you want to download Multimedia related software for debian you can download from here
If you are looking for debian multimedia mirrors check here

Installing libdvdcss2 and w32 video codecs in Ubuntu

Support for WMV, RealMedia and other formats has been bundled into the w32codecs package. This p
repositories due to licensing and legal restrictions.

Edit /etc/apt/sources.list file  and enter the following repositories

$sudo gedit /etc/apt/sources.list

deb http://packages.freecontrib.org/ubuntu/plf/ dapper free non-free


deb-src http://packages.freecontrib.org/ubuntu/plf/ dapper free non-free

deb http://packages.freecontrib.org/ubuntu/freecontrib/ dapper free non-free


deb-src http://packages.freecontrib.org/ubuntu/freecontrib/ dapper free non-free

$sudo apt-get update

$sudo apt-get install w32codecs libdvdcss2

If you want to download and install .deb packages you can download and install

$wget -c http://packages.freecontrib.org/ubuntu/plf/pool/dapper/non-free/w32codecs_20060611-1plf1

$sudo dpkg -i w32codecs_20060611-1plf1_i386.deb

$wget -c http://packages.freecontrib.org/ubuntu/plf/pool/dapper/free/libdvdcss2-dev_1.2.9-1plf4_i386.

$sudo dpkg -i libdvdcss2-dev_1.2.9-1plf4_i386.deb

You can download Any harware Architecture from Here

Using above download locations you can install more most of the mutimedia codecs for debian and ub
miksuh Says:
September 28th, 2006 at 5:17 pm

I don’t understand why you wget those Debian packages from the debian-multimedia.org. Why don’t y
/etc/apt/sources.list file and enter the following repository:

If you use Debian Etch:


deb http://www.debian-multimedia.org etch main

If you use Debian Sarge


deb http://www.debian-multimedia.org sarge main

#gedit /etc/apt/sources.list
#apt-get update
#apt-get install w32codecs libdvdcss2
Guide
http://www.ubuntugeek.com/build-low-cost-lamp-server-using-ubuntu-edgy-eft-in-about-15min.html#m
http://www.ubuntugeek.com/webmin-installation-and-configuration-in-ubuntu-linux.html
http://www.swelltech.com/support/webminguide/

Webmin consists of a simple web server, and a number of CGI programs which directly update system
server and all CGI programs are written in Perl version 5, and use no non-standard Perl modules.

Webmin Installation and Configuration in Debian and Ubuntu Linux

by Admin @ 1:38 pm. Filed under General

Webmin is a web-based interface for system administration for Unix. Using any browser that supports
module), you can setup user accounts, Apache, DNS, file sharing and so on.

Webmin consists of a simple web server, and a number of CGI programs which directly update system
server and all CGI programs are written in Perl version 5, and use no non-standard Perl modules.

Installing Webmin in Debian

#apt-get install webmin webmin-core

After the installation If you want to access webmin from any machine in your network edit the /etc/we

allow=127.0.0.1 to allow=0.0.0.0

If you want to restrict webmin for only your network you can do in this allow option

Once you change this and save your file and restart the webmin using following command

#/etc/init.d/webmin restart

Go to your browser and type:- https://ipaddress:10000 and you can login using the debian linux roo

If you ou need any webmin modules for your applications you can download from here

Update Webmin online from your machine

Click on Webmin Configuration under webmin tab from here click on Upgrade Webmin and select the
click on upgrade webmin button this will start the webmin upgrade from webmin site

Downloading http://www.webmin.com/download/webmin-1.290.tar.gz ..
Downloading http://easynews.dl.sourceforge.net/sourceforge/webadmin/webmin-1.290.tar.gz (103245
Received 1024 bytes (0 %)
Received 1033216 bytes (10 %)
Received 2065408 bytes (20 %)
Received 3097600 bytes (30 %)
Received 4130816 bytes (40 %)
Received 5163008 bytes (50 %)
Received 6195200 bytes (60 %)
Received 7227392 bytes (70 %)
Received 8260608 bytes (80 %)
Received 9292800 bytes (90 %)
Received 10324511 bytes (100 %)
.. Download complete.
No package signature verification done.

Running setup.sh script to upgrade Webmin .. Please wait a minute until it is complete before continui

Other available options

From local file


From uploaded file
From ftp or http URL

Installing Webmin from latest .deb package

You can download latest .deb from here

#wget http://prdownloads.sourceforge.net/webadmin/webmin_1.290.deb

#dpkg –install webmin_1.290_all.deb

the install will be done automatically to /usr/share/webmin, the administration username set to root an
You should now be able to login to Webmin at the URL http://localhost:10000/

Installing Webmin in Ubuntu

You can use the above procedure but if you want to install latest version you can download from webm

Prerequisites

Perl 5 interpreter and libnet-ssleay-perl

#apt-get install perl5 libnet-ssleay-perl

Now you need to download the latest webmin from the above downloadlink

Download ‘webmin-1.290.tar.gz’ (at the time of writing) to some location in your machine ex:- /usr/loc

#wget http://prdownloads.sourceforge.net/webadmin/webmin-1.290.tar.gz

#cd /usr/local/src

#tar xzvf webmin-1.290.tar.gz

#cd webmin-1.290
#sh setup.sh

This will start the installation and now it will prompt for several questions answer them as follows

Config file directory [/etc/webmin]:


Leave as default, or change as you wish

Log file directory [/var/webmin]:


Leave as default, or change as you wish

Full path to perl (default /usr/bin/perl):


Leave as default, or change as you wish

Operating system:
Enter ‘6′

Version:
Enter ‘6′

Web server port (default 10000):

This is where you can start to make webmin more secure then the standard install you get with apt-ge
to what ever port you want.

Login name (default admin):

It is ‘admin’, so you can leave it as that, or put in any name that you like.

Login password:

By creating the user above and giving it a password, you have now made it so you will not need to log

Password again:

enter your password again

If you did not install ‘libnet-ssleay-perl’ you will get the following message:

‘The Perl SSLeay library is not installed. SSL not available.’ You can continue with the install, but it wo

Use SSL (y/n):y

Choose yes here

Start Webmin at boot time (y/n):y

select here y
At this point it is going to configure things, install things, and create things…

It will then tell you that you can log in to https://hostname:10000 and to accept the certificate.

Webmin User Password Change

If you want to change root password in webmin use this included Perl script:

# /usr/share/webmin/changepass.pl /etc/webmin root

If you want to install any standard modules you can download from here

If you want to install third party modules you can download from here

Installing Webmin in Ubuntu

You can use the above procedure but if you want to install latest version you can download from webm

Prerequisites

Perl 5 interpreter and libnet-ssleay-perl

sudo apt-get install perl5 libnet-ssleay-perl

Now you need to download the latest webmin from the above downloadlink

Download ‘webmin-1.310.tar.gz’ (at the time of writing) to some location in your machine ex:- /usr/loc

wget http://prdownloads.sourceforge.net/webadmin/webmin-1.310.tar.gz

cd /usr/local/src

sudo tar xzvf webmin-1.310.tar.gz

cd webmin-1.310

sudo sh setup.sh

This will start the installation and now it will prompt for several questions answer them as follows

Config file directory [/etc/webmin]:


Leave as default, or change as you wish

Log file directory [/var/webmin]:


Leave as default, or change as you wish

Full path to perl (default /usr/bin/perl):


Leave as default, or change as you wish

Operating system:
Enter ‘6?

Version:
Enter ‘6?

Web server port (default 10000):

This is where you can start to make webmin more secure then the standard install you get with apt-ge
to what ever port you want.

Login name (default admin):

It is ‘admin’, so you can leave it as that, or put in any name that you like.

Login password:

By creating the user above and giving it a password, you have now made it so you will not need to log

Password again:

enter your password again

If you did not install ‘libnet-ssleay-perl’ you will get the following message:

‘The Perl SSLeay library is not installed. SSL not available.’ You can continue with the install, but it wo

Use SSL (y/n):y

Choose yes here

Start Webmin at boot time (y/n):y

select here y

At this point it is going to configure things, install things, and create things…

It will then tell you that you can log in to https://hostipaddress:10000 and to accept the certificate.

Webmin User Password Change

If you want to change root password in webmin use this included Perl script:
9 Responses to “Webmin Installation and Configuration in Debian and Ubu

apt-get install webmin webmin-core

Doesn’t seem to be valid command anymore.

3. Admin Says:
December 6th, 2006 at 9:03 am

try to run the following commands

apt-get update

apt-cache search webmin

this should give all webmin related packages

4. Wes Says:
December 14th, 2006 at 3:37 pm

Thank you very much!

5. tinbox Says:
January 10th, 2007 at 11:07 pm

my system responsed as below:

root@server1:/etc/postfix/ssl# apt-get install webmin webmin-core


Reading package lists… Done
Building dependency tree
Reading state information… Done
Package webmin is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package webmin has no installation candidate

>>>>>>>>>>>>>>>>>>

any other way to install this ?

6. Pablo Says:
January 15th, 2007 at 1:01 am

para tí de mí

1. Install SSH
Code:
sudo apt-get install ssh openssh-server
2. Enable the universe and multiverse repositories in the /etc/apt/sources.list (https://wiki.ubuntu.com

3. To make this easier use a ssh client like Putty(Win32) or a Term on another machine that has a GUI
re-type them…

Below is the source I just happened to use. If it is not working go to: http://prdownloads.sourceforge.n

Where to install Webmin?


At this point you should note that the directory that you are currently in will be the directory that web
/home/MyAdminAccount/webmin, but if you want it somewhere else now is the time to change to that

Doing something like this would put your installation in /opt/webmin


Code:
sudo su
Code:
mkdir /opt/webmin
and then
Code:
cd /opt/webmin
Now Download the Webmin archive…
Code:
wget http://easynews.dl.sourceforge.net/sourceforge/webadmin/webmin-1.310.tar.gz
Code:
gzip -cd webmin-1.310.tar.gz | tar xvf -
Code:
sudo apt-get install libauthen-pam-perl libnet-ssleay-perl libpam-runtime openssl perl perl-modules
If having problems on Edgy server sparc for libauthen-pam-perl then do
Code
#apt-get install libnet-ssleay-perl

Code:
cd webmin*
Code:
./setup.sh
Basically just hit enter and choose SSL and the auto start the service at boot
Web server port (default 10000): (Feel Free to change this)
Login name (default admin):
Login password: AReallyGoodONE
Password again: AReallyGoodONE
Use SSL (y/n): y
Start Webmin at boot time (y/n): y

Now you can login with the user/password that you set at the https://IpAddressOfYourMachine:10000
________________________________________
https://help.ubuntu.com/community/MailServer
https://help.ubuntu.com/ubuntu/serverguide/C/email-services.html

Note 1:
However, I discover it has the same problem, only using different words: «You should configure your M
mail to this type of mailbox if it is different from the one you have configured.»

I still don't know how I can configure postfix correctly. I also think both guides should tell the user to r
all of them and pasting.

Note 2
You can get the digital certificate from a certificate authority. Alternatively, you can create the certific
a Self-Signed Certificate” for more details.

https://help.ubuntu.com/ubuntu/serverguide/C/httpd.html#creating-a-self-signed-certificate
goto

goto
http://www.parcival.org/2006/07/14/howto-install-joomla-on-your-very-own-ubuntu-server/

http://www.howtoforge.org/joomla_ispconfig
http://doc.gwos.org/index.php/ServerGuide#MySQL

In your home directory, also recursively set the proper read/write permissions (this is to ensure that Jo

chmod -R ugo+rwx public_html/

Next we are going to check if we can access the site in our web browser by adressing it with the prope

When you're in the correct directory you execute a configure script: ./configure. The purpose of the co
and then create the makefile. If the script fails for some reason and tells you to install certain package
find packages in Synaptic named almost the same but with a -dev extension, remember to install thos
needed for compiling). Don't worry if it complains that there is no configure script - many packages do
and after it's been compiled you can install it. There are two ways:

Normal install: If you want to install it the normal "primitive" way, type sudo make install. To remove t
the program you run sudo make uninstall. These two clean-up commands don't always work, though,

http://www.joomlatutorials.com/joomla_tutorials/

Okay, now we have the Apache webserver installed. You can verify if it’s up and running by pointing y
machine, e.g. http://192.168.0.1 This should load the generic Apache welcome site in your browser.

Next we need a place where you can store your (Joomla) files so they are being displayed when you a
Ubuntu this is being done by creating a public_html directory in your /home directory. So do

mkdir public_html

In your home directory, also recursively set the proper read/write permissions (this is to ensure that Jo

chmod -R ugo+rwx public_html/

If it worked, the command ls -l will display read/write/execute permissions for all users on your public_

Next we are going to check if we can access the site in our web browser by adressing it with the prope

#generic
http://your_ubuntu_IP/~username
#example for user Slartibartfast
http://192.168.0.1/~Slartibartfast
Now you should be greeted with the screen that lets you start with the Joomla configuration. Before w
important step left.

Create the necessary database

Joomla stores its content in a database, so we still need to setup the MySQL database in Ubuntu. First
this and this chapter of the MySQL documentation)

#first we log into the MySQL shell


mysql --user=root mysql
#now we create same user TWICE
GRANT ALL PRIVILEGES ON *.* TO 'your_username'@'localhost' IDENTIFIED BY 'your_password' WITH G
GRANT ALL PRIVILEGES ON *.* TO 'your_username'@'%' IDENTIFIED BY 'your_password' WITH GRANT
#we exit the MySQL shell again
exit

Furthermore, it’s also wise to set a password for the root user in MySQL:

Create the necessary database

Joomla stores its content in a database, so we still need to setup the MySQL database in Ubuntu. First
this and this chapter of the MySQL documentation)

mysql -u root
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('MyPW');
exit

Once we have the user we need to create the tables that belong to him/her: (see also the Ubuntu serv

#we create the database for your user


mysqladmin -u your_username -p create your_database_name
#we log into our database
mysql -u db_user -p
#we set the priviledges
GRANT ALL PRIVILEGES ON your_database_name.* TO 'your_username' IDENTIFIED BY 'your_password
#we activate the new permissions
flush privileges;
#we leave the MySQL shell again
exit

Optional: phpmyadmin

You may be one of those users who doesn’t like managing MySQL databases in a terminal very much.
manage your MySQL from now on by means of your webbrowser, those additional steps will take you
nano -w /etc/apt/sources.list

remove the comment marks for the universe repository. This will allow you to install phpmyadmin:

aptitude update
aptitude search phpmyadmin
aptitude install phpmyadmin

After that you can connect to your MySQL Server and do all admin tasks by visiting the URL

http://localhost/phpmyadmin/

Browser Installation (the easy way)


When installing Joomla for the first time, verify the system requirements previously stated above first!

Assuming you have a working Apache web server, with PHP and a MySQL Database, you are on your w

When you have finished uploading the files and folders, go to your homepage (http://www.yoursite.co
pre-installation check page generated by Joomla.

http://help.joomla.org/content/view/39/132/

Configuring MySQL
http://help.joomla.org/content/view/37/132/
u should now see a
Install apache2 in Ubuntu server

sudo apt-get
This will installthe
complete apache2 apache2-common
installation apache2-mpm-prefork
of apache2 web server and now you apache2-utils
need to know ssl-cert
where the config
server.

By default all your configuration files are located at /etc/apache2

Default document root for apache2 is /var/www.If you want to change the default document root you n
file and look for this line “DocumentRoot /var/www/” here you can change whereever you want to cha
the above line looks like this “DocumentRoot/home/www/”.

The main configuration file located at /etc/apache2/apche2.conf.

Bydefault Apache2 to Listen on port 80. If this is not desired, please edit /etc/apache2/ports.conf as de

For example if you want to change your apache webserver port to 78 you need to edit /etc/apache2/p

sudo gedit /etc/apache2/ports.conf

Look for the following line

Listen 80

Replace with the following line

Listen 78

Save the edited file

sudo /etc/init.d/apache2 restart


Installing php and cgi support for apache2 in Ubuntu

you need to have universe source list in your sources.list file

sudo apt-get install libapache2-mod-php4 php4-cli php4-common php4-cgi

Next we edit /etc/apache2/apache2.conf file and check the index files are correct

DirectoryIndex index.html index.cgi index.pl index.php index.xhtml

If you want to enable some Apache modules (SSL, rewrite, suexec, and include)

sudo a2enmod ssl

sudo a2enmod rewrite


sudo a2enmod suexec

sudo a2enmod include

Restart Apache to make sure all is well.

sudo /etc/init.d/apache2 restart

Test your apache Server

You can access you apache using http://yourserverip/apache2-default/ it should appear the following s

Test apache with PHP


To test if php4 installed correctly

sudo gedit /var/www/test.php

Insert the following line into the new file

<?php phpinfo();?>

Save this file

Now access this page http://yourserverip/test.php you should see the following screen
http://www.netscape.com/viewstory/2006/10/16/ubuntu-lamp-server-installation-with-
screenshots/?url=http%3A%2F%2Fwww.debianadmin.com%2Fubuntu-lamp-server-installation-with-sc
Create a secure Linux-based wireless access point
Wednesday July 19, 2006 (02:01 PM GMT)

By: Manolis Tzanidakis

Wi-Fi Protected Access version 2 (WPA2) is becoming the de facto standard for securing wireless netw
Fi products certified by the Wi-Fi Alliance. We all know the security weaknesses of its predecessor, WE
implement the WPA2 protocol on a Linux host and create a secure wireless access point (WAP) for you
Mysql Database Server Installation and Configuration in Ubuntu

by Admin @ 3:31 pm. Filed under Database

MySQL is a widely used and fast SQL database server. It is a client/server implementation that consist
programs/libraries.

Installing Mysql database in Ubuntu

#apt-get install mysql-server mysql-client libmysqlclient12-dev

MySQL initially only allows connections from the localhost (127.0.0.1). We’ll need to remove that restr
internet. Open the file /etc/mysql/my.cnf

#vi /etc/mysql/my.cnf

Find the line bind-address = 127.0.0.1 and comment it out



#bind-address = 127.0.0.1

You can check your configuration using the following command

#netstat -tap

Output Looks like below

tcp 0 0 *:mysql *:* LISTEN 4997/mysqld

MySQL comes with no root password as default. This is a huge security risk. You’ll need to set one. So
to set a password for that too. The local-machine-name is the name of the computer you’re working o

#mysqladmin -u root password your-new-password

#mysqladmin -h root@local-machine-name -u root -p password your-new-password

#/etc/init.d/mysql restart

If you are looking how to create database,tables and other things check here

If you are looking for webinterface administration or GUI tools for your mysql database check here

MySQL Database Server Installation and configuration

by Admin @ 2:12 pm. Filed under Database


MySQL is a fast, stable and true multi-user, multi-threaded SQL database server. SQL (Structured Que
in the world. The main goals of MySQL are speed, robustness and ease of use.

Mysql Database Installation in Debian

If you want to install the Mysql base system as well as a textual client run the following command from

#apt-get install mysql-server-4.1 mysql-client-4.1

Now that MySQL is installed, you may want to know how to configure it.

Configuring Mysql Database

We assume that mysqladmin and mysql, which should have been installed when you got the MySQL p
password for MySQL. You can do this by typing:

#mysqladmin -u root password ‘passwordyouwant’

Now that the root password is set, connect to your MySQL server:

#mysql -u root -p

It will prompt you for a password. Make sure to enter the one you just/previously set. You should now

mysql>

At this point, you will create basic permissions for a user and database. For my setup, I want to allow a
also on the network, which is referred to as “windowsbox” will have access to all databases.

To access the user, host databases, etc… type this;

mysql> use mysql;


Database changed
mysql>

To give localhost permission to access all databases, enter this:

mysql> insert into


-> host(host,db,Select_priv, Insert_priv, Update_priv,
-> Delete_priv, Create_priv, Drop_priv)
-> values(’localhost’,'%’,'Y’,'Y’,'Y’,'Y’,'Y’,'Y’);

Note, the ‘%’ can be replaced with a database name. The ‘%’ is a wildcard.

Following the previous format, to allow access from another hostname (in this case “windowsbox”) ad

mysql> insert into


-> host(host,db,Select_priv, Insert_priv, Update_priv,
-> Delete_priv, Create_priv, Drop_priv)
-> values(’windowsbox’,'%’,'Y’,'Y’,'Y’,'Y’,'Y’,'Y’);

Again, ‘%’ is used as a Wild-Card.

To create a user ‘djg’ who can access the MySQL server from localhost, type this:

mysql> insert into


-> user (host, user, password)
-> values(’localhost’,'djg’,password(’mypassword’));

To give the user access from another hostname, domain, etc… add other entries accordingly. For exam

mysql> insert into


-> user (host, user, password)
-> values(’windowsbox’,'djg’,password(’mypassword’));

Now… to give the user permissions to access a database from localhost, add this entry and change wi

mysql> insert into


-> db (host,db,user,Select_priv, Insert_priv, Update_priv, Delete_priv, Create_priv, Drop_priv)
-> values (’localhost’,'mydatabase’,'djg’,'Y’,'Y’,'Y’,'Y’,'Y’,'Y’);

To give the user permissions from windowsbox, add this:

mysql> insert into


-> db (host,db,user,Select_priv, Insert_priv, Update_priv, Delete_priv, Create_priv, Drop_priv)
-> values (’windowsbox’,'mydatabase’,'djg’,'Y’,'Y’,'Y’,'Y’,'Y’,'Y’);

Now, type: quit and you will exit mysql.

Finally, create the actual database (in this case, ‘mydatabase’) type this:

#mysqladmin -u root -p create mydatabase

After prompting you for a password, it should create the database. At this point, you must reload MyS

#mysqladmin -u root -p reload

After prompting you for a password it should reload MySQL.

Congratulations. If all goes well you have set up a user and database with MySQL. You may now creat

Also, please note that by default, MySQL will open up network port 3306 to allow remote requests.

If you do not want this port open, append “–skip-networking” when running safe_mysqld to start
the daemon. Debian users can edit /etc/init.d/mysqld and change this line:
/usr/bin/safe_mysqld > /www.null 2>&1 &

to this:

/usr/bin/safe_mysqld –skip-networking > /www.null 2>&1 &

Now whenever running /etc/init.d/mysql start, it will not open up port 3306.

If you want o install mysql database in ubuntu you can use the same procedure.

Mysql Database Server Web interface,Frontend or GUI Tools

by Admin @ 2:33 pm. Filed under Database

phpmyadmin

phpMyAdmin is a tool written in PHP intended to handle the administration of MySQL over the Web. It
tables, delete/edit/add fields, execute any SQL statement, manage keys on fields, create dumps of tab
administrate one single database and multiple MySQL servers.

Downloads and Documentation

http://www.phpmyadmin.net/

MySQL Users

MySQL Users provides a simple Web-based interface for creating new MySQL users and maintaining e

Downloads and Documentation

http://www.itlab.musc.edu/mysql_users/mysql_users_readme.html

MyClient

MyClient is a simple and clean Web client interface for the MySQL database. It runs with PHP’s registe
Features include unlimited multiple tabbed interfaces, connection to multiple databases, one-button t
saving and loading, query results saving, and localization. It is not a full featured administration tool, b
improves upon the command line interface using a Web-based implementation.

Downloads and Documentation

http://myclient.polarlava.com/

WebMySQL

WebMySQL is a Web interface to a MySQL database server. It supports the following SQL queries: SEL
advanced query options such as LIMIT, DISTINCT, and GROUP. Empty databases and tables and mysql
customisable look and feel, and outputs either HTML results or a downloadable CSV file.
Downloads and Documentation

http://www.thedumbterminal.co.uk/software/webmysql.shtml

MySQL Administrator

MySQL Administrator is a powerful visual administration console that enables you to easily administer
visibility into how your databases are operating. MySQL Administrator now integrates database manag
environment, with a clear and intuitive graphical user interface. By using MySQL Administrator you wi

Achieve higher database availability through improved management Reduce errors through visual dat
through improved productivity Deliver a more secure environment through easier privilege managem

Downloads

http://dev.mysql.com/downloads/administrator/1.1.html

Documentation

http://dev.mysql.com/doc/administrator/en/index.html

MySQL Query Browser

MySQL Query Browser is the easiest visual tool for creating, executing, and optimizing SQL queries for
gives you a complete set of drag-and-drop tools to visually build, analyze and manage your queries. P

Query Toolbar to easily create and execute queries and navigate query history Script Editor giving you
Window so you can also easily compare and work with multiple queries
Object Browser enabling you to manage your databases, bookmarks, and history using a Web Browse
Database Explorer where you can select tables and fields to query, as well as create and delete tables
tables Inline Help giving you instant help access to selected objects, parameters, and functions

Downloads

http://dev.mysql.com/downloads/query-browser/1.1.html

Documentation

http://dev.mysql.com/doc/query-browser/en/

Gnome Mysql Client

Gmyclient is designed to be a simple, quick, and powerful way to access your MySQL database. It prov
data. It makes using MySQL very easy.

Downloads and Documentation

http://gmyclient.sourceforge.net/
Webmin Module for Mysql
This module allows webmin (a web-based interface for system administration for Unix) to setup datab
server.

Downloads and Documentation

http://www.webmin.com/standard.html

Mysql Database Backup


If you want to take your Mysql Database Backup follow this link
http://www.debianhelp.co.uk/mysqlscript.htm

Here is a quick minimum setup step by step..


1. Download automysqlbackup.sh and place it into your /etc/cron.daily directory or your home directory.
2. Edit (at least) the following lines :-
USERNAME=dbuser (The user must have at least select privileges to the databases) PASSWORD=password
DBNAMES="DB1 DB2 DB3" (make sure to keep the quotes " " otherwise it won't work)
3. Make the file executable :- chmod u+rwx
4. Create the following directory./backups
5. That's it.. Now you can run it using the command line "./automysqlbackup.sh" or if it is in /etc/cron.daily it

Here is the procedure how to change Mysql default data directory

By default, MySQL’s datadir is placed in the /var/lib/mysql directory.

Create the directory that will be new datadir (ex:-/home/db)

chown the directory to the mysql:mysql user

sudo chown -R mysql:mysql /home/db/*

You need to stop the mysql server using the following command

sudo /etc/init.d/mysql stop

Now you need to edit the /etc/mysql/my.cnf file

sudo /etc/mysql/my.cnf

and look for “datadir = /var/lib/mysql” this si where mysql database default data directory here you n

datadir = /home/db

copy the files from the old datadir to the new location. However, make sure that the files named
ib_arch_log_0000000000, ib_logfile0 etc. are not copied to the newer location.

Make sure that the files and directories are owned by mysql user

Make changes in the my.cnf to point the new datadir.


Restart the MySQL database

sudo /etc/init.d/mysql start

hope this helps


Debian and Ubuntu Linux Run Levels

by Admin @ 8:37 pm. Filed under General

Linux run levels are numbered 0 through 6. Run levels stop at six for practical and historical reasons

The following table summarizes the User Linux run levels:

* 0 System Halt
* 1 Single user
* 2 Full multi-user mode (Default)
* 3-5 Same as 2
* 6 System Reboot

Special Run Levels

Run level 0 is the system halt condition. Nearly all modern X86 computers will power off automatically
and various different architectures will remain powered on and display a message referring to the halt

Run Level 1 is known as ’single user’ mode. A more apt description would be ‘rescue’, or ‘trouble-shoo
are started. Hopefully single user mode will allow you to fix whatever made the transition to rescue m

(You can boot into single user mode typically by using your boot loader, lilo or grub, to add the word ’

Run levels 2 through 5 are full multi-user mode and are the same in a default User Linux (Debian) sys
distributions to use run level 3 for a text console login and run level 5 for a graphical login.

Run level 6 is used to signal system reboot. This is just like run level 0 except a reboot is issued at the

In the interests of completeness, there is also a runlevel ‘S’ that the system uses on it’s way to anothe
command (”For manpage click here”) for more information, but you can safely skip this for all practica

Run Levels Location

Like everything else in a Linux system, run levels are defined by files in the file system. All the run lev
the following table:

/etc/rc0.d Run level 0


/etc/rc1.d Run level 1
/etc/rc2.d Run level 2
/etc/rc3.d Run level 3
/etc/rc4.d Run level 4
/etc/rc5.d Run level 5
/etc/rc6.d Run level 6

Each defined run level should have an rcX.d directory where X is the run level number. The contents o
that run level.
Change run levels in Debian and Ubuntu Linux

Before we change run levels it might help to find out which run level is current. Use the ‘runlevel’ com
the current run level. Here is the command and the output shown together due to the sparsity of the o

# runlevel N 2

The ‘N’ stands for none, meaning there has been no run level change since powering up.
The init system controls run levels, but then again, the init system pretty much controls everything. T
article.

The primary command used to change run levels is ‘telinit’.

#telinit 3

telinit takes one argument on the command line. As always, see the man page for full details. Normall
letter ‘S’. As you may have guessed, the numbers correspond to the run level you wish to move to. Us
number 1, but don’t do it; the ‘S’ runlevel is intended for use by the UserLinux (Debian)system.

A note of caution is warranted here. You can easily use the telinit command to reboot (run level 6), or
recommended. Certain programs need special processing for an orderly shutdown. Bypassing the exp
your data. Older _Unix_ systems are especially sensitive to shutdown/bootup operations.

The preferred method for a serious runlevel change is ’shutdown’. There are easier mnemonics, but in
command. You can use the ‘halt’, or ‘poweroff’ command to stop a system and the ‘reboot’ command
’shutdown’ command with different parameters.

If you wanted runlevel 3 to be the default, then you need to edit /etc/inittab.

# The default runlevel.

id:2:initdefault:

You’d change the ‘2′ to a ‘3′. Next time you reboot, your system will start in runlevel 3. There will be n
you turned it off. Therefore, runlevel 3 will become text only, and it will be the default. If that’s what y

Adding a new service

You can only add a new service to the boot sequence if a script in /etc/init.d exists. In that case the fo
(foo being the name of a script in /etc/init.d).

#update-rc.d foo default

Removing a service

A service may only be removed after the script in /etc/init.d as deleted already. If so, the following com
name of a script in /etc/init.d).
#update-rc.d foo remove

If you want to remove a service without removing the start/stop script as well, you may consider using
configuration file /etc/runlevel.conf. When using the SysV method you should rename the start/stop sc
start/stop script back to its old name.

Some of the content for this article source from here

Find which Debian or ubuntu Linux Version you are running

by Admin @ 7:12 pm. Filed under General

There are times debian or ubuntu users and admins want to find which version of debian and ubuntu l

Find or identify which version of  Debian Linux you are running

This can be checked in /etc/debian_version file

Find or identify which version of  ubuntu Linux  you are running

You can find in different ways in ubuntu

Solution 1

cat /etc/issue

The file /etc/issue holds the version of Ubuntu installed on your system

Solution 2

lsb_release -a

or

cat /etc/lsb-release
his is very useful for those who is helping their customers and they want to know which version they are running
which version they are running a nd if you took over new system admin job you want to know which version is r
ant to know which version is running on your servers or desktops.
What is net-snmp ?

Simple Network Management Protocol (SNMP) is a widely used protocol for monitoring the health and welfare o
devices like UPSs. Net-SNMP is a suite of applications used to implement SNMP v1, SNMP v2c and SNMP v3 usin

Net-SNMP Tutorials

http://www.net-snmp.org/tutorial/tutorial-5/
Download Net-SNMP

http://www.net-snmp.org/download.html
Net-SNMP Documentation

http://www.net-snmp.org/docs/readmefiles.html
Installing SNMP Server in Debian

If you want to install snmp server in debian you need to install snmpd package using the following command

#apt-get install snmpd

This will complete the installation process.

Configuring SNMP Server in Debian

Default Configuration files are located at /etc/snmp directory this contains the following files.

snmpd.conf snmptrapd.conf

/etc/snmp/snmpd.conf - configuration file for the Net-SNMP SNMP agent.

/etc/snmp/snmptrapd.conf - configuration file for the Net-SNMP trap daemon.

Now we need to concentrate on snmpd.conf file for our configuration. If you want to see the default sn

Before doing any changes to your /etc/snmp/snmpd.conf file take a copy of original file using the following com

#cp /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.orig

Set up the snmp server to allow read access from the other machines in your network for this you need to open
Configuration and save the file.
first step

# sec.name source community


com2sec paranoid default public
#com2sec readonly default public
#com2sec readwrite default private

to
#com2sec paranoid default public
com2sec local localhost public
com2sec localNet 192.168.0.0 /24 public
#com2sec readwrite default private

you can define the source whichever way you want like only allow from local machine for that you need to add
case we are using public as our community.

Second Step

####
# Second, map the security names into group names:

# sec.model sec.name
group MyROSystem v1 paranoid
group MyROSystem v2c paranoid
group MyROSystem usm paranoid
group MyROGroup v1 readonly
group MyROGroup v2c readonly
group MyROGroup usm readonly
group MyRWGroup v1 readwrite
group MyRWGroup v2c readwrite
group MyRWGroup usm readwrite

to

group MyROSystem v1 local


group MyROSystem v2c local
group MyROSystem usm local
group MyROGroup v1 localnet
group MyROGroup v2c localnet
group MyROGroup usm localnet
group MyRWGroup v1 local
group MyRWGroup v2c local
group MyRWGroup usm local

Third Step

####
# Third, create a view for us to let the groups have rights to:

# incl/excl subtree mask


view all included .1 80
view system included .iso.org.dod.internet.mgmt.mib-2.system

Don't chnage anything here leave this one as default setting

Final Step
####
# Finally, grant the 2 groups access to the 1 view with different
# write permissions:

# context sec.model sec.level match read write notif


access MyROSystem "" any noauth exact system none none
access MyROGroup "" any noauth exact all none none
access MyRWGroup "" any noauth exact all all none

Don't chnage anything here leave this one as default setting.

Optional Configuration

# System contact information

syslocation Unknown (configure /etc/snmp/snmpd.local.conf)


syscontact Root <root@localhost> (configure /etc/snmp/snmpd.local.conf)

to

syslocation MainDatacenter
syscontact webmaster@debianhelp.co.uk

Now the above configuration able to access local and 192.168.0.0 /24 network machines to use full fu

Now you need to restart the snmp services using the following command

#/etc/init.d/snmpd restart

Now the SNMP server configuration is active and running.

Testing your Configuration

#snmpwalk localhost -c public -v1

SNMPv2-MIB::sysDescr.0 = STRING: Linux sritest 2.4.27-2-386 #1 Wed Aug 17 09:33:35 UTC 2005 i68
SNMPv2-MIB::sysObjectID.0 = OID: NET-SNMP-MIB::netSnmpAgentOIDs.10
SNMPv2-MIB::sysUpTime.0 = Timeticks: (656698) 1:49:26.98
SNMPv2-MIB::sysContact.0 = STRING: webmaster@debianhelp.co.uk
SNMPv2-MIB::sysName.0 = STRING: debiantest
SNMPv2-MIB::sysLocation.0 = STRING: Maindatacenter
SNMPv2-MIB::sysORLastChange.0 = Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORID.1 = OID: IF-MIB::ifMIB
SNMPv2-MIB::sysORID.2 = OID: SNMPv2-MIB::snmpMIB
SNMPv2-MIB::sysORID.3 = OID: TCP-MIB::tcpMIB
SNMPv2-MIB::sysORID.4 = OID: IP-MIB::ip
SNMPv2-MIB::sysORID.5 = OID: UDP-MIB::udpMIB
SNMPv2-MIB::sysORID.6 = OID: SNMP-VIEW-BASED-ACM-MIB::vacmBasicGroup
SNMPv2-MIB::sysORID.7 = OID: SNMP-FRAMEWORK-MIB::snmpFrameworkMIBCompliance
SNMPv2-MIB::sysORID.8 = OID: SNMP-MPD-MIB::snmpMPDCompliance
SNMPv2-MIB::sysORID.9 = OID: SNMP-USER-BASED-SM-MIB::usmMIBCompliance

If you want more options and how to use snmpd.conf file you need to check snmpd.conf man page

If you want to monitor your server or desktop machine resources like disk capacity,load,process check
SNMP Client installation in debian

Now we have seen how to configure SNMP server in above section now we need to install client in other machin

#apt-get install snmp scli tkmib

This will complete the snmp client installation.

Configuration

The system wide configuration file is /etc/snmp/snmp.conf check the community name is same as serv

com2sec paranoid default public


#com2sec readonly default public
#com2sec readwrite default private
to:

#com2sec paranoid default public


com2sec readonly 127.0.0.1 public
#com2sec readwrite default private

Now you need to restart the snmp service using the following command

#/etc/init.d/snmp restart

Testing your Configuration

#snmpwalk -v 2c -c public remotemachineipaddress system

SNMPv2-MIB::sysDescr.0 = STRING: Linux sritest 2.4.27-2-386 #1 Wed Aug 17 09:33:35 UTC 2005 i686
SNMPv2-MIB::sysObjectID.0 = OID: NET-SNMP-MIB::netSnmpAgentOIDs.10
SNMPv2-MIB::sysUpTime.0 = Timeticks: (168871) 0:28:08.71
SNMPv2-MIB::sysContact.0 = STRING: webmaster@debianhelp.co.uk
SNMPv2-MIB::sysName.0 = STRING: debiantest
SNMPv2-MIB::sysLocation.0 = STRING: maindatacenter
SNMPv2-MIB::sysORLastChange.0 = Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORID.1 = OID: IF-MIB::ifMIB
SNMPv2-MIB::sysORID.2 = OID: SNMPv2-MIB::snmpMIB
SNMPv2-MIB::sysORID.3 = OID: TCP-MIB::tcpMIB
SNMPv2-MIB::sysORID.4 = OID: IP-MIB::ip
SNMPv2-MIB::sysORID.5 = OID: UDP-MIB::udpMIB
SNMPv2-MIB::sysORID.6 = OID: SNMP-VIEW-BASED-ACM-MIB::vacmBasicGroup
SNMPv2-MIB::sysORID.7 = OID: SNMP-FRAMEWORK-MIB::snmpFrameworkMIBCompliance
SNMPv2-MIB::sysORID.8 = OID: SNMP-MPD-MIB::snmpMPDCompliance
SNMPv2-MIB::sysORID.9 = OID: SNMP-USER-BASED-SM-MIB::usmMIBCompliance
SNMPv2-MIB::sysORDescr.1 = STRING: The MIB module to describe generic objects for network interface sub-
SNMPv2-MIB::sysORDescr.2 = STRING: The MIB module for SNMPv2 entities
SNMPv2-MIB::sysORDescr.3 = STRING: The MIB module for managing TCP implementations
SNMPv2-MIB::sysORDescr.4 = STRING: The MIB module for managing IP and ICMP implementations
SNMPv2-MIB::sysORDescr.5 = STRING: The MIB module for managing UDP implementations
SNMPv2-MIB::sysORDescr.6 = STRING: View-based Access Control Model for SNMP.
Alternately, you can use scli,
#scli localhost
and then type in show or monitor.
This will confirm the SNMP service is active and working properly.
cat /proc/pci
/sbin/lspci

cat /proc/ioports

IRQ /proc/interrupts

DMA cat /proc/dma

IDE hdparm -I /dev/hda

The setserial command


Modem

sound lspci to display sound


resources

/etc/modprobe.conf
(2.6 kernel)

/proc/scsi/scsi
scsi_info command

The sg_map command

The sginfo command

USB lspci output for


USB devices
/proc/bus/usb/devices
lsusb command
Linux USB drivers
Table 5. Linux USB drivers
Driver
EHCI
UHCI

JE
OHCI

parted

Table 3. FHS directories in /


Directory
bin
boot
dev
etc
lib
media
mnt
opt
sbin
srv
tmp
usr
var

lilo -q
will display information from the map file
lilo -R
will set lilo to automatically boot the specified system on the next reboot only. This is very co
lilo -I
will display information about the path of a kernel
lilo -u
will uninstall lilo and restore the previous boot record.

GRUB
default
specifies which system to load if the user does not make a choice within a timeout. In our ex
timeout
specifies a timeout in seconds before booting the default entry. Note that LILO uses tenths o
splashimage
Specifies the background, or
password
specifies a password that must be entered before a user can unlock the menu and either edi

Our example shows five Linux distributions (three Red Hat and two Ubuntu) plus a Windows XP

title
is a descriptive title that is shown as the menu item when Grub boots. You use the arrow key
root
specifies the partition that will be booted. As with splashimage, remember that counting star
kernel
specifies the kernel image to be loaded and any required kernel parameters. This is similar t
initrd
is the name of the initial RAM disk
savedefault
is shown here for illustration. If the menu command
boot
is an optional parameter that instructs GRUB to boot the selected operating system. This is t
lock
is used in this example with the second Ubuntu system. This system will boot into single use
rootnoverify
is similar to root, except that GRUB does not attempt to mount the filesystem or verify its pa
chainloader
specifies that another file will be loaded as a stage 1 file. The value "+1" is equivalent to 0+

MBR
Recovery

Using a rescue disk and chroot.


The port numbers are in hexadecimal (base 16). You'll doubtless see several that
look familiar, such as keyboard, timer, parallel (printer), serial (modem) and
display (vga+). Compare these with the some of the standard IO port
assignments for a PC as shown in Listing 3. Notice, for example, that the first
parallel port is (parport0) has the address range 0378 to 037A allocated in the
/proc/ioports listing, but the standard allows it (LPT!) to use the range 378
through 37F.
Standard I/O Port Settings

1FO-1F8 - Hard Drive Controller, 16-bit ISA


200-20F - Game Control
210 - Game I/O
220 - Soundcard
278-27F - LPT2
2F8-2FF - COM2
320-32F - Hard Drive Controller, 8-bit ISA
378-37F - LPT1
3B0-3BF - Monochrome Graphics Adapter (MGA)
3D0-3DF - Colour Graphics Adapter (CGA)
3F0-3F7 - Floppy Controller
3F8-3FF - COM1

This time, the interrupt numbers are decimal in the range 0 through 15. Once
again, Compare these with the standard IRQ assignments for a PC as shown in
Listing 5.
/proc/interrupts
CPU0
0: 226300426 XT-PIC timer
1: 92913 XT-PIC keyboard
2: 0 XT-PIC cascade
5: 0 XT-PIC usb-uhci
8: 1 XT-PIC rtc
9: 2641134 XT-PIC ehci-hcd, eth0, Intel ICH4
10: 0 XT-PIC usb-uhci
11: 213632 XT-PIC usb-uhci
14: 1944208 XT-PIC ide0
15: 3562845 XT-PIC ide1
NMI: 0
ERR: 0

[root@attic4 ~]# setserial /dev/ttyS0


/dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4
[root@attic4 ~]# setserial -G /dev/ttyS0
/dev/ttyS0 uart 16550A port 0x03f8 irq 4 baud_base 115200 spd_normal skip_test

Configuring modem parameters with kppp

[root@lyrebird root]# lspci | grep aud


00:1f.5 Multimedia audio controller: Intel Corporation 82801DB/DBL/DBM
(ICH4/ICH4-L/ICH4-M) AC'97 Audio Controller (rev 01)

[root@attic4 ~]# cat /etc/modprobe.conf


alias eth0 e100
alias snd-card-0 snd-intel8x0
install snd-intel8x0 /sbin/modprobe --ignore-install snd-intel8x0 &&\
/usr/sbin/alsactl restore >/dev/null 2>&1 || :
remove snd-intel8x0 { /usr/sbin/alsactl store >/dev/null 2>&1 || : ; }; \
/sbin/modprobe -r --ignore-remove snd-intel8x0
alias usb-controller ehci-hcd
alias usb-controller1 uhci-hcd

[root@waratah root]# scsi_info /dev/sda


SCSI_ID="0,0,0"
MODEL="IBM-PSG DPSS-336950M F"
FW_REV="S94S"

[root@lyrebird root]# sg_map


/dev/sg0 /dev/scd0
/dev/sg1 /dev/sda
/dev/sg2 /dev/sdb

[root@lyrebird root]# sginfo /dev/scd0


INQUIRY response (cmd: 0x12)
---------------------------
Device Type 5
Vendor: SONY
Product: DVD RW DRU-700A
Revision level: VY08

[root@lyrebird root]# lspci | grep -i usb


00:1d.0 USB Controller: Intel Corporation 82801DB/DBL/DBM
(ICH4/ICH4-L/ICH4-M) USB UHCI Controller #1 (rev 01)
00:1d.1 USB Controller: Intel Corporation 82801DB/DBL/DBM
(ICH4/ICH4-L/ICH4-M) USB UHCI Controller #2 (rev 01)
00:1d.2 USB Controller: Intel Corporation 82801DB/DBL/DBM
(ICH4/ICH4-L/ICH4-M) USB UHCI Controller #3 (rev 01)
00:1d.7 USB Controller: Intel Corporation 82801DB/DBM
(ICH4/ICH4-M) USB2 EHCI Controller (rev 01)

[root@lyrebird root]# lsusb -t

Table 5. Linux USB drivers


Chipset
USB 2.0 Support - requires one of UHCI, OHCI or JE
Intel and VIA chipsets
This is an alternate to UHCI for 2.4 kernels. If UHCI does not work, and you have
an Intel or VIA chipset, try JE
Compaq, most PowerMacs, iMacs, and PowerBooks, OPTi, SiS, ALi

Hot plugging

There are two commands that your system might use to handle hot plugging of
USB devices, usbmgr and hotplug. According to which you are using, you will
find configuration files in the /etc/usbmgr or /etc/hotplug directories. Newer
systems are more likely to have hotplug.

Hard disk geometry

[root@lyrebird root]# cat /proc/ide/hda/geometry


physical 19457/255/63
logical 19457/255/63
[root@lyrebird root]# parted /dev/hda
GNU Parted 1.6.3
Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
This program is free software, covered by the GNU General Public License.

This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU General Public License for more details.

Using /dev/hda
Information: The operating system thinks the geometry on /dev/hda is
19457/255/63. Therefore, cylinder 1024 ends at 8032.499M.
(parted)

Table 3. FHS directories in /


Description
Essential command binaries
Static files of the boot loader
Device files
Host-specific system configuration
Essential shared libraries and kernel modules
Mount point for removable media
Mount point for mounting a filesystem temporarily
Add-on application software packages
Essential system binaries
Data for services provided by this system
Temporary files
Secondary hierarchy
Variable data

/etc/lilo.conf example
prompt
timeout=50
compact
default=linux
boot=/dev/fd0
map=/boot/map
install=/boot/boot.b
message=/boot/message
lba32
password=mypassword
restricted

image=/boot/vmlinuz-2.4.21-32.0.1.EL
label=linux
initrd=/boot/initrd-2.4.21-32.0.1.EL.img
read-only
append="hdd=ide-scsi root=LABEL=RHEL3"

other=/dev/hda1
loader=/boot/chain.b
label=WIN-XP

ation from the map file

matically boot the specified system on the next reboot only. This is very convenient for automatically rebooting

ation about the path of a kernel

nd restore the previous boot record.


stem to load if the user does not make a choice within a timeout. In our example, default=2 means to load the

t in seconds before booting the default entry. Note that LILO uses tenths of a second for timeouts while GRUB u

ground, or splash, image to be displayed with the boot menu. GRUB refers to the first hard drive as (hd0) and t

ord that must be entered before a user can unlock the menu and either edit a configuration line or enter GRUB c

five Linux distributions (three Red Hat and two Ubuntu) plus a Windows XP and a floppy boot option. The comm

le that is shown as the menu item when Grub boots. You use the arrow keys to move up and down through the

tion that will be booted. As with splashimage, remember that counting starts at 0, so the first Red Hat system w

el image to be loaded and any required kernel parameters. This is similar to a combination of the LILO image an

e initial RAM disk which contains modules needed by the kernel before your file systems are mounted.

illustration. If the menu command default=saved is specified, and the savedefault command is specified for an o

ameter that instructs GRUB to boot the selected operating system. This is the default action when all commands

mple with the second Ubuntu system. This system will boot into single user mode which permits a user to make

except that GRUB does not attempt to mount the filesystem or verify its parameters. This is usually used for file

ther file will be loaded as a stage 1 file. The value "+1" is equivalent to 0+1 which means to load one sector sta

Installing GRUB to a floppy disk.

[root@lyrebird root]# umount /dev/fd0


umount: /dev/fd0: not mounted
[root@lyrebird root]# grub-install /dev/fd0
Installation finished. No error reported.
This is the contents of the device map /boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install'.

(fd0) /dev/fd0
(hd0) /dev/hda
(hd1) /dev/hdc
(hd2) /dev/sda

Once you have tested your boot floppy you are ready to install GRUB in the MBR
of your hard drive. For the first IDE hard drive, you would use:
grub-install /dev/hda
or
grub-install '(hd0)'

To install it into the partition boot record for partition 11, use:

grub-install /dev/hda11
or
grub-install '(hd0,10)'

Remember that GRUB numbers from 0.

We will now look at some things that can go wrong with your carefully prepared boot setup, particular

These strategies and tools will show you that anyone who has physical access to a machine has a lot o

Another install destroys your MBR.

Sometimes you will install another operating system and inadvertently overwrite your MBR. Some sys

If you don't happen to have a boot floppy, but you still have almost any Linux distribution available, yo

sk and chroot.

sh-3.00# chroot /mnt/sysimage


sh-2.05b# lilo
Added linux *
Added WIN-XP
sh-2.05b# grub-install '(fd0)'
Installation finished. No error reported.
This is the contents of the device map /boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install'.

(fd0) /dev/fd0
(hd0) /dev/hda
(hd1) /dev/hdc
(hd2) /dev/sda
sh-2.05b#

Installing GRUB on diskette with a filesystem.

[root@lyrebird root]# mkdosfs -R 210 /dev/fd0


mkdosfs 2.8 (28 Feb 2001)
[root@lyrebird root]# mount /dev/fd0 /mnt/floppy
[root@lyrebird root]# mkdir /mnt/floppy/boot
[root@lyrebird root]# mkdir /mnt/floppy/boot/grub
[root@lyrebird root]# cp /boot/grub/stage1 /mnt/floppy/boot/grub
[root@lyrebird root]# cp /boot/grub/stage2 /mnt/floppy/boot/grub
[root@lyrebird root]# cp /boot/grub/splash* /mnt/floppy/boot/grub
[root@lyrebird root]# cp /boot/grub/grub.conf /mnt/floppy/boot/grub
[root@lyrebird root]# umount /dev/fd0
[root@lyrebird root]# grub
Probing devices to guess BIOS drives. This may take a long time.

GRUB version 0.93 (640K lower / 3072K upper memory)

[ Minimal BASH-like line editing is supported. For the first word, TAB
lists possible command completions. Anywhere else TAB lists the possible
completions of a device/filename.]

grub> root (fd0)


Filesystem type is fat, using whole disk

grub> setup (fd0)


Checking if "/boot/grub/stage1" exists... yes
Checking if "/boot/grub/stage2" exists... yes
Checking if "/boot/grub/fat_stage1_5" exists... no
Running "install /boot/grub/stage1 (fd0) /boot/grub/stage2 p /boot/grub/grub.c
onf "... succeeded
Done.
Standard IRQ Settings

IRQ 0 - System Timer


IRQ 1 - Keyboard
IRQ 2(9) - Video Card
IRQ 3 - COM2, COM4
IRQ 4 - COM1, COM3
IRQ 5 - Available (LPT2 or Sound Card)
IRQ 6 - Floppy Disk Controller
IRQ 7 - LPT1
IRQ 8 - Real-Time Clock
IRQ 9 - Redirected IRQ 2
IRQ 10 - Available
IRQ 11 - Available
IRQ 12 - PS/2 Mouse
IRQ 13 - Math Co-Processor
IRQ 14 - Hard Disk Controller
IRQ 15 - Available
Sound related output from lsmod (2.6 kernel)

[root@attic4 ~]# lsmod |egrep '(snd)|(Module)'


Module Size Used by
snd_intel8x0 34689 1
snd_ac97_codec 75961 1 snd_intel8x0
snd_seq_dummy 3653 0
snd_seq_oss 37057 0
snd_seq_midi_event 9153 1 snd_seq_oss
snd_seq 62289 5 snd_seq_dummy,snd_seq_oss,snd_seq_midi_event
snd_seq_device 8781 3 snd_seq_dummy,snd_seq_oss,snd_seq
snd_pcm_oss 51185 0
snd_mixer_oss 17857 1 snd_pcm_oss
snd_pcm 100169 3 snd_intel8x0,snd_ac97_codec,snd_pcm_oss
snd_timer 33605 2 snd_seq,snd_pcm
snd 57157 11 snd_intel8x0,snd_ac97_codec,snd_seq_oss,
snd_seq,snd_seq_device,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_timer
soundcore 10913 1 snd
snd_page_alloc 9669 2 snd_intel8x0,snd_pcm
Creating a bootable floppy disk with lilo

[root@lyrebird root]# lilo -v -v


LILO version 21.4-4, Copyright (C) 1992-1998 Werner Almesberger
'lba32' extensions Copyright (C) 1999,2000 John Coffman

Reading boot sector from /dev/fd0


Merging with /boot/boot.b
Secondary loader: 11 sectors.
Mapping message file /boot/message
Compaction removed 43 BIOS calls.
Message: 74 sectors.
Boot image: /boot/vmlinuz-2.4.21-32.0.1.EL
Setup length is 10 sectors.
Compaction removed 2381 BIOS calls.
Mapped 2645 sectors.
Mapping RAM disk /boot/initrd-2.4.21-32.0.1.EL.img
Compaction removed 318 BIOS calls.
RAM disk: 354 sectors.
Added linux *
Boot other: /dev/hda1, on /dev/hda, loader /boot/chain.b
Compaction removed 0 BIOS calls.
Mapped 6 (4+1+1) sectors.
Added WIN-XP
/boot/boot.0200 exists - no backup copy made.
Map file size: 8192 bytes.
Writing boot sector.
nt for automatically rebooting remote systems.

Incorrect /etc/lilo.conf example

[root@lyrebird root]# lilo


Warning: device 0x030b exceeds 1024 cylinder limit
Fatal: geo_comp_addr: Cylinder number is too big (16284 > 1023)
[root@lyrebird root]# lilo -l
Warning: device 0x030b exceeds 1024 cylinder limit
Fatal: sector 261613688 too large for linear mode (try 'lba32' instead)

/boot/grub/menu.lst GRUB configuration example.


# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You do not have a /boot partition. This means that
# all kernel and initrd paths are relative to /, eg.
# root (hd1,5)
# kernel /boot/vmlinuz-version ro root=/dev/hdc6
# initrd /boot/initrd-version.img
#boot=/dev/hdc6
default=2
timeout=10
splashimage=(hd0,6)/boot/grub/splash.xpm.gz
password --md5 $1$/8Kl21$3VPIphs6REHeHccwzjQYO.
so the first Red Hat system which is specified as root (hd0,6) is actually on partition 7 the first hard drive (/dev
title Red Hat Linux (2.4.20-31.9)
root (hd0,6)
kernel /boot/vmlinuz-2.4.20-31.9 ro root=LABEL=RH9 hdd=ide-scsi
initrd /boot/initrd-2.4.20-31.9.img

title Red Hat Linux (2.4.20-6)


root (hd0,6)
kernel /boot/vmlinuz-2.4.20-6 ro root=LABEL=RH9 hdd=ide-scsi
initrd /boot/initrd-2.4.20-6.img
which permits a user to make modifications to a system that are normally restricted to root access. If this is sp
title Red Hat Enterprise Linux WS A (2.4.21-32.0.1.EL)
root (hd0,10)
kernel /boot/vmlinuz-2.4.21-32.0.1.EL ro root=LABEL=RHEL3 hdd=ide-scsi
initrd /boot/initrd-2.4.21-32.0.1.EL.img

title Ubuntu, kernel 2.6.10-5-386


root (hd1,10)
kernel /boot/vmlinuz-2.6.10-5-386 root=/dev/hdb11 ro quiet splash
initrd /boot/initrd.img-2.6.10-5-386
savedefault
boot

title Ubuntu, kernel 2.6.10-5-386 (recovery mode)


lock
root (hd1,10)
kernel /boot/vmlinuz-2.6.10-5-386 root=/dev/hdb11 ro single
initrd /boot/initrd.img-2.6.10-5-386
boot

title Win/XP
rootnoverify (hd0,0)
chainloader +1

title Floppy
root (fd0)
chainloader +1

repared boot setup, particularly when you install and boot multiple operating systems.The first thing to rememb

ccess to a machine has a lot of power. Likewise, anyone who has access to a grub command line also has acces

overwrite your MBR. Some systems, such as DOS and Windows, always install their own MBR. It is usually very e

Linux distribution available, you can usually boot the Linux install media in a recovery mode. When you do so, t

Creating a GRUB boot floppy.

[root@lyrebird root]# ls /usr/share/grub


i386-redhat
[root@lyrebird root]# cd /usr/share/grub/i386-redhat
[root@lyrebird i386-redhat]# ls -l st*
-rw-r--r-- 1 root root 512 Aug 3 2004 stage1
-rw-r--r-- 1 root root 104092 Aug 3 2004 stage2
[root@lyrebird i386-redhat]# dd if=stage1 of=/dev/fd0 bs=512 count=1
1+0 records in
1+0 records out
[root@lyrebird i386-redhat]# dd if=stage2 of=/dev/fd0 bs=512 seek=1

203+1 records in
203+1 records out

The GRUB command line.

GRUB version 0.93 (640K lower / 3072K upper memory)

[ Minimal BASH-like line editing is supported. For the first word, TAB
lists possible command completions. Anywhere else TAB lists the possible
completions of a device/filename.]
grub>
Possible commands are: blocklist boot cat chainloader clear cmp color configfi
le debug device displayapm displaymem dump embed find fstest geometry halt help
hide impsprobe initrd install ioprobe kernel lock makeactive map md5crypt modu
le modulenounzip pager partnew parttype password pause quit read reboot root ro
otnoverify savedefault serial setkey setup terminal terminfo testload testvbe u
nhide uppermem vbeprobe

grub> help rootnoverify


rootnoverify: rootnoverify [DEVICE [HDBIAS]]
Similar to `root', but don't attempt to mount the partition. This
is useful for when an OS is outside of the area of the disk that
GRUB can read, but setting the correct root device is still
desired. Note that the items mentioned in `root' which derived
from attempting the mount will NOT work correctly.

grub> find /boot/grub/grub.conf


(hd0,2)
(hd0,6)
(hd0,7)
(hd0,10)
(hd1,7)

grub>
ss,snd_seq_midi_event
_oss,snd_seq

dec,snd_pcm_oss

c,snd_seq_oss,
snd_pcm,snd_timer
mesberger

84 > 1023)

ba32' instead)
changes to this file

6) is actually on partition 7 the first hard drive (/dev/hda7 in this case), while the first U buntu system which is sp

H9 hdd=ide-scsi

hdd=ide-scsi

t are normally restricted to root access. If this is specified, then you should also specify a pass word in the initia

EL=RHEL3 hdd=ide-scsi

1 ro quiet splash

1 ro single
ultiple operating systems.The first thing to remember is to resist your initial temptation to panic. Recovery is us

o has access to a grub command line also has access to files on your system without the benefit of any ownersh

ws, always install their own MBR. It is usually very easy to recover from this situation. If you develop a habit of c

nstall media in a recovery mode. When you do so, the root filesystem on your hard drive will either be mounted

bs=512 count=1

bs=512 seek=1

rst word, TAB


TAB lists the possible
clear cmp color configfi
ind fstest geometry halt help
ctive map md5crypt modu
use quit read reboot root ro
minfo testload testvbe u
buntu system which is specified as root (hd1,10) is on the second hard drive (/dev/hdb11). GRUB will attempt to

y a pass word in the initial options, otherwise, a user can edit out your lock option and boot the system, or add "
n to panic. Recovery is usually only a few steps away. We will give you a few strategies here that should help yo

e benefit of any ownership or other secur ity provisions provided by a running system. Keep these points in min

you develop a habit of creating a boot floppy every time you run lilo or reinstall GRUB, you are home free. Sim

e will either be mounted at some st range recovery point, or the drive will not be mounted at all. You can use th
v/hdb11). GRUB will attempt to mount this partition to check it and provide values to the booted operating syste

and boot the system, or add "single" to one of the other entries. It is also possible to specify a different passwor
tegies here that should help you through many types of crisis.

tem. Keep these points in mind when you select your boot loader. The choice between LILO and GRUB is largely

GRUB, you are home free. Simply boot into your Linux system from the floppy and rerun lilo or grub-install.

mounted at all. You can use the chroot command to make this odd mount point become your root (/) directory. T
to the booted operating system in some cases.

to specify a different password for individual entries if you wish.


ween LILO and GRUB is largely a matter of personal preference. with what you have learned already and what w

d rerun lilo or grub-install.

ecome your root (/) directory. Then run lilo or grub-install to create a new boot floppy or to reinstall the MBR. I p
ve learned already and what we are about to show you, you should be equipped to choose the loader that best

ppy or to reinstall the MBR. I prefer to create a floppy and use it to boot, making sure that all is well before I go
o choose the loader that best suits your particular needs and style of working.

ure that all is well before I go and rewrite th e MBR, but you may be more courageous than I. Listing 9 shows an
ous than I. Listing 9 shows an example using the environment we used for our earlier configuration examples. I
rlier configuration examples. In this example, I booted a Red Hat Enterprise Linux boot disk which mounted /dev
boot disk which mounted /dev/hda11 at /mnt/sysimage. Most rescue environments will dump you into a large s
ts will dump you into a large screen with a prompt, rather than the graphical screen you might be more used to
en you might be more used to. Think of this as a terminal window with you logged in as root. In other words, be
d in as root. In other words, be very careful what you write to your hard drive. In listing 9, user entry is shown in
isting 9, user entry is shown inbold.

Potrebbero piacerti anche