traducteur: Cedric Leinen

EN COURS DE TRADUCTION

Visit http://www.lucasmanual.com/mywiki/ for up to date manual

Comment installer et configurer différents package (logiciel) sur Debian. Pas à pas.

?TableOfContents(2) Mots clés: Debian GNU Linux, Manuel, How To, How-To, Installation, Configuration, Facile, de Windows XP vers Debian, Wireless WPA2, anti-spam, fax, Documentation, MoinMoin Wiki, Linux, servers, Windows, Windows NT, Documentation

Services Debian

Installer et configurer postfix sur Debian

apt-get install postfix

cat /var/log/mail.log

postconf -e "myorgin = example.com"

postconf -e "myhostname=server1.example.com"

postconf -e "relay_domains = example.com, example2.com, example3.com"

postfix reload

telnet localhost 25

Trying 127.0.0.1...
Connected to localhost.localdomain.
Escape character is '^]'.
220 server1.example.com ESMTP Postfix (Debian/GNU)

mail from:<you@youremail.com>
rcpt to:<user@example.com>
data
To: user@example.com
From: you@youremail.com
Subject: Hey my first email
This is my first email on debian postfix after installing configuring it.
It was easy. See you

.

quit

qshape
mailq
qshape deferred
postsuper
postsuper -r ALL   (requeue all emails)

Debian Postfix and smtp.sbcglobal.yahoo.com

apt-get postfix-tls libsasl2-modules

postconf -e "relayhost = [smtp.sbcglobal.yahoo.com]"
postconf -e "smtp_sasl_auth_enable = yes"
postconf -e "smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd"
postconf -e "smtp_sasl_security_options = noanonymous"

[smtp.sbcglobal.yahoo.com] username@sbcglobal.net:mypassword

chmod 600 /etc/postfix/sasl_passwd

postmap /etc/postfix/sasl_passwd

postfix reload

Mailman with Postfix

apt-get install mailman

newlist mailman

/etc/init.d/mailman start

relay_domains = example.com, lists.example.com

alias_maps = hash:/etc/aliases,hash:/var/lib/mailman/data/aliases

postconf -e "transport_maps = hash:/etc/postfix/transport"
postconf -e "mailman_destination_recipient_limit = 1"

mailman unix  -       n       n       -       -       pipe
   flags=FR user=list
   argv=/var/lib/mailman/bin/postfix-to-mailman.py ${nexthop} ${user}

lists.example.com    mailman:

postmap /etc/postfix/transport

MTA = 'Postfix'
DEB_LISTMASTER = 'postmaster@example.com'
POSTFIX_STYLE_VIRTUAL_DOMAIN = ['lists.example.com']

/etc/init.d/postfix reload
/etc/init.d/mailman restart

newlist list_name

Alias /pipermail/ /var/lib/mailman/archives/public/
Alias /images/mailman/ /usr/share/images/mailman/

http://lists.yourwebsite.com/cgi-bin/mailman/listinfo/list_name/

Ampache (Music Server) on Debian

apt-get install apache2
apt-get install php5 php5-mysql php5-gd

wget http://www.ampache.org/downloads/current.tar.gz
tar -xzvf current.tar.gz

mv ampache-3.3-beta4 /usr/local/bin/ampache
cd /usr/local/bin/ampache

chown -R www-data:www-data /usr/local/bin/ampache

Alias /ampache "/usr/local/bin/ampache/"
<directory />
       DirectoryIndex index.php index.html
       Options Indexes MultiViews
       AllowOverride None
       Order allow,deny
       Allow from all
</directory>

* Optional, you could change Alias from /ampache "/usr/local/bin/ampache/" to something like

Alias /musiclover "/usr/local/bin/ampache/"

/etc/init.d/apache2 restart

apt-get install mysql-server

http://localhost/ampache/install.php

chgrp -R www-data /path/to/mymusic/*

addgroup users
chgrp -R users path/to/mymusic/*
adduser www-data users

Mod Python and PSP

apt-get update
apt-get install libapache2-mod-python

a2enmod mod_python

AddHandler mod_python .psp .psp_
PythonHandler mod_python.psp

<Directory "/var/www/pspwebsite/folder">
 AddHandler mod_python .psp .psp_
 PythonHandler mod_python.psp
 PythonDebug On
 Options Indexes MultiViews
 AllowOverride None
 Order allow,deny
 Allow from all
 DirectoryIndex index.psp
</Directory>

/etc/init.d/apache2 reload

MoinMoin Wiki with Apache2 and Mod Python

  1. Apache2 and mod_python should be installed by now. If not do

apt-get update
apt-get install apache2
apt-get install libapache2-mod-python

Now Install moinmoin wiki.

apt-get install python-moinmoin
mkdir /var/www/mywiki
cp -r /usr/share/moin/data /usr/share/moin/underlay /usr/share/moin/server/moin.cgi /var/www/mywiki
chown -R www-data:www-data /var/www/mywiki
  1. Configure apache2
  2. Add the following lines to /etc/apache2/conf.d/wiki:

Alias /wiki/ "/usr/share/moin/htdocs/"

<Location /mywiki>
SetHandler python-program
PythonPath "['/var/www/mywiki','/etc/moin/']+sys.path"
PythonHandler MoinMoin.request::RequestModPy.run
PythonDebug On
</Location>
  1. Reload apache2

/etc/init.d/apache2 reload
  1. Configure Moinmoin
  2. Edit /etc/moin/farmconfig.py. You have 2 options.

wikis = [
          ("mywiki",    r"^yoursite.com/mywiki/.*$"),
        ]

or

wikis = [
    ("mywiki",  r".*"),   # this is ok for a single wiki
]
  1. Also, in /etc/moin/farmconfig.py comment out data_dir and data_underlay_dir (we need those defined separately for each wiki)
  2. Copy this file if it exists. Otherwise move on to editing mywiki.py

cp /etc/moin/moinmaster.py /etc/moin/mywiki.py
  1. Then edit /etc/moin/mywiki.py

sitename = u'MyWiki' # [Unicode]
data_dir = '/var/www/mywiki/data'
data_underlay_dir = '/var/www/mywiki/underlay'
  1. Comment out data_dir if it is somewhere else in a file
  2. Enjoy your new wiki at http://yoursite.com/mywiki/

  3. If you want your default website to go to mywiki, edit /etc/apache2/sites-available/default, and where you see ?RedirectMatch do"

#RedirectMatch ^/$ /apache2-default/
RedirectMatch ^/$ /mywiki/

allowed_actions = ['AttachFile']

Debian Anti-Spam Anti-Virus Gateway Email Server

http://lucasmanual.com/mywiki/DebianAntiSpamGatewayEmailServer

Fax Server

http://lucasmanual.com/mywiki/FaxServer

Network Time Synchronization

Network Time Protocol

date

apt-get install ntpdate

/etc/init.d/ntp-server stop
ntpdate clock.fmt.he.net
ntpdate ntp1.tummy.com
/etc/init.d/ntp-server start

FTP Server

Install

apt-get update
apt-get 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

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

http://www.howtoforge.com/debian_etch_vmware_server_howto

Kernel Upgrade

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

Debian Printing

http://lucasmanual.com/mywiki/DebianPrinting

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

#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

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

apt-cache search svn
apt-get 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

* 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

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

apt-get update
apt-get install xine-ui

apt-get install w32codecs

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

apt-get update
apt-get 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

Or KDE Display Manager

/etc/init.d/kdm stop

Or X Display Manager

/etc/init.d/xdm stop

modprobe -r radeon

modprobe fglrx

/etc/init.d/gdm start

glxinfo | grep direct

xvinfo

Mount Windows Share

apt-get update
apt-get install smbfs

mkdir somefolder

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

lspci -v

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

Raid 1 Setup

http://lucasmanual.com/mywiki/DebianRAID

Power Users

Sudo

apt-get update
apt-get 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

apt-get update
apt-get 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
}

/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

Debian User Configuration

Change default editor

apt-get update
apt-get install vim

update-alternatives --config editor

Flash player

Manually:

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

aptitude / apt-get

apt-get install flashplugin-nonfree

Via Synaptic (Gnome) / Adept (KDE):

Laptop and Debian

Intel ipw2200 wireless card

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

tar xzvf ipw2200-fw-3.0.tgz -C /lib/firmware
mv /lib/firware/ipw2200-fw-3.0/* /lib/firmware

uname -a

apt-get update
apt-get install ipw2200-modules-2.6.18-5-486
or
apt-get install ipw2200-modules-$(uname -r) 

iwconfig

Authenticate with wpa using PSK TKIP

* Install wpasupplicant

apt-get update
apt-get 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)

Intel Graphic card - Higher reolution

apt-get install 915resolution 

915resolution -l

sudo 915resolution 5c 1280 800 24

User Manuals

DVD9 to DVD5

http://lucasmanual.com/mywiki/DVD9toDVD5

DVD9 to AVI

http://lucasmanual.com/mywiki/DVD9toAVI

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

Photo and Image

* Digikam, for all your digital camera needs

apt-get update
apt-get install digikam

CD and DVD

* K3B, for burning cd/dvd.

apt-get update
apt-get install k3b

Players and Viewers

Flash

apt-get update
apt-get install flashplugin-nonfree