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

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

Contents

  1. Debian Services
    1. FTP Server
    2. VMware Server On Debian
  2. Debian Configuration
    1. Change from dhcp to static ip
    2. Subversion
    3. Mount Windows Share
    4. Add a network card
    5. Power Users
    6. AWStats on Debian
    7. unixODBC
    8. Apt Preferences
  3. Debian User Configuration
    1. Change default editor
    2. Change default pdf viewer
    3. Check installed browser plugins
  4. Laptop and Debian
    1. Authenticate with wpa using PSK TKIP
    2. Intel Graphic card - Higher resolution
  5. Troubleshooting
    1. SSH terminal connection timeout
    2. Dynamic MMap ran out of room
  6. Useful Debian Programs
    1. Digital Camera
    2. Players and Viewers
    3. How to Remote connect to Windows

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

Debian Services

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

VMware Server On Debian

  • A 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:

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 Configuration

Change from dhcp to static ip

  • edit /etc/network/interfaces
  • comment the line that says "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
[tab]dns-nameservers 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
 dns-nameservers 192.168.1.1 
 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
 dns-nameservers 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.

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 privileges ("su root" or "sudo")

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

  • See if your card is in a list.

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

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

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 the 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

apt update
apt install awstats
  • Configure the apache2 for awstats - copy configuration file for apache2.

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

LogFile="/var/log/apache2/access.log"
SiteDomain="mysite.org"
LogFormat=1
  • Enable awstats and reload apache

a2enconf awstats
service apache2 restart
  • Generate stats

awstats -update 
  • 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-available/awstats.conf 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]
  • OR If you are using mssql with multiple instances and dynamic port allocation you can use the following:

[SQLServer2008]
Description = Production Server
Driver = TDS
Trace = No
Server = servername\instance_name
TDS_Version = 8.0
  • 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.

Apt Preferences

vi /etc/apt/preferences
  • And inside put these lines. Change the Pin-Priority to reflect your default install.
  • If you are using Debian testing make sure testing has the bigger number.
  • This file will install only from the highest pin but it will show you if the package is available in testing or unstable

Package: *
Pin: release a=stable
Pin-Priority: 600
Package: *
Pin: release a=testing
Pin-Priority: 450
Package: *
Pin: release a=unstable
Pin-Priority: 400
  • Now add testing and unstable to /etc/apt/source.list by coping and paste deb and deb-src lines and change stable to testing, and then again stable to unstable.

  • Update list

aptitude update

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.

Check installed browser plugins

  • Input "about:plugins" into URL of browser

Laptop and Debian

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-psk thisismypassword
  • 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 page for status on wpa support in Debian)

Intel Graphic card - Higher resolution

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

  • 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

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

Useful Debian Programs

Digital Camera

* Digikam, for all your digital camera needs

aptitude update
aptitude install digikam

Players and Viewers

How to Remote connect to Windows

  • You can connect to Microsoft Windows Remote Connection via rdesktop
  • Install rdesktop

aptitude update
aptitude install rdesktop
  • Then you can start rdesktop or from a command line

rdesktop ip.add.re.ss

or

rdesktop remoteconnection.example.com


AltStyle によって変換されたページ (->オリジナル) /