Ik weet niet zo snel te vinden waar je de volgende HOW TO kunt vinden maar als je deze aanhoudt kom je al een heel eind met je Debian servertje.
===================================
Installation
back-up
Partitioning the hard disk drive and formatting partitions may result in loss of data. You are responsible for creating good back-ups of all important data on any disk drives that are in the system you're about to install Debian to.
booting
Insert the CD and make sure booting from CD is enabled in the BIOS of your computer. When the computer boots the installer will load and you will be shown a boot-prompt. Type "bf24"<Enter> to boot with the 2.4 kernel. Next is language selection. This documentation is based on English, but you can install in a different language if you want to. Select the language you prefer and press <Enter>. Press <Enter> again for US English.
Configuring the keyboard
Configure the keyboard to suit your needs. If you don't know what to choose try the default options by pressing <Enter>.
Partitioning the hard disk
It's very important that you partition you hard disk correctly. What partition information is displayed in cfdisk depends on how you have used the hard disk before. If the disk is new/empty you will not see any entries. In my case I want to install Debian on a computer next to Windows XP in a multi boot configuration. If you want to make a multi boot system, install Windows first. For your Windows partition use the amount of disk space you think you will require for Windows but make sure you leave enough space for Debian! 2GB should do, but the more the better :-)
We need to create a swap partion first. The swap partition should be two times the size of RAM you have in your computer. To partition empty space on the hard disk select the "Free Space" with the <up> and <down> cursor keys. Choose "New" from the menu with the <left> and <right> cursor keys. Press <Enter> and choose "Primary". My test box has 256MB RAM so I want my swap partition to be 512MB. Enter the correct value for your setup at the "Size" prompt. Choose "Beginning" to create the partition where the free space starts. Next we must change the file system type. Choose "Type" from the menu and press a key. Type "82" for "Linux Swap".
The second partition Debian needs is a root partition. Select "Free Space" again and choose "New" from the menu. This is also a "Primary" partition. The root partition will be used for applications, help files, etc. 512 MB should be enough but I will use 768 to be sure. Choose "beginning" and make this partition bootable (with the Linux root partition selected in the list, choose "Bootable" from the menu, the flag "Boot" will be shown in the list).
A third and last partition will be used for the "/home" folder. Select "Free Space", choose "New", choose "primary" and press <Enter> to use all remaining space.
To save the changes made to the partition table select "Write" from the menu. Type "yes"<Enter> to confirm. Choose "Quit" to leave cfdisk. Once you are back to the installer you can continue the next couple of steps with the default options (just press <Enter>). In my setup /dev/hda2 will be used as swap partition and /dev/hda3 as root filesystem. The installer can automatically mount this partition. To mount the third Linux partition (/dev/hda4) you must select "Initialize a Linux Partition" after you've mounted the root partition (second option from the list, after "Install Kernel and Driver Modules"). You can use the default options again, except for the mount point where you must select "/home".
Install kernel and driver modules
We want to use the CD-ROM for these modules, choose "Yes" at the "Found Debian CD-ROM" prompt.
Configure device driver modules
Selecting the device driver modules can be a bit tricky because you must install the correct drivers for your hardware at this point. Most important are the drivers for your network interface card (NIC) and your SCSI controller card, if you have any. You can find the network card drivers in "kernel/drivers/net". I'm using a 3Com 3C905 NIC, so I must install the "3c59x - 3c590/3c900 series" drivers. If your NIC isn't listed you can try to use the "ne" driver, since most NICs are NE2000 compatible. In most cases you can leave the command line parameters empty and go for the default settings.
If you are planning on installing Samba Windows Filesharing at a later point it is probably a good idea to install the Samba drivers in the kernel. These are in "kernel/fs/smbfs". I will add them at this point because I might need network access from my Windows workstation when working on the websites that will be on this server.
Those who have the need for a software firewall must also install "ip_tables" in "kernel/net/ipv4/netfilter".
Configure the network
First in the line of questions is your computer's hostname. This is generally just the name you want to give your computer. If your Internet Provider has given you a sub domain (like seth.megaman.nl) you can use that as a hostname (just type the first part, "seth" in my case). The rest (megaman.nl) is the domain name.
Most people use static IP addresses for there servers. Choose "No" at the Automatic Network Configuration question.
The IP address and netmask settings depend on the setup of your Local Area Network (LAN). In my test setup I have a Windows client with the IP address 10.0.0.1 so I want to give this Debian system an IP address of 10.0.0.2. The netmask for both computers is 255.255.255.0. 10.x.x.x is a private range. You may use any valid IP address in this range, but you can't connect it directly to the internet (without a modem, router or some sort of NAT device) and expect it to work.
The gateway address is the IP address of the machine/router that will allow your Debian computer to connect to the internet. I am on an ADSL connection through a Multi-PC router/modem. The internal IP address of this device is 10.0.0.138, so this will be my "gateway".
If you have your own domain name you can specify it in the next step. If you used your ISP sub domain as a hostname, you can use your ISP's domain name here. I will use "megaman.nl" as my domain name.
Next are your name servers (DNS servers). Specify your ISP's DNS server addresses here. If you don't know these, contact your internet provider.
Install the base system
After selecting "Install the Base System" the installation program will start copying files.
Make system bootable
We will install LILO (Linux Loader) into the Master Boot Record (MBR) of the hard disk.
If you already have Windows installed on another partition on the same system, like I have, you will be asked what you want to do with the other operating system(s). In a multi-boot setup the "Include" option must be used.
Make a boot floppy
You are advised to create a boot floppy at this point. Just follow the instructions.
Reboot the system
Be sure to remove the CD and floppy from there drives before rebooting. And select "Yes" to reboot.
Basic configuration
With a default LILO configuration, Linux will automatically be started unless you choose another option within 15 seconds.
When Linux is loaded you will see the welcome screen. Linux is successfully installed at this point, but you must still do some configuration like setting up passwords and user accounts.
Time zone configuration
The first thing that will be asked to you is whether or not you hardware clock is set to GMT. Most Unix systems have there hardware clocks set to GMT. Windows computers however generally use the local timezone. My system also has Windows installed so I will answer "No" to this question. Then, choose the area you're in (Europe in my case) and select the right city or time zone (Amsterdam for me).
Password setup
For higher security we will enable "MD5 passwords" as well as "shadow passwords".
You can type any password for the root user. It's not recommended that you choose a name of someone you know. A secure password is eight characters long and is composed of numbers, small letters and capital letters.
You will be advised that you create a normal user account. You may use any username and any password for this account. Remember that this user doesn't, by default, have all access rights the root user has.
PCMCIA
If your system doesn't have any PCMCIA devices the installer will ask you if it can remove the package. Choose "Yes" to remove it.
PPP connection
Since my Debian computer connects to the internet through a gateway I don't need to set up PPP. I will answer "No" to this question.
Apt configuration
In order to retrieve the latest updates and download all packages you will have to choose "ftp" from the list of Apt Sources. Make sure you choose "Yes" for the next couple of options so that all sources are loaded (including non-free).
You can select a server near you. I will use Germany ->
ftp.de.debian.org because I've found this to be a very reliable and up-to-date server. After choosing your server Apt will attempt to connect to it to obtain the latest lists of packages. If these lists are downloaded you have successfully installed and configured your network. If something goes wrong at this point you might need to use another driver for your NIC and/or check your cables etc.
We won't be adding any other sources, so choose "No" for this question.
Choose "Yes" for the Security Updates question.
We will install more applications later so we won't run "tasksel" nor "dselect", choose "No" for both options.
Hit <Enter> to remove the PCMCIA package if you selected to remove them a few minutes ago.
Debian will automatically download important security updates.
You can hit <Enter> to remove any previously downloaded .deb files.
Mail system configuration
Skip the mail system setup with option <5>. Another mailer will be installed later on.
Installation and setup is now completed and you can finally log onto the system with username "root" and the password you specified before!
Applying the latest updates
The Apt program allows you to easily install software and updates as they become available.
Make sure you are logged in as root and issue the following commands to update all installed packages:
apt-get update
apt-get upgrade
You can update your system at any time.
Directories on your Linux system
/etc Program settings
/home User home folders and website data
/var Log files, email, etc.
/usr Program installation
/boot The kernel
/dev Devices like floppy drive, CD-ROM drive, etc.
/root Root user's home folder
/mnt Used for mount points
/lib Program libraries
/bin and /sbin Links to executables
/tmp Temporary files
Basic commands
whoami Shows the name of the user that is currently logged into the system
w Show who is doing what from where
reboot Reboot computer; you can also use <Ctrl> + <Alt> + <Del>
halt Shut down your computer
su Switch user; use "su -" to switch to root user
top Show summary of running processes and memory usage
ps aux Show a list of all processes; use |grep [string] to show only entries that contain "string"
kill <process id> Kill process with specified id
killall -9 <name> Kills all processe with specified "name"
mount <device> <target> Mount a filsystem
mount -a Mount everything in /etc/fstab
ls Lists directory contents; use "ls -al" to see file details
cd <folder> Change working directory to "folder"; use <Tab> to complete directory and filenames
pwd Print Working Directory
more <filename> Shows contents of "filename" (for viewing plain text files)
cp <source> <target> Copy specified file(s); use "cp -R <folder>" to copy entire folder
mv <source> <target> Move specified file(s); use "mv -R <folder>" to move entire folder
rm <filename> Deletes "filename"; use "rm -R <folder>" to delete entire folder
du -h Show size of directories and files in current working directory
dpkg -i <filename> Install a .deb file
tar -xf foo.tar Unpack a .tar file
tar -xzf foo.tar.gz Unpack a .tar.gz file
bzip2 -d <filename> Unpack a .bz2 file
find / -name 'mysql*.*' Search for files beginning with "mysql"
find * |grep string Search for files containing "string"
whereis <program> Shows the directory or directories the specified program uses, if nothing shows up the program is most likely not installed
date Show or set system date and time
cal Show calendar; use "ncal" for different lay-out
mail check and read your email
<command> --help Shows show description and parameters for "command"
man <command> Shows full manual for "command"
cfdisk Shows information for partitions on your hard disk(s) and allows you to modify them; similar to fdisk under DOS
ifconfig Shows TCP/IP settings; similar to Windows NT/2k/XP ipconfig
If you work from the console very often, you might want to have a look at the ".bashrc" file:
mcedit ~/.bashrc
This file can contain various user settings. I.e. if you want to turn off the power save feature of your monitor you can add this line to the file:
setterm -blank
To turn on Num Lock by default use:
setleds +num
You can also map aliasses to certain commands. For instance, if you use "ls -al" a lot you can map "l" to this command:
alias l='ls -al'
You must log out and back in once to apply the changes. After that you can type only "l" and you will be shown the same file list as with the "ls -al" command.
Installing applications
The Apt program in Debian lets you install client applications and server software. It is really easy to use. Applications installed with apt-get will all be updated with the "apt-get upgrade" command as updates become available. Here's a list with the most important commands.
apt-setup Configure Apt-sources
apt-cache search <name> Look for package "name" in list of all available packages
apt-get install <name> Installs package "name"
apt-get remove <name> Remove package "name"
apt-get clean Remove old .deb files
apt-get update Update list of available packages
apt-get upgrade Update packages
apt-get -s -y -f upgrade Only show what packages can be updated
You can find the list of apt-sources here:
/etc/apt/sources.list
Client applications
Tree
apt-get install tree
Tree is a very small application that shows directory trees. Use "tree -d" to show only dirs, and not files.
Midnight Commander
apt-get install mc
The midnight commander is a two-pane file manager. You can use it to search for files and copy or move files or directories. It has a built-in FTP client and much more! It also includes a very good and easy to use plain text editor, mcedit. After installing you can start the application with "mc" and the editor with "mcedit [filename]".
lsof
apt-get install lsof
Lists open files. You can also check what ports are in use by what software.
bzip2
apt-get install bzip2
Uncompressor for .bz2 archives. Also allows you to browse these kind of archives with MC.
unzip
apt-get install unzip
Uncompressor for (Win)ZIP files.
Server applications
ssh
apt-get install ssh
Secure Shell can be used to open an encrypted telnet connection to your Debian server from any computer and any platform. During the installation you will be show a few questions. You can use the default options.
In order to connect to the server with SSH2 you will need an SSH2 client.
A good application for this is Secure NetTerm (shareware). You can download Secure NetTerm from
http://www.netterm.com/.
Another good client is PuTTY (freeware). Get PuTTY here:
http://www.chiark.greenend.org.uk/~sgtatham/putty/. Another program you can download from this website is "pscp" (PuTTY Secure Copy). You can use pscp to copy files between two different hosts (Windows and Linux) using the SSH protocol.
webmin
Webmin is a web-based administration interface for most Unix and Linux distributions. Debian is also supported. Webmin allows you to change settings of most server applications, manage users and groups, change TCP/IP settings and lots more. Webmin can also be installed with apt-get, but I have found it easier to install from the .tar.gz file, because it includes all modules (the Apt version does not). Before you begin installing you must have installed wget and you must have the link to the Webmin .tar.gz file. You can look for this link on the official Webmin site (
http://www.webmin.com/). To install webmin you can use these commands:
apt-get install libnet-ssleay-perl make libdigest-md5-perl (ssleay is required for secure connections; make and md5 are required when you want to change user passwords through Webmin)
cd /usr/local (go to correct folder)
wget <link to webmin-x.xxx.tar.gz> (download Webmin)
tar -xzf foo.tar.gz (unpack archive)
cd webmin-x.xxx (where x.xxx is version number)
./setup.sh (Run Webmin installation)
During the installation you should use the default options for directory locations. You can use any username and password. Answer "y" to the "Use SSL" and "Start Webmin at boot time" questions.
Once Webmin is fully installed you can open it by loading "https://<ipaddress>:10000" in your browser.
I personally prefer the "Default Webmin theme" because it is very fast. You can change this in "Webmin" -> "Webmin Configuration" -> "Webmin Themes".