Differences between revisions 105 and 106
Revision 105 as of 2008-04-08 23:06:35
Size: 21687
Comment: added amd64 keywords
Revision 106 as of 2008-04-11 02:09:18
Size: 22082
Comment: update to java install
Deletions are marked like this. Additions are marked like this.
Line 536: Line 536:
 *Here is how to install Java on Debian
Line 544: Line 544:
 *If you want you can take away 'non-free' when done, and do aptitude update
__ If you want you can take away 'non-free' when done, and do aptitude update. __
 *This package that you just installed is not a development environment and doesn't contain development tools such as compilers or debuggers.
 *For development tools, you need to install the Java Development Kit JDK(TM) package.
{{{
aptitude update
aptitude install sun-java5-jdk
}}}

__ Testing Version of Debian (lenny) contains Java 6. __

translation: [:Manual-HowtoPolish:Polski],[:fr/ManualHowto:Français],[:Manual-HowtoSpanish:Spanish],[:Manual-HowtoDutch:Dutch].

How to install and configure various software on Debian. Step by step.

?TableOfContents(2)

Keywords: Debian GNU Linux, Manual, How To, How-To,howto, Installation, Configuration, Easy, From Windows XP to Debian, Wireless WPA2, anti-spam, fax, Documentation, MoinMoin Wiki, Linux, servers, Windows, Windows NT, Documentation, howto, ?HowTo, vmware, installation, vmwaretools, vmware tools, vm, tools, tool, AMD64, 64 bit

Debian Services

Installing and Configuring Postfix on Debian

See ["Postfix"]

Debian Postfix and smtp.sbcglobal.yahoo.com

See ["Postfix"]

Ampache (Music Server) on Debian

See ["Ampache"]

MoinMoin Wiki with Apache2 and Mod Python

See ["?ApachePython"]

Fax Server

See ["HylaFax"]

Network Time Synchronization

See ["NTP"]

FTP Server

Install

  • Install Ftp Server ("Very secure ftp server")

aptitude update
aptitude install vsftpd
  • Ftp server has been installed

Configure

  • Now configure your server
  • Edit /etc/vsftpd.conf

vi /etc/vsftpd.conf
  • [Optional] Disable Anonymous account by finding the line that says anonymous_enable=YES and make it

anonymous_enable=NO
  • [Optional] Allow Write access (upload access). Find and uncomment the following line:

write_enable=YES
  • [Optional] Add you banner when people log in. Find and uncomment this #ftpd_banner=Welcome to blah FTP service. line and make it:

ftpd_banner=Welcome to example.com FTP service. Enjoy.
  • [Optional] Allow local users to log in. Uncomment the following line:

local_enable=YES

Photo Album Server

  • Photo album gallery2 server.

http://lucasmanual.com/mywiki/PhotoAlbumServer

Domain Controller, Samba

http://lucasmanual.com/mywiki/SambaDomainController

NFS Server

See the Debian Wiki page ["NFSServerSetup"].

VMware Server On Debian

  • Very good how-to which didn't require from me any additional configuration to install vmware on debian and then windows xp as a guest os is here:
  • See ["VMware"] article.

http://lucasmanual.com/out/Debian-vmware-windows-xp.jpg

VMware Kernel Upgrade

  • On an upgrade when your kernel has been updated you need to download the kernel headers and reconfigure vmware.

aptitude update
aptitude install linux-headers-$(uname -r)
/usr/bin/vmware-config.pl

VMware on amd64

  • In order to install vmware on amd64 you have to install few extra libs:

aptitude install linux-headers-`uname -r` libx11-6 libx11-dev x-window-system-core x-window-system xspecs libxtst6 psmisc build-essential ia32-libs

Debian Anti-Spam Anti-Virus Gateway Email Server

http://lucasmanual.com/mywiki/DebianAntiSpamGatewayEmailServer

RSA Authentication Manager

  • RSA Authentication Manager (needed for working with RSA's SecurID tokens) doesn't support Debian. Getting it to work in Debian is... a challenge, unless you have this simple 45-step HOWTO: http://discord.ensued.net/install_rsaauthmgr_with_etch_en.txt

  • Trust me, 45 steps only seems a lot until you spent 3 days working out what the 45 steps should be...

Debian Printing

http://lucasmanual.com/mywiki/DebianPrinting

Debian Configuration

Change from dhcp to static ip

  • edit /etc/network/interfaces
  • comment iface eth0 inet dhcp and below type :

iface eth0 inet static
[tab]address 192.168.1.200
[tab]network 192.168.1.0
[tab]netmask 255.255.255.0
[tab]broadcast 192.168.1.255
[tab]gateway 192.168.1.1
  • Your file should look like:

#iface eth0 inet dhcp
iface eth0 inet static
    address 192.168.1.200
    network 192.168.1.0
    netmask 255.255.255.0
    broadcast 192.168.1.255
    gateway 192.168.1.1
  • or

iface eth0 inet static
    address 192.168.5.200
    network 192.168.5.0
    netmask 255.255.255.0
    broadcast 192.168.5.255
    gateway 192.168.5.254

Subversion

  • Svn is a software that manages any type of data. It monitors its changes, lets you update them, and if something went wrong you can go back to previous version with no problems.
  • Let's install it on Debian:

apt-cache search svn
aptitude install subversion
  • Subversion is installed
  • The story goes like this: I have a project I am working on. It is located at

/home/lucas/my_best_project
  • This folder includes

/home/lucas/my_best_project/trunk/install.c
/home/lucas/my_best_project/trunk/readme.txt
  • I keep my working files in trunk. I want it in subversion now!
  • We need to tell subversion where it can store its repositories:
  • It will be in

/usr/local/src/
  • Now create repository directory:

svnadmin create /usr/local/src/my_best_project
  • Now I am going to import my_best_project to svn

svn import /home/lucas/my_best_project file:///usr/local/src/my_best_project -m "initial import"
  • Folder /home/lucas/my_best_project is not important anymore. SVN is not concerned what you are going to do with it.

  • Now we need to start working with subversion and we do that by creating a folder where we can work on my best project with subversion. It will be in /home/lucas/new_folder/ We need to go to that folder. And from that folder we issue command:

svn checkout file:///usr/local/src/my_best_project
  • Now it created

/home/lucas/new_folder/my_best_project
  • This folder contains files I kept in a trunk. I can now work on it and let svn take care the version tracking.

* Optional, you could use subversion over ssh. You need to install subversion on your computer and then:

svn co svn+ssh://your.remote-server.com/usr/local/src/my_best_project

* Done. Now its time to make that tool great.

Multimedia player and codec on Debian

/etc/apt/source.list

deb http://mirrors.ecology.uni-kiel.de/debian/debian-multimedia testing main
  • [Optional]Add the GPG key:

wget http://www.debian-multimedia.org/pool/main/d/debian-multimedia-keyring/debian-multimedia-keyring_2007.02.14_all.deb
dpkg -i debian-multimedia-keyring_2007.02.14_all.deb
  • Now install xine:

aptitude update
aptitude install xine-ui
  • Now install windows file format support:

aptitude install w32codecs
  • Done. You can remove the mirror we just entered from sourcelist if you wish to do so.

Ati binary driver

Steps borrowed from [http://michael.susens-schurter.com/blog/2006/11/20/installing-fglrx-ati-drivers-in-debian-etch/ Michael Schurter's blog]. Tips borrowed from [http://gentoo-wiki.com/HOWTO_ATI_Drivers Gentoo wiki].

  • Step 0: Install the required packages (you may need to add "non-free" to /etc/apt/sources.list)

aptitude update
aptitude install fglrx-control fglrx-driver fglrx-kernel-src module-assistant mesa-utils
  • Step 1: Change to kernel and kernel module source code directory.

cd /usr/src
  • Step 2: Prepare your system to build new kernel modules.

module-assistant prepare
  • Step 3: Build the fglrx kernel module.

module-assistant a-i fglrx
  • Step 4: Make a copy of your xorg.conf file:

cp /etc/X11/xorg.conf /etc/X11/xorg.conf.todaysdate
  • Step 5: Edit your /etc/X11/xorg.conf file, and set your display driver to fglrx
  • Locate the device section and add the corresponding lines Section "Device".

Section "Device"
   Driver "fglrx"
   Option "VideoOverlay" "on"
EndSection
  • Driver line is probably currently set to "radeon" or "ati". Remember which name you have because you will use it in step #7.
  • Also enable XVideo in Extentions

Section "Extensions"
   Option "XVideo" "Enable"
EndSection
  • Step 5: Exit Gnome (or KDE, just get out of X Windows), press ctrl-alt-F1 to get a console, login as root.
  • Step 6: Stop Gnome Display Manager:

/etc/init.d/gdm stop

Or KDE Display Manager

/etc/init.d/kdm stop

Or X Display Manager

/etc/init.d/xdm stop
  • Step 7: Remove the old kernel module

modprobe -r radeon
  • Step 8: Load the new kernel module

modprobe fglrx
  • Step 9: Start the Display manager (substitude gdm with kdm or xdm)

/etc/init.d/gdm start
  • Step 10: Test the 3d acceleration

glxinfo | grep direct
  • Step 11: Test the xvideo extension

xvinfo

Mount Windows Share

  • You need to have smbfs installed. If you don't do this:

aptitude update
aptitude install smbfs
  • To mount windows share drive you need to create a folder:

mkdir somefolder
  • As root or with root privilages (su root or sudo)

mount -t smbfs -o username=administrator,password=password
//windowsservername/folder /home/lucas/somefolder

If you don' want the password to show up you could do

mount -t smbfs -o username=administrator //windowsservername/folder /home/lucas/somefolder

[Optional] You can replace administrator with your username. You can also replace windowsservername with ip address //192.168.1.10/folder ....

Add a network card

  • See if your card is in a list.

lspci -v
  • Add a network card by a hardware number. Replace 00:00:..:00 with your harware number. It should be 16 characters.

ifconfig eth1 hw erher 00:00:..:00 uo

Raid 1 Setup

http://lucasmanual.com/mywiki/DebianRAID

Power Users

Sudo

  • If sudo command is not installed, install it.

aptitude update
aptitude install sudo
  • Then run visudo

visudo
  • Copy root ALL=(ALL) ALL and paste it right below. Then change root to your user name on the pasted line.

yourusername    ALL=(ALL) ALL

Disable ssh root access

  • Edit file sshd_config file

vi /etc/ssh/sshd_config
  • On a line where you see Permit root login change it to no

PermitRootLogin no
  • Restart or reload ssh

/etc/init.d/ssh force-reload
  • This will prevent other users from trying to get guess your password. 100s of lines on your system that look:

Security Events
=-=-=-=-=-=-=-=
Feb  5 07:21:15 localhost sshd[8586]: Failed password for root from xx.xx.xx.xx port 60618 ssh2
Feb  5 07:21:15 localhost sshd[8588]: Failed password for root from xx.xx.xx.xx port 60637 ssh2

AWStats on Debian

  • Install AWStats

aptitude update
aptitude awstats
  • Configure the apache2 for awstats
  • Copy configuration file for apache2.

cp /usr/share/doc/awstats/examples/apache.conf /etc/apache2/conf.d/awstats
  • Then edit /etc/awstats/awstats.conf file and make sure the file contains (double check the apache2 word)

LogFile="/var/log/apache2/access.log"
SiteDomain="mysite.org"
LogFormat=1
  • Now change a permission on apache log file

chmod o+r /var/log/apache2/access.log
  • Make it a default that access.log has these permissions.
  • Edit the /etc/logrotate.d/apache2 and make sure it has these lines

 create 644 root adm
  • And

prerotate
    /usr/lib/cgi-bin/awstats.pl -config=awstats.www.mysite.org.conf  -update
  endscript
  • Final file should look similar to :

/var/log/apache2/*.log {
        weekly
        missingok
        rotate 52
        compress
        delaycompress
        notifempty
        create 644 root adm
        sharedscripts
        prerotate
            /usr/lib/cgi-bin/awstats.pl -config=awstats.conf -update        endscript
        postrotate
                if [ -f /var/run/apache2.pid ]; then
                        /etc/init.d/apache2 restart > /dev/null
                fi
        endscript
}
  • Reload apache

/etc/init.d/apache2 reload
  • And visit:

http://localhost/cgi-bin/awstats.pl?config=awstat.conf or http://www.mysite.com/cgi-bin/awstats.pl?config=awstat.conf [Optional]

  • To make it easier to remember the address you can edit /etc/apache2/conf.d/awstats and add this line.

RedirectMatch ^/logs /cgi-bin/awstats.pl?config=awstat.conf
  • Now you can access the awstats statistics by going to

http://www.mysite.com/logs

  • Done.

unixODBC

  • Install odbc, and mssql drivers (tdsodbc)

aptitude update
aptitude install tdsodbc unixodbc
  • Create a driver template.

vi /etc/freetds/tds.driver.template
  • Inside add :

[TDS]
Description     = FreeTDS Driver for Linux & MSSQL on Win32
Driver          = /usr/lib/odbc/libtdsodbc.so
Setup           = /usr/lib/odbc/libtdsS.so
  • Now dsn file:

vi /etc/freetds/tds.dsn.template
  • And inside add:

[DSN_NAME]
Description     = Descripton of you DSN connection.
Driver          = TDS
Trace           = No
Database        = DefaultDatabase [replace with your database name]
Server          = mysqlserver.inter.net [replace with your SQL server's host,ip]
Port            = 1433 [replace with the port that SQL is listening on]
  • Now run this command to add your driver to unixodbc

odbcinst -i -d -f /etc/freetds/tds.driver.template
  • Now you add dsn. You have 2 options.
  • Add system DSN for all users

odbcinst -i -s -l -f /etc/freetds/tds.dsn.template
  • Add dsn to a user your are running a command on:

odbcinst -i -s -f /etc/freetds/tds.dsn.template
  • Now test your connection:

isql -v DSN_NAME username password
  • You should get something like

**********************************************
* unixODBC - isql                            *
**********************************************
* Syntax                                     *
*                                            *
.
.
.
more
.

Troubleshooting

  • If you can not connect it is probable that your database is listening on a different port.
  • Try this:

telnet myserver 1433

  • You should see something like:

Trying 10.3.3.10...
Connected to myserver.
Escape character is '^]'.
  • type quit to exit. Replace 1433 with a port number, replace myserver with your servers name.

If you still get connection refused try telnet from windows and see if you get same answer.

Debian User Configuration

Change default editor

  • Install your editor
  • Example:

aptitude update
aptitude install vim
  • Run configuration change

update-alternatives --config editor
  • From a list pick your editor. And you are done.

Change default pdf viewer

  • Install your pdf viewer
  • Click right mouse button on a pdf file
  • Change: 'Properties -> Open with' to your favorite pdf viewer.

Java Runtime Enviroment (JRE)

  • Here is how to install Java on Debian

You will need to add 'non-free' to your /etc/apt/source.list then do:

aptitude update
aptitude install sun-java5-jre
aptitude install sun-java5-plugin

If you want you can take away 'non-free' when done, and do aptitude update.

  • This package that you just installed is not a development environment and doesn't contain development tools such as compilers or debuggers.
  • For development tools, you need to install the Java Development Kit JDK(TM) package.

aptitude update
aptitude install sun-java5-jdk

Testing Version of Debian (lenny) contains Java 6.

Flash player

  • Flash player for Debian Linux
  • Add non-free to your source list /etc/apt/source.list

aptitude update
aptitude install flashplugin-nonfree

cp /home/lucas/Desktop/libflashplayer.so /usr/lib/mozilla/plugins/
cd /usr/lib/iceweasel/plugins/
ln -s /usr/lib/mozilla/plugins/libflashplayer.so
  • Restart Firefox/iceweasel

Laptop and Debian

Intel ipw2200 wireless card

  • Due to FCC or other frequency radiation levels restrictions, we need to download firmware from: (click agree on the bottom)

http://ipw2200.sourceforge.net/firmware.php?fid=7
  • Untar it

tar xzvf ipw2200-fw-3.0.tgz -C /lib/firmware
mv /lib/firware/ipw2200-fw-3.0/* /lib/firmware
  • Drivers come with kernel so let's install modules for ipw2200
  • Find out what is the kernel version you have.

uname -a
  • Replace 2.6.18-5-486 with the version you have.

aptitude update
aptitude install ipw2200-modules-2.6.18-5-486
or
aptitude install ipw2200-modules-$(uname -r)
  • Then this will tell you a list of wireless devices:

iwconfig
  • Done. In my case wireless card was attached to eth2

Authenticate with wpa using PSK TKIP

* Install wpasupplicant

aptitude update
aptitude install wpasupplicant

* Open /etc/network/interfaces

vi /etc/network/interfaces

*If you see "iface eth2..." add the following lines, but change ssid and password:

iface eth2 inet dhcp
wpa-ssid thisismynetworkname
wpa-key_mgmt WPA-PSK
wpa-proto WPA
wpa-pairwise TKIP
wpa-group TKIP
wpa-psk thisismypassword
wpa-driver wext

*Exit, and now type:

ifup eth2

*Done. If you want you your wireless card to connect each time you boot your computer add this above "iface eth2.."

auto eth2

*Done. [Optional](see the [:WPA:WPA page] for status on wpa support in debian)

Broadcom (Dell) Wireless Card 1390

See: ["bcm43xx"]

Intel Graphic card - Higher reolution

  • install 915resolution

aptitude install 915resolution
  • See what resolutions are available

915resolution -l
  • If the resolution you desire is not listed you will need to dpkg-reconfigure xserver-xorg and add new resolutions.

  • For example (using mode 5c (1920x1440):

sudo 915resolution 5c 1280 800 24

User Manuals

DVD9 to DVD5

[http://lucasmanual.com/mywiki/DVD9toDVD5 DVD9toDVD5]

DVD9 to AVI

[http://lucasmanual.com/mywiki/DVD9toAVI DVD9toAVI]

rsync

[http://lucasmanual.com/mywiki/rsync rsync]

Troubleshooting

SSH terminal connection timeout

  • If you get an error:

Read from remote host example.com: Connection reset by peer
Connection to example.com closed
  • Edit /etc/ssh/sshd_config and add:

ClientAliveInterval 150

Dynamic MMap ran out of room

  • If you see an error like:

{{{Reading package lists... Error! E: Dynamic MMap ran out of room E: Error occurred while processing vlc (?NewVersion1) }}}

apt-get update -o APT::Cache-Limit=25165824

MySQL

[http://lucasmanual.com/mywiki/MySQL MySQL]

Useful Debian Programs

Digital Camera

* Digikam, for all your digital camera needs

aptitude update
aptitude install digikam

CD and DVD

* K3B, for burning cd/dvd.

aptitude update
aptitude install k3b

Players and Viewers

Flash

  • For Flash support you need to add contirib to your apt source list , then

aptitude update
aptitude install flashplugin-nonfree

Debian inside VMWare

VMWare Tools Installation

--> Adjust the version number of VMWare-Tools in the commands below to your needs!

Become root

su

Unmount the ISO from which you installed debian in VMWare

umount /dev/cdrom

Start the VMWare Tools installation from the Menu of VMWare and select Install VMWare Tools... Mount the CD with VMWare Tools

mount /dev/cdrom

Copy the VMWare Tool File from the CD to folder tmp

cp /media/cdrom/VMwareTools-6.0.2-59824.tar.gz /tmp

Change to folder tmp

cd /tmp

Unzip The file

gzip -d VMWareTools-6.0.2-59824.tar.gz 
tar xf VMWareTools-6.0.2-59824.tar

Delete files we don't need anymore

rm /tmp/VMWareTools-6.0.2-59824.*

Download and install the linux headers

aptitude install linux-headers-$(uname -r)

Download and install gcc

aptitude install gcc

Start the installation

/tmp/vmware-tools-distrib/vmware-install.pl

Accept all suggestions or modify them to your needs

Previous (aborted) installation

Not tested. In case of an aborted installation you can try this before you try to install again.

su
/usr/bin/vmware-uninstall-tools.pl

Configure VMWare Tools

su
/usr/bin/vmware-toolbox