The Perfect Server - Ubuntu Hardy Heron (Ubuntu 8.04 LTS Server) časť 3
4 Sprístupnenie rootovského účtu
Po reštarte sa
môžete prihlásiť s vaším predchadzajúco vytvoreným
učtom(pr. Administrator). Pretože musíme spúštať všetky
kroky z tohto tutoriálu ako root uživateľ, musíme teraz
spristupniť root účet
spustte
sudo passwd root
a nastavte heslo pre
root. Potom sa staneme rootom spustenímsu
5 Nainštalovanie SSH servru(voliteľné)
Ak ste
nenainštalovali OpenSSH server počas systemovej inštalácie,
môžete to urobiť teraz:
apt-get install ssh openssh-server
Odteraz môžete
používať SSH klient ako napríklad PuTTY
a pripojiť sa z vašej pracovnej stanice k vášmu Ubuntu 8.04
LTS servru a pokračovať nasledovné kroky v tomto tutoriálu.
|
6 Inštalácia vim-full (voliteľné)
Budem použivať vi ako
môj textový editor v tomto tutoriali
(Nebudete to musieť robiť pokiaľ budete používať
iný textový editor ako napríklad joe alebo nano)
7 Nastavenie siete
Pretože inštalátor Ubuntu nastavil nastavenie
našej siete cez DHCP, musíme to zmeniť, pretože server môže mať
statickú IP adresu. Editujte /etc/network/interfaces a
prispôsobte k vaším potrebám(v tomto prípade použijem IP adresu
192.168.0.100)
vi /etc/network/interfaces
# This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). # The loopback network interface auto lo iface lo inet loopback # The primary network interface auto eth0 iface eth0 inet static address 192.168.0.100 netmask 255.255.255.0 network 192.168.0.0 broadcast 192.168.0.255 gateway 192.168.0.1
|
Potom reštartujte vašu sieť:
/etc/init.d/networking restart
Potom editujte /etc/hosts. Nech to vyzerá
približne takto:
vi /etc/hosts
127.0.0.1 localhost.localdomain localhost 192.168.0.100 server1.example.com server1 # The following lines are desirable for IPv6 capable hosts ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters ff02::3 ip6-allhosts
|
Teraz spusťe
echo server1.example.com >
/etc/hostname
/etc/init.d/hostname.sh start
Potom spusťte
hostname
hostname -f
Ibidva teraz ukážu server1.example.com
8 Editujte /etc/apt/sources.list a aktualizujte váš
linux
Editujte /etc/apt/sources.list. Odkomentujte alebo
vymažte inštalačne CD so súboru a ujasnite si, že universe
a multiverse záložiska su aktivované. Malo by to vyzerať
takto:
vi /etc/apt/sources.list
# # deb cdrom:[Ubuntu-Server 8.04 _Hardy Heron_ - Release i386 (20080423.2)]/ hardy main restricted #deb cdrom:[Ubuntu-Server 8.04 _Hardy Heron_ - Release i386 (20080423.2)]/ hardy main restricted # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to # newer versions of the distribution. deb http://de.archive.ubuntu.com/ubuntu/ hardy main restricted deb-src http://de.archive.ubuntu.com/ubuntu/ hardy main restricted ## Major bug fix updates produced after the final release of the ## distribution. deb http://de.archive.ubuntu.com/ubuntu/ hardy-updates main restricted deb-src http://de.archive.ubuntu.com/ubuntu/ hardy-updates main restricted ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team, and may not be under a free licence. Please satisfy yourself as to ## your rights to use the software. Also, please note that software in ## universe WILL NOT receive any review or updates from the Ubuntu security ## team. deb http://de.archive.ubuntu.com/ubuntu/ hardy universe deb-src http://de.archive.ubuntu.com/ubuntu/ hardy universe deb http://de.archive.ubuntu.com/ubuntu/ hardy-updates universe deb-src http://de.archive.ubuntu.com/ubuntu/ hardy-updates universe ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team, and may not be under a free licence. Please satisfy yourself as to ## your rights to use the software. Also, please note that software in ## multiverse WILL NOT receive any review or updates from the Ubuntu ## security team. deb http://de.archive.ubuntu.com/ubuntu/ hardy multiverse deb-src http://de.archive.ubuntu.com/ubuntu/ hardy multiverse deb http://de.archive.ubuntu.com/ubuntu/ hardy-updates multiverse deb-src http://de.archive.ubuntu.com/ubuntu/ hardy-updates multiverse ## Uncomment the following two lines to add software from the 'backports' ## repository. ## N.B. software from this repository may not have been tested as ## extensively as that contained in the main release, although it includes ## newer versions of some applications which may provide useful features. ## Also, please note that software in backports WILL NOT receive any review ## or updates from the Ubuntu security team. # deb http://de.archive.ubuntu.com/ubuntu/ hardy-backports main restricted universe multiverse # deb-src http://de.archive.ubuntu.com/ubuntu/ hardy-backports main restricted universe multiverse ## Uncomment the following two lines to add software from Canonical's ## 'partner' repository. This software is not part of Ubuntu, but is ## offered by Canonical and the respective vendors as a service to Ubuntu ## users. # deb http://archive.canonical.com/ubuntu hardy partner # deb-src http://archive.canonical.com/ubuntu hardy partner deb http://security.ubuntu.com/ubuntu hardy-security main restricted deb-src http://security.ubuntu.com/ubuntu hardy-security main restricted deb http://security.ubuntu.com/ubuntu hardy-security universe deb-src http://security.ubuntu.com/ubuntu hardy-security universe deb http://security.ubuntu.com/ubuntu hardy-security multiverse deb-src http://security.ubuntu.com/ubuntu hardy-security multiverse
|
apt-get update
aktualizuje sa apt databáza balíčkov
apt-get upgrade
na nainštalovanie posledných aktualizácií (ak sú
nejaké).
9 Zmeňte prednastavený Shell
/bin/sh je symbolický link k /bin/dash,
ale my potrebujeme /bin/bash, nie /bin/dash. Preto
urobíme toto:
ln -sf /bin/bash /bin/sh
Ak to neurobíme, ISPConfig inštalácia spadne.
10 Vypnutie AppArmor
AppArmor je ochranné rozšírenie(podobne k
SELinux), ktoré ponúka väčšiu ochranu.Podľa mňa to
nepotrebujete na to aby ste nakonfigurovali bezpečný systém a
väčšinou to prináša viacej problémov ako výhod(pomyslite na to
keď máte problem nejaký ten týžden, pretože určité služby
nejdu a nakoniec zistite, že všetko bolo v poriadku a práve
AppArmor spôsoboval problém). Preto som ho vypol(toto musite urobiť
ak chcete neskôr inštalovať ISPConfig)
Vypnúť ho môžeme takto:
/etc/init.d/apparmor stop
update-rc.d -f apparmor
remove
Till mi povedal, že taktiež musel urobiť tento
krok(ktorý nebol potrebný pre moju inštaláciu), tak ak si chcete
byť istý, urobte to taktiež na svojom systéme:
apt-get remove apparmor apparmor-utils