Translation(s): Deutsch - English - Français - Italiano - Dutch - ?Русский - 简体中文

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

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, HowTo, vmware, vmwaretools, vmware tools, vm, tool, AMD64, 64 bit

Debian Services

FTP Server

Install

aptitude update
aptitude install vsftpd

Configure

vi /etc/vsftpd.conf

anonymous_enable=NO

write_enable=YES

ftpd_banner=Welcome to example.com FTP service. Enjoy.

local_enable=YES

Photo Album Server

Install

apt-get update
apt-get install apache2
apt-get install mysql-server
apt-get install php5
apt-get install php5-mysql

apt-get update
apt-get install gallery2

Configure

Alias /gallery2 /usr/share/gallery2

/etc/init.d/apache2 restart

Gallery2 configuration

cp /home/lucas/Desktop/login.txt /usr/share/gallery2/

mkdir /usr/share/gallery2/g2data
chmod 755 /usr/share/gallery2/g2data
chown www-data:www-data /usr/share/gallery2/g2data

mysql -u root -p

create database gallery2;

Gallery2 Components

apt-get install imagemagick

Alias /photos /usr/share/gallery2

Manage Photos

VMware Server On Debian

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

VMware Kernel Upgrade

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

VMware on amd64

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 Configuration

Change from dhcp to static ip

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
[tab]dns-nameservers 192.168.1.1

#iface eth0 inet dhcp
iface eth0 inet static
    address 192.168.1.200
    network 192.168.1.0
    dns-nameservers 192.168.1.1 
    netmask 255.255.255.0
    broadcast 192.168.1.255
    gateway 192.168.1.1

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
    dns-nameservers 192.168.5.254

Subversion

apt-cache search svn
aptitude install subversion

/home/lucas/my_best_project

/home/lucas/my_best_project/trunk/install.c
/home/lucas/my_best_project/trunk/readme.txt

/usr/local/src/

svnadmin create /usr/local/src/my_best_project

svn import /home/lucas/my_best_project file:///usr/local/src/my_best_project -m "initial import"

svn checkout file:///usr/local/src/my_best_project

/home/lucas/new_folder/my_best_project

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

Ati binary driver

Steps borrowed from Michael Schurter's blog. Tips borrowed from Gentoo wiki.

aptitude update
aptitude install fglrx-control fglrx-driver fglrx-kernel-src module-assistant mesa-utils

cd /usr/src

module-assistant prepare

module-assistant a-i fglrx

cp /etc/X11/xorg.conf /etc/X11/xorg.conf.todaysdate

Section "Device"
   Driver "fglrx"
   Option "VideoOverlay" "on"
EndSection

Section "Extensions"
   Option "XVideo" "Enable"
EndSection

/etc/init.d/gdm stop

/etc/init.d/kdm stop

/etc/init.d/xdm stop

modprobe -r radeon

modprobe fglrx

/etc/init.d/gdm start

glxinfo | grep direct

xvinfo

Mount Windows Share

aptitude update
aptitude install smbfs

mkdir somefolder

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

If you don't 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

lspci -v

ifconfig eth1 hw ether 00:00:..:00 uo

Power Users

Sudo

aptitude update
aptitude install sudo

visudo

yourusername    ALL=(ALL) ALL

Disable ssh root access

vi /etc/ssh/sshd_config

PermitRootLogin no

/etc/init.d/ssh force-reload

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

aptitude update
aptitude awstats

cp /usr/share/doc/awstats/examples/apache.conf /etc/apache2/conf.d/awstats

LogFile="/var/log/apache2/access.log"
SiteDomain="mysite.org"
LogFormat=1

chmod o+r /var/log/apache2/access.log

 create 644 root adm

prerotate
    /usr/lib/cgi-bin/awstats.pl -config=awstats.www.mysite.org.conf  -update
  endscript

/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
}

/var/log/apache2/*.log {
        weekly
        missingok
        rotate 52
        compress
        delaycompress
        notifempty
        create 640 root adm
        sharedscripts
        postrotate
                /usr/lib/cgi-bin/awstats.pl -config=awstats.www.first.site.com.conf -update
                /usr/lib/cgi-bin/awstats.pl -config=awstats.www.second.site.conf -update
                /usr/lib/cgi-bin/awstats.pl -config=awstats.www.third.site.conf -update
                /etc/init.d/apache2 reload > /dev/null
        endscript
}

/etc/init.d/apache2 reload

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

RedirectMatch ^/logs /cgi-bin/awstats.pl?config=awstat.conf

http://www.mysite.com/logs

unixODBC

aptitude update
aptitude install tdsodbc unixodbc

vi /etc/freetds/tds.driver.template

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

vi /etc/freetds/tds.dsn.template

[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]

[SQLServer2008]
Description     = Production Server
Driver          = TDS
Trace           = No
Server          = servername\instance_name
TDS_Version     = 8.0

odbcinst -i -d -f /etc/freetds/tds.driver.template

odbcinst -i -s -l -f /etc/freetds/tds.dsn.template

odbcinst -i -s -f /etc/freetds/tds.dsn.template

isql -v DSN_NAME username password

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

Troubleshooting

telnet myserver 1433

Trying 10.3.3.10...
Connected to myserver.
Escape character is '^]'.

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

Apt Preferences

vi /etc/apt/preferences

Package: *
Pin: release a=stable
Pin-Priority: 600
Package: *
Pin: release a=testing
Pin-Priority: 450
Package: *
Pin: release a=unstable
Pin-Priority: 400

aptitude update

Debian User Configuration

Change default editor

aptitude update
aptitude install vim

update-alternatives --config editor

Change default pdf viewer

Check installed browser plugins

Java Runtime Enviroment (JRE) AMD64

cd /usr/local/src/
mkdir JREx64
cd JREx64
#put the file here
sh ./jre-6u12-linux-x64.bin
cd /usr/lib/mozilla/plugins/
sudo ln -s /usr/local/src/JREx64/jre1.6.0_12/lib/amd64/libnpjp2.so

Laptop and Debian

Authenticate with wpa using PSK TKIP

aptitude update
aptitude install wpasupplicant

vi /etc/network/interfaces

iface eth2 inet dhcp
wpa-ssid thisismynetworkname
wpa-psk thisismypassword

ifup eth2

auto eth2

Intel Graphic card - Higher reolution

<!> Not required for DebianLenny and later releases. Support is included within xserver-xorg-video-intel.

aptitude install 915resolution

915resolution -l

sudo 915resolution 5c 1280 800 24

Troubleshooting

SSH terminal connection timeout

Read from remote host example.com: Connection reset by peer
Connection to example.com closed

ClientAliveInterval 150

Dynamic MMap ran out of room

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

Useful Debian Programs

Digital Camera

* Digikam, for all your digital camera needs

aptitude update
aptitude install digikam

Players and Viewers

Flash

aptitude update
aptitude install flashplugin-nonfree

How to Remote connect to Windows

aptitude update
aptitude install rdesktop

rdesktop ip.add.re.ss

or

rdesktop remoteconnection.example.com