É7 7 µ¦ ·· ´´Ê s seerrvveerr   nµ nµ ÇÇ - nectec · 2016. 5. 13. · Ä Å¢¨r...

32
7 7 Server Web Server Web Server rpm #rpm –q apache apache-1.3.20-16+SIS package apache not installed CD-ROM Linux Redhat, Linux SiS Linux rpm –I apache-1.3.20-16+SIS /etc/httpd/conf/httpd.conf ServerRoot "/etc/httpd" httpd Port 80 ( 80) User apache Group apache ServerAdmin root@localhost Email Address DocumentRoot"/data/httpd/htm" HTML DirectoryIndex index.html Linux - Linux for Teacher 65

Upload: others

Post on 09-Mar-2021

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: É7 7 µ¦ ·· ´´Ê S Seerrvveerr   nµ nµ ÇÇ - NECTEC · 2016. 5. 13. · Ä Å¢¨r /etc/named.config o° ¤¸ µ¦ ε® zone ¸Ê zone "school.ac.th" in { type master;

77 SSeerrvveerr

Web Server

Web Server rpm

#rpm –q apache apache-1.3.20-16+SIS

package apache not installed

CD-ROM

Linux Redhat, Linux SiS Linux

rpm –I apache-1.3.20-16+SIS

/etc/httpd/conf/httpd.conf

ServerRoot "/etc/httpd"

httpd

Port 80 ( 80)

User apache

Group apache

ServerAdmin root@localhost Email Address

DocumentRoot"/data/httpd/htm" HTML

DirectoryIndex index.html

Linux - Linux for Teacher 65

Page 2: É7 7 µ¦ ·· ´´Ê S Seerrvveerr   nµ nµ ÇÇ - NECTEC · 2016. 5. 13. · Ä Å¢¨r /etc/named.config o° ¤¸ µ¦ ε® zone ¸Ê zone "school.ac.th" in { type master;

Web Server

1. login root ( Super User ) command line

start httpd setup Enter System

Services Enter * httpd OK Enter

Server start httpd service

2. start httpd /etc/rc.d/init.d/httpd start Enter

OK

3. lynx IPAddress

Enter

lynx 10.0.0.100

Linux - Linux for Teacher 66

Page 3: É7 7 µ¦ ·· ´´Ê S Seerrvveerr   nµ nµ ÇÇ - NECTEC · 2016. 5. 13. · Ä Å¢¨r /etc/named.config o° ¤¸ µ¦ ε® zone ¸Ê zone "school.ac.th" in { type master;

4. ln -d -s /home/httpd/html /data/httpd/html Enter

link directory www

5. test adduser test Enter

test password

# passwd -d test Enter

( password

)

6. Homepage

# mkdir /home/test/m4-2 ( Enter )

5 ( home/ )

7. chmod 777 /home/test/m4-2 Enter

ftp Server 5

Linux - Linux for Teacher 67

Page 4: É7 7 µ¦ ·· ´´Ê S Seerrvveerr   nµ nµ ÇÇ - NECTEC · 2016. 5. 13. · Ä Å¢¨r /etc/named.config o° ¤¸ µ¦ ε® zone ¸Ê zone "school.ac.th" in { type master;

8. link directory test www

# ln -d -s /home/test/m4-2 /data/httpd/html /test ( Enter )

9. ftp ftp /home/test/m4-2

10. index.html /data/httpd/html

link

Homepage

<a href=/data/httpd/html /test/index.html>

DNS Server

TCP/IP IP Address

IP Address

DNS Domain Name Server

IP Address

hareluya.school.ac.th IP Address 10.0.0.1

Web, Telnet, Ftp hareluya.school.ac.th

IP Address (Domain

name)

school.ac.th

hareluya.school.ac.th williams.school.ac.th

Linux - Linux for Teacher 68

Page 5: É7 7 µ¦ ·· ´´Ê S Seerrvveerr   nµ nµ ÇÇ - NECTEC · 2016. 5. 13. · Ä Å¢¨r /etc/named.config o° ¤¸ µ¦ ε® zone ¸Ê zone "school.ac.th" in { type master;

DNS IP Address

IP Address

DNS

BIND Linux SIS , Redhat Linux

rpm

#rpm -q bind

bind-8.1.1-1

package bind is not installed

CD Linux sis RedHat

RedHat/RPMS bind-8.1.1-1.i386.rpm ( )

#rpm -i bind-8.1.1-1.i386.rpm

Error Message

DNS

/etc/named.conf

/etc/named.conf

options {

directory "/data/named";

};

Linux - Linux for Teacher 69

Page 6: É7 7 µ¦ ·· ´´Ê S Seerrvveerr   nµ nµ ÇÇ - NECTEC · 2016. 5. 13. · Ä Å¢¨r /etc/named.config o° ¤¸ µ¦ ε® zone ¸Ê zone "school.ac.th" in { type master;

zone "." {

type hint;

file "named.ca";

};

zone "localhost" in {

type master;

file "master/localhost";

};

zone "0.0.127.in-addr.arpa" in {

type master;

file "master/127.0.0";

};

zone "school.ac.th" in {

type master;

file "master/intranet";

};

zone "0.0.10.in-addr.arpa" in {

type master;

file "master/192.168.1";

};

2 options zone options

zone

zone 2 IP Address IP

Address IP Address

Linux - Linux for Teacher 70

Page 7: É7 7 µ¦ ·· ´´Ê S Seerrvveerr   nµ nµ ÇÇ - NECTEC · 2016. 5. 13. · Ä Å¢¨r /etc/named.config o° ¤¸ µ¦ ε® zone ¸Ê zone "school.ac.th" in { type master;

zone "school.bj.ac.th" IP Address IP

Address Reverse ".in-addr.arpa" IP

Address 10.0.0.X zone "0.0.10.in-addr.arpa"

zone (type) 3

hint

master DNS Primary DNS

slave DNS Secondary DNS Update

Primary DNS slave Update

Primary DNS masters

zone "williams.domain" in {

type slave;

masters{

10.0.0.1;

}

file "master/localhost";

};

file ( options)

school.bj.ac.th 3

hareluya.school.ac.th

williams.school.ac.th

someone.school.ac.th

/etc/named.config zone

zone "school.ac.th" in {

type master;

file "master/school.bj.ac.th"

}

Linux - Linux for Teacher 71

Page 8: É7 7 µ¦ ·· ´´Ê S Seerrvveerr   nµ nµ ÇÇ - NECTEC · 2016. 5. 13. · Ä Å¢¨r /etc/named.config o° ¤¸ µ¦ ε® zone ¸Ê zone "school.ac.th" in { type master;

/data/named/master/school.bj.ac.th

@ IN SOA hareluya.school.ac.th. root.hareluya.school.ac.th.(

200222101 ; Serial in yyyymmdd no_in_date

10800 ; Refresh 3 hours

3600 ; Retry 1 hour

3600000 ; Expire 1000 hours

86400 ) ; Minimum 24 hours

IN NS hareluya.school.ac.th

IN MX 10 hareluya.school.ac.th

IN MX 5 williams.school.ac.th

www IN CNAME hareluya

mail IN CNAME hareluya

ftp IN CNAME hareluya

hareluya IN A 10.0.0.1

williams IN A 10.0.0.2

someone IN A 10.0.0.3

NS (Name Server) Name Server

MX (Mail Exchange)

CNAME (Common Name) www.school.ac.th

hareluya.school.ac.th

A (Address) IP Address

zone IP Address zone

zone "0.0.10.in-addr.arpa" in {

type master; file ""master/school.bj.ac.th.rev;}

Linux - Linux for Teacher 72

Page 9: É7 7 µ¦ ·· ´´Ê S Seerrvveerr   nµ nµ ÇÇ - NECTEC · 2016. 5. 13. · Ä Å¢¨r /etc/named.config o° ¤¸ µ¦ ε® zone ¸Ê zone "school.ac.th" in { type master;

/data/named/master/school.bj.ac.th.rev

@ IN SOA linux.intranet. root.intranet. (

2002010501 ; serial, todays date + todays serial

8H ; refresh, seconds ( 8H = 8 Hours)

2H ; retry, seconds ( 2H = 2 Hours)

1W ; expire, seconds ( 1W = 1 Week)

1D ) ; minimum, seconds ( 1D = 1 Day)

NS hareluya.school.ac.th

MX 10 hareluya.school.ac.th

MX 5 williams.school.ac.th

1 PTR hareluya.school.ac.th.

2 PTR williams.school.ac.th.

3 PTR someone.school.ac.th.

zone /etc/named.conf

1 DNS

DNS

RedHat SIS

setup

System Services

*

named

DNS

Linux - Linux for Teacher 73

Page 10: É7 7 µ¦ ·· ´´Ê S Seerrvveerr   nµ nµ ÇÇ - NECTEC · 2016. 5. 13. · Ä Å¢¨r /etc/named.config o° ¤¸ µ¦ ε® zone ¸Ê zone "school.ac.th" in { type master;

DNS Server DNS Linux

nameserver 10.0.0.1

/etc/resolve.conf

Windows Network Properties Control Panel

TCP/IP DNS IP Address DNS Server

ping hareluya.school.ac.th

ping DNS

Linux - Linux for Teacher 74

Page 11: É7 7 µ¦ ·· ´´Ê S Seerrvveerr   nµ nµ ÇÇ - NECTEC · 2016. 5. 13. · Ä Å¢¨r /etc/named.config o° ¤¸ µ¦ ε® zone ¸Ê zone "school.ac.th" in { type master;

DHCP

DHCP( Dynamic Host Configuration Protocol )

dhcpd.conf /etc/dhcpd.conf Log in Root

dhcpd.conf /etc/dhcpd.conf

Server-identifier dns2.bj.ac.th; # DHCP Server

option domain-name “bj.ac.th”; #

subnet 10.0.0.0 netmask 255.255.255.0 { # Network

Network

range 10.0.0.100 - 10.0.0.400; # IP .100 - .400

option domain-name-server 10.0.0.9,10.0.0.8; # IP DNS Server

option domain-name “bj.ac.th”; # Domain-name

option routers 10.0.0.1; # IP Gateway Router

option subnet-mask 255.255.255.0; # Netmask

option broadcast-address 10.0.0.255; # Broadcast Address Subnet

default-lease-time 43200; # IP

max-lease-time 43200; #

}

Linux - Linux for Teacher 75

Page 12: É7 7 µ¦ ·· ´´Ê S Seerrvveerr   nµ nµ ÇÇ - NECTEC · 2016. 5. 13. · Ä Å¢¨r /etc/named.config o° ¤¸ µ¦ ε® zone ¸Ê zone "school.ac.th" in { type master;

Linux - Linux for Teacher 76

DHCP

RedHat SIS setup

System Services * dhcp

DHCP

1. Client ( Windows9x ) Control Panel Network

2. TCP/IP TCP/IP Properties IP Adress

Obtain an IP address automatically

Page 13: É7 7 µ¦ ·· ´´Ê S Seerrvveerr   nµ nµ ÇÇ - NECTEC · 2016. 5. 13. · Ä Å¢¨r /etc/named.config o° ¤¸ µ¦ ε® zone ¸Ê zone "school.ac.th" in { type master;

3. DNS Configuration Disable DNS

4. Reboot Client Boot IP DHCP

Server

Linux - Linux for Teacher 77

Page 14: É7 7 µ¦ ·· ´´Ê S Seerrvveerr   nµ nµ ÇÇ - NECTEC · 2016. 5. 13. · Ä Å¢¨r /etc/named.config o° ¤¸ µ¦ ε® zone ¸Ê zone "school.ac.th" in { type master;

1. Client Start Menu Run “ winipcfg ”

2. More Info

Linux - Linux for Teacher 78

Page 15: É7 7 µ¦ ·· ´´Ê S Seerrvveerr   nµ nµ ÇÇ - NECTEC · 2016. 5. 13. · Ä Å¢¨r /etc/named.config o° ¤¸ µ¦ ε® zone ¸Ê zone "school.ac.th" in { type master;

3. DHCP Server dhcpd

“ ps aux |grep dhcpd ” dhcpd

Mail Server

Server

Mail Server

#rpm –q sendmail

Sendmail-8.11.6-3

packeage Sendmail not installed.

CD-ROM Linux Redhat Linux SIS

Linux - Linux for Teacher 79

Page 16: É7 7 µ¦ ·· ´´Ê S Seerrvveerr   nµ nµ ÇÇ - NECTEC · 2016. 5. 13. · Ä Å¢¨r /etc/named.config o° ¤¸ µ¦ ε® zone ¸Ê zone "school.ac.th" in { type master;

FTP Server

FTP (file transfer protocol) Client

Server Ftp Server

#rpm –q wu-ftpd

wu-ftpd-2.6.1-11+SIS4

packeage wu-ftpdl not installed.

CD-ROM Linux Redhat Linux SIS

Proxy

Squid

Squid

Squid /etc/squid

bin

etc Configuration File squid.conf

log Log File 3

1. access.log

2. cache.log

3. store.log

cache Cache link

Linux - Linux for Teacher 80

Page 17: É7 7 µ¦ ·· ´´Ê S Seerrvveerr   nµ nµ ÇÇ - NECTEC · 2016. 5. 13. · Ä Å¢¨r /etc/named.config o° ¤¸ µ¦ ε® zone ¸Ê zone "school.ac.th" in { type master;

squid.conf /etc/squid/etc

Login Root /etc/squid/etc

cd /etc/squid/etc

pico pico squid.conf

pico

( squid.conf )

Linux - Linux for Teacher 81

Page 18: É7 7 µ¦ ·· ´´Ê S Seerrvveerr   nµ nµ ÇÇ - NECTEC · 2016. 5. 13. · Ä Å¢¨r /etc/named.config o° ¤¸ µ¦ ε® zone ¸Ê zone "school.ac.th" in { type master;

#http_port 3128

http_port 8080

http_port port Cache server

HTTP Protocal 8080

#icp_port 3130

icp_port 3130

icp_port port cache server

31130

Cache server

Cache_peer cache1.school.net.th parent 8080 3130

cache_peer cache2.school.net.th parent 8080 3130

cache_peer Cache server

cache_peer hostname type http_port icp_port option

1. hostname IP Cache server

2. type parent

3. http_port port HTTP Cache server

4. icp_port port Cache server

5. options weight=n

parent n

Linux - Linux for Teacher 82

Page 19: É7 7 µ¦ ·· ´´Ê S Seerrvveerr   nµ nµ ÇÇ - NECTEC · 2016. 5. 13. · Ä Å¢¨r /etc/named.config o° ¤¸ µ¦ ε® zone ¸Ê zone "school.ac.th" in { type master;

#cache_mem 8 MB

cache_mem 16 MB

cache_mem memory pool

default 8 MB cache_mem memory

MB

#cache_dir /data/cache 100 16 256

cache_dir /data/cache 800 16 256

cache_dir Directory-Name Mbytes Level-1 Level2

1.

2. (MB)

3. Level-1 Level2

Level-1

Level2 Level-1

Log file

Cache_access_log /var/log/squid/access.log

cache_log /var/log/squid/cache.log

cache_store_log /var/log/squid/store.log

Linux - Linux for Teacher 83

Page 20: É7 7 µ¦ ·· ´´Ê S Seerrvveerr   nµ nµ ÇÇ - NECTEC · 2016. 5. 13. · Ä Å¢¨r /etc/named.config o° ¤¸ µ¦ ε® zone ¸Ê zone "school.ac.th" in { type master;

#reference_age 1 month

reference_age 2 month

Cache server

#acl local-intranet dstdomain intranet

#always_direct allow local-intranet

#never_direct allow all

‘ # ‘ 3

acl local-intranet dstdomain

1. ^x

2. Y

3. Enter

squid

1. squid.conf restart squid

/usr/sbin/squid -k reconfigure

2. squid

/usr/sbin/squid &

3. squid

/usr/sbin/squid &

Linux - Linux for Teacher 84

Page 21: É7 7 µ¦ ·· ´´Ê S Seerrvveerr   nµ nµ ÇÇ - NECTEC · 2016. 5. 13. · Ä Å¢¨r /etc/named.config o° ¤¸ µ¦ ε® zone ¸Ê zone "school.ac.th" in { type master;

squid setup

System Services * Squid

Browser Cache server

IE Tools Bar Internet option

Linux - Linux for Teacher 85

Page 22: É7 7 µ¦ ·· ´´Ê S Seerrvveerr   nµ nµ ÇÇ - NECTEC · 2016. 5. 13. · Ä Å¢¨r /etc/named.config o° ¤¸ µ¦ ε® zone ¸Ê zone "school.ac.th" in { type master;

Connections Lan Settings Use a proxy server

Address ( IP Server) Port (Default : 8080)

LAN Setting “Use a proxy server”

IP Address Proxy Port OK

Linux - Linux for Teacher 86

Page 23: É7 7 µ¦ ·· ´´Ê S Seerrvveerr   nµ nµ ÇÇ - NECTEC · 2016. 5. 13. · Ä Å¢¨r /etc/named.config o° ¤¸ µ¦ ε® zone ¸Ê zone "school.ac.th" in { type master;

IP Start Run winipcfg

IP More Info

Run ( ) Open

“winipcfg” Enter

Enter Network

Linux - Linux for Teacher 87

Page 24: É7 7 µ¦ ·· ´´Ê S Seerrvveerr   nµ nµ ÇÇ - NECTEC · 2016. 5. 13. · Ä Å¢¨r /etc/named.config o° ¤¸ µ¦ ε® zone ¸Ê zone "school.ac.th" in { type master;

“More Info>>”

“OK” Desktop

Linux - Linux for Teacher 88

Page 25: É7 7 µ¦ ·· ´´Ê S Seerrvveerr   nµ nµ ÇÇ - NECTEC · 2016. 5. 13. · Ä Å¢¨r /etc/named.config o° ¤¸ µ¦ ε® zone ¸Ê zone "school.ac.th" in { type master;

Samba Server

Samba SMB

(Session Message Block) Microsoft

Server Client

Samba Server

Samba smb.conf

/etc/samba/smb.conf

Linux SIS Samba smb.conf

======

Samba Config

======

6 [global] ,[homes] ,[printers] ,[share] ,[www]

[cgi-bin] 3 [global] ,[homes] [printers]

[global] Samba

workgroup Server

Client

Server String Server

host allow IP address (

192.168.1.* 127.*.*.*)

load printer

guest account User guest account

Linux - Linux for Teacher 89

Page 26: É7 7 µ¦ ·· ´´Ê S Seerrvveerr   nµ nµ ÇÇ - NECTEC · 2016. 5. 13. · Ä Å¢¨r /etc/named.config o° ¤¸ µ¦ ε® zone ¸Ê zone "school.ac.th" in { type master;

log file log

max log size log

security

socket option client

dns proxy nmbd NetBIOS DNS

[homes] Home

comment comment

browseable Browser list

writeable Home

[printers]

comment comment

path path path

guest ok guest account

writeable

printable

[share]

comment comment

path

read only ( writeable )

public

Linux - Linux for Teacher 90

Page 27: É7 7 µ¦ ·· ´´Ê S Seerrvveerr   nµ nµ ÇÇ - NECTEC · 2016. 5. 13. · Ä Å¢¨r /etc/named.config o° ¤¸ µ¦ ε® zone ¸Ê zone "school.ac.th" in { type master;

Samba Server

Samba Server 2 nmbd smbd

Samba ps

======================

# ps ax | grep mbd

======================

Samba

================

Samba nonActive

================

Samba Samba kill

==============

#kill Samba

==============

2

#nmbd -D

#smbd -D

Samba Linux SIS

# chmod +x /etc/rc.d/rc.samba

Linux - Linux for Teacher 91

Page 28: É7 7 µ¦ ·· ´´Ê S Seerrvveerr   nµ nµ ÇÇ - NECTEC · 2016. 5. 13. · Ä Å¢¨r /etc/named.config o° ¤¸ µ¦ ε® zone ¸Ê zone "school.ac.th" in { type master;

Microsoft Windows 9x

Start ---> Setting ---> Control panel

Network Service File and printer sharing for

Microsoft Networks Add Service File and

printer sharing for Microsoft Networks

Identification

Linux - Linux for Teacher 92

Page 29: É7 7 µ¦ ·· ´´Ê S Seerrvveerr   nµ nµ ÇÇ - NECTEC · 2016. 5. 13. · Ä Å¢¨r /etc/named.config o° ¤¸ µ¦ ε® zone ¸Ê zone "school.ac.th" in { type master;

Work Group Server Network Configuration

Restart Log on account Server

guest account Network Neighborhood Linux

Password

Password Password

Password Client Server

Registry regedit.exe C:\WINDOWS

HKEY_LOCAL_MACHINE --> System --> CurrentControlSet --> Services

--> VxD --> VNETSUP

Linux - Linux for Teacher 93

Page 30: É7 7 µ¦ ·· ´´Ê S Seerrvveerr   nµ nµ ÇÇ - NECTEC · 2016. 5. 13. · Ä Å¢¨r /etc/named.config o° ¤¸ µ¦ ε® zone ¸Ê zone "school.ac.th" in { type master;

Edit --> New --> DWORD Value

New Value #1 EnablePlainTextPassword

EnablePlainTextPassword 0 1

“OK” regedit Restart

Linux - Linux for Teacher 94

Page 31: É7 7 µ¦ ·· ´´Ê S Seerrvveerr   nµ nµ ÇÇ - NECTEC · 2016. 5. 13. · Ä Å¢¨r /etc/named.config o° ¤¸ µ¦ ε® zone ¸Ê zone "school.ac.th" in { type master;

7……………………………………………………… ………………

………………………… ……………………………………….

1. DNS

2. DNS Server

3. DNS

4.

5. 1 DNS

6. DNS Server

7.

8.

Linux - Linux for Teacher 95

Page 32: É7 7 µ¦ ·· ´´Ê S Seerrvveerr   nµ nµ ÇÇ - NECTEC · 2016. 5. 13. · Ä Å¢¨r /etc/named.config o° ¤¸ µ¦ ε® zone ¸Ê zone "school.ac.th" in { type master;

Linux - Linux for Teacher 96