Translation(s): English,Français,Dutch,Deutsch,简体中文

(!) ?/Discussion


如何在Debian上安装各种软件。一步一步来。

关键词: Debian GNU Linux, 手册, How To, How-To,howto, 安装,配置,容易,由Windows XP到Debian,无线WPA2, 反垃圾邮件, 传真, MoinMoin Wiki, Linux, 服务器,Windows, Windows NT, 文档, HowTo, vmware, vmwaretools, vmware 工具, vm, 工具, AMD64, 64 位

Debian 服务器

FTP 服务器

安装

aptitude update
aptitude install vsftpd

配置

vi /etc/vsftpd.conf

anonymous_enable=NO

write_enable=YES

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

local_enable=YES

相册服务器

安装

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

配置

Alias /gallery2 /usr/share/gallery2

*现在重启或启动您的 apache 服务器

/etc/init.d/apache2 restart

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;

Gallery2组件

apt-get install imagemagick

Alias /photos /usr/share/gallery2

管理相片

== Debian 上的 VMware 服务器==

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

* 查看 VMware 文章。

VMware 内核升级

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 配置

由 dhcp 更改为静态 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
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

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

Ati 二进制驱动

Michael Schurter's blog 搬运过来的。相关技巧取自 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

或 KDE 显示管理器

/etc/init.d/kdm stop

或 X 显示管理器

/etc/init.d/xdm stop

modprobe -r radeon

modprobe fglrx

/etc/init.d/gdm start

glxinfo | grep direct

xvinfo

挂载Windows共享

aptitude update
aptitude install smbfs

mkdir somefolder

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

如果你不希望出现密码输入提示,你可以输入

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

[可选] 你可以用你的用户名替换掉管理员帐户。你也可以用ip地址//192.168.1.10/folder替换掉windowsservername……

添加网卡

lspci -v

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

Raid 1 设置

http://lucasmanual.com/mywiki/DebianRAID

Power Users

Sudo

aptitude update
aptitude install sudo

visudo

yourusername    ALL=(ALL) ALL

禁用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

Debian上的 AWStats

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
}

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

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

Apt Preferences

vi /etc/apt/preferances

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

更改默认编辑器

aptitude update
aptitude install vim

update-alternatives --config editor

更改默认pdf查看器

查看已安装的浏览器插件

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

用PSK TKIP进行wpa验证

* 安装wpasupplicant

aptitude update
aptitude install wpasupplicant

* 打开/etc/network/interfaces

vi /etc/network/interfaces

*如果你看到了"iface eth2..." ,将以下字段添加到下面,但要更改ssid和password:

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

*退出,然后输入:

ifup eth2

*完成了。如果你希望每次你的电脑启动时无线网卡就连接到因特网上,请在"iface eth2.."上面添加

auto eth2

*完成了。[可选](see the WPA page for status on wpa support in debian)

Intel显卡-更高的分辨率

<!> DebianLenny 及以后的发行版不需要。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

Digital Camera

* Digikam, for all your digital camera needs

aptitude update
aptitude install digikam

播放器和查看器

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