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

Come installare e configurare vario software in Debian. Istruzioni passo-passo.

Parole chiave: Debian GNU Linux, Manuale, How To, How-To, howto, Installazione, Configurazione, Facile, Da Windows XP a Debian, Wireless WPA2, anti-spam, fax, Documentazione, MoinMoin Wiki, Linux, server, Windows, Windows NT, ?HowTo, vmware, vmwaretools, vmware tools, vm, tool, AMD64, 64 bit

Servizi Debian

Server FTP

Installazione

aptitude update
aptitude install vsftpd

Configurazione

vi /etc/vsftpd.conf

anonymous_enable=NO

write_enable=YES

ftpd_banner=Benvenuti nel servizio FTP di example.com. Buon divertimento.

local_enable=YES

Server per album fotografici

Installazione

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

Configurare

Alias /gallery2 /usr/share/gallery2

* Ora avviare o riavviare il server apache

/etc/init.d/apache2 restart

Configurazione di Gallery2

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;

Componenti di Gallery2

apt-get install imagemagick

Alias /photos /usr/share/gallery2

Gestione delle fotografie

Server VMware in Debian

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

Aggiornare al kernel VMware

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

VMware su 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

Configurazione di Debian

Cambiare da un IP DHCP a uno statico

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/mario/mio_progetto_bellissimo

/home/mario/mio_progetto_bellissimo/trunk/install.c
/home/mario/mio_progetto_bellissimo/trunk/readme.txt

/usr/local/src/

svnadmin create /usr/local/src/mio_progetto_bellissimo

svn import /home/mario/mio_progetto_bellissimo file:///usr/local/src/mio_progetto_bellissimo -m "importazione iniziale"

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

/home/mario/nuova_directory/mio_progetto_bellissimo

svn co svn+ssh://proprio.server-remoto.com/usr/local/src/mio_progetto_bellissimo

Driver binario Ati

Istruzioni prese a prestito dal blog di Michael Schurter. Suggerimenti presi a prestito dal Wiki di Gentoo.

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

Montare condivisioni Windows

aptitude update
aptitude install smbfs

mkdir una_directory

mount -t smbfs -o username=administrator,password=password
//nomeserverwindows/cartella /home/mario/una_directory

Se non si desidera che la password appaia nel comando, si può usare

mount -t smbfs -o username=administrator //nomeserverwindows/cartella /home/mario/una_directory

[Opzionale] Si può sostituire ad administrator il proprio nome utente; si può anche sostituire nomeserverwindows con l'indirizzo IP //192.168.1.10/cartella ...

Aggiungere una scheda di rete

lspci -v

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

Utenti privilegiati

Sudo

aptitude update
aptitude install sudo

visudo

proprionomeutente    ALL=(ALL) ALL

Disabilitare accesso root via ssh

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 in 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="miosito.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.miosito.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.primo.sito.com.conf -update
                /usr/lib/cgi-bin/awstats.pl -config=awstats.www.secondo.sito.conf -update
                /usr/lib/cgi-bin/awstats.pl -config=awstats.www.terzo.sito.conf -update
                /etc/init.d/apache2 reload > /dev/null
        endscript
}

/etc/init.d/apache2 reload

http://localhost/cgi-bin/awstats.pl?config=awstat.conf o http://www.miosito.com/cgi-bin/awstats.pl?config=awstat.conf [Opzionale]

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

http://www.miosito.com/logs

unixODBC

aptitude update
aptitude install tdsodbc unixodbc

vi /etc/freetds/tds.driver.template

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

vi /etc/freetds/tds.dsn.template

[DSN_NAME]
Description     = Descrizione della propria connessione DSN.
Driver          = TDS
Trace           = No
Database        = DefaultDatabase [sostuire con il nome del proprio database]
Server          = mioserversql.inter.net [sostituire con l'host/IP del proprio server SQL]
Port            = 1433 [sostituire con la porta su cui è in ascolto SQL]

[SQLServer2008]
Description     = Server di Produzione
Driver          = TDS
Trace           = No
Server          = nomeserver\nome_istanza
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 nomeutente password

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

Risoluzione dei problemi

telnet mioserver 1433

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

Se la connessione viene ancora rifiutata, provare telnet da Windows e vedere se si ottiene sempre la stessa risposta.

Preferenze di Apt

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

Configurazione utente in Debian

Cambiare l'editor predefinito

aptitude update
aptitude install vim

update-alternatives --config editor

Cambiare il visualizzatore di PDF predefinito

Controllare i plugin per il browser installati

Java Runtime Enviroment (JRE) AMD64

cd /usr/local/src/
mkdir JREx64
cd JREx64
#mettere il file qui
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

Debian e i portatili

Autenticazione con wpa usando PSK TKIP

aptitude update
aptitude install wpasupplicant

vi /etc/network/interfaces

iface eth2 inet dhcp
wpa-ssid mionomedirete
wpa-psk miapassword

ifup eth2

auto eth2

Scheda grafica Intel - risoluzione più elevata

<!> Non necessario per Debian Lenny e rilasci successivi. Il supporto è incluso in xserver-xorg-video-intel.

aptitude install 915resolution

915resolution -l

sudo 915resolution 5c 1280 800 24

Risoluzione dei problemi

Timeout della connessione di terminale SSH

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

ClientAliveInterval 150

Errore "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

Programmi Debian utili

Fotocamere digitali

* Digikam, per tutte le necessità correlate alle fotocamere

aptitude update
aptitude install digikam

Riproduttori e visualizzatori

Flash

aptitude update
aptitude install flashplugin-nonfree

Come connettersi a Windows da remoto

aptitude update
aptitude install rdesktop

rdesktop ip.add.re.ss

oppure

rdesktop remoteconnection.example.com