Oracle Linux: Difference between revisions
Line 204: | Line 204: | ||
</pre> | </pre> | ||
==Konfigureerimine== | ==Konfigureerimine== | ||
* Kuna lokaalne server vastab alati aadressil 127.0.0.1 siis lisa /etc/hosts faili read: | |||
<pre> | |||
127.0.0.1 www.students.ee | |||
127.0.0.1 students.ee | |||
</pre> | |||
* Konfiguratsiooni fail on httpd.conf | * Konfiguratsiooni fail on httpd.conf | ||
<pre> | <pre> | ||
Line 217: | Line 222: | ||
CustomLog logs/students.ee-access_log common | CustomLog logs/students.ee-access_log common | ||
</VirtualHost> | </VirtualHost> | ||
</pre> | |||
* Loo kataloog, mis me panime DocumentRoot(httpd.conf) ning loo üks lihtne fail(index.html) | |||
<pre> | |||
mkdir /var/www/students.ee | |||
touch /var/www/students.ee/index.html | |||
</pre> | </pre> | ||
Revision as of 04:47, 11 January 2013
Autorid
- Dmitri Keler
- Jevgeni Pogodin
Oracle Linux paigaldamine
Virtuaalmasina valmistamine
- RAM 512MB
- HDD 12GB Dynamic
- 2 Võrgukaarti
- eth0 - NAT (lubab Interneti pääseda)
- eth1 - Host only (ühendamine teise virtuaalmasinaga)
Installeerimine
Juhendis kasutatakse Oracle Linux Server 6.3. Allalaadimise link on siin: http://www.oracle.com/technetwork/server-storage/vm/downloads/index.html (seal on vaja registreerida)
Installerimine käigus:
1. Buutides isolt vali "Install an existing system"
2. Aknas "testing the media" , vajutage skip
3. Vali keel ja klaviatuuri layout
4. Vali time zone
5. Sisesta root kasutaja parooli
6. Partitsiooni muutmine
7. Peale partitsiooni muutmine, automaatselt tuleb package installimine
8. Installerimine lõpeb, süsteemi reboot
Võrgukaartide seadistamine
On vaja muuda 2 faili:
1. /etc/sysconfig/network-scripts/ifcfg-eth0 - NAT
2. /etc/sysconfig/network-scripts/ifcfg-eth1 - Host Only
eth0 konfigureerimine:
vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0" BOOTPROTO="dhcp" HWADD="08:00:27:9E:F4:FC" NM_CONTROLLED="yes" ONBOOT="yes" TYPE="Ethernet" UUID="441d9faa-078f-405d-9f30-45849ca8c8f4"
eth1 konfigureerimine:
vi /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE="eth1" BOOTPROTO="static" HWADDR="08:00:27:22:BB:1D" NM_CONTROLLED="yes" ONBOOT="yes" IPADDR=192.168.56.205 NETMASK=255.255.255.0 TYPE="Ethernet" UUID="f477120f-5ebf-46c3-90db-fa58d05ab02c"
Lõpuks tuleb võrgu restarti teha:
service network restart
DNS (bind9)
Paigaldamine
Paigaldatakse DNS serveri käsuga
yum install bind bind-utils
Konfigureerimine
- Muuda 'options' osa named.conf failis
vi /etc/named.conf
Muuda seal read listen-on port 53, sisesta 'any'; allow-query, sisesta 'any'; lisa rea allow-query-cache { any; }, listen-on ipv6 saab ära kustutada
options { listen-on port 53 { any; }; directory "/var/named"; dump-file "/var/named/data/cache_dump.db"; statistics-file "/var/named/data/named_stats.txt"; memstatistics-file "/var/named/data/named_mem_stats.txt"; allow-query { any; }; allow-query-cache { any; }; dnssec-enable yes; dnssec-validation yes; dnssec-lookaside auto; /* Path to ISC DLV key */ bindkeys-file "/etc/named.iscdlv.key"; managed-keys-directory "/var/named/dynamic"; };
- Lisa faili named.conf lõppus enda teenindatavad domeeni tsoonid
vi /etc/named.conf
Teenindatavad domeeni tsoonid
zone "students.ee" IN { type master; file "/var/named/students.ee"; }; zone "56.168.192.in-addr.arpa." IN { type master; file "/var/named/56.168.192.in-addr.arpa"; };
Ärge unustage tsooni kirjete failide omavaks gruppiks panna named käsuga
chgrp named failinimi
- Tsoonide kirjeldused
Tsoonide failid asuvad
/var/named kaustas
Iga tsooni kohta loo 2 faili, kirjete fail ja reverse fail
Tsooni fail nimega students.ee näeb välja järgnev:
vi /var/named/students.ee
$TTL 3H @ IN SOA ns.students.ee. root.students.ee. ( 11 ; serial 1D ; refresh 1H ; retry 1W ; expire 3H ) ; minimum ;NS students.ee. IN NS ns.students.ee. ;HOSTS ns IN A 192.168.56.205 www.students.ee. IN CNAME students.ee. students.ee. IN A 192.168.56.205 students.ee. IN MX 10 mail.students.ee. mail.students.ee. IN A 192.168.56.206
Reverse tsooni fail nimega 56.168.192.in-addr.arpa näeb välja järgnev:
vi /var/named/56.168.192.in-addr.arpa
$TTL 3H @ IN SOA ns.students.ee. root.students.ee. ( 9 ; serial 1D ; refresh 1H ; retry 1W ; expire 3H ) ; minimum ; 205 IN PTR ns.students.ee. 206 IN PTR mail.students.ee.
- Nüüd tuleks BIND9 teenus taaskäivitada järgmise käsuga:
service named restart
Testimine
- Kontrollime, kas kõik tsoonide failid on OK
named-checkzone students.ee /var/named/students.ee named-checkzone 56.168.192.in-addr.arpa /var/named/56.168.192.in-addr.arpa
- Kasutame dig ja nslookup, et kontrollida kas nimeserver vastab päringutele õigesti.
dig ns.students.ee
nslookup students.ee
Apache 2
Paigaldamine
- Paigaldatakse Apache käsuga:
yum install httpd
Konfigureerimine
- Kuna lokaalne server vastab alati aadressil 127.0.0.1 siis lisa /etc/hosts faili read:
127.0.0.1 www.students.ee 127.0.0.1 students.ee
- Konfiguratsiooni fail on httpd.conf
vi /etc/httpd/conf/httpd.conf
Selle faili lisa alla oma konfiguratsioon, näiteks:
<VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www/students.ee ServerName students.ee ErrorLog logs/students.ee-error_log CustomLog logs/students.ee-access_log common </VirtualHost>
- Loo kataloog, mis me panime DocumentRoot(httpd.conf) ning loo üks lihtne fail(index.html)
mkdir /var/www/students.ee touch /var/www/students.ee/index.html