際際滷

際際滷Share a Scribd company logo
Thuctap report
Trang 1
畉I H畛C QU畛C GIA TP.H畛 CH MINH
TR働畛NG 畉I H畛C CNG NGH畛 THNG TIN
KHOA M畉NG MY TNH V TRUY畛N THNG

BO CO TH畛C T畉P
畛 TI:
TM HI畛U V THI畉T L畉P D畛CH V畛
TRN H畛 I畛U HNH LINUX
C担ng ty th畛c t畉p: Trung T但m o T畉o Qu畉nTr畛 M畉ng
v An Ninh M畉ng Qu畛c T畉 Athena
Sinh vi棚n th畛c hi畛n: Vn H畛ng Th動
MSSV: 13520857
L畛p: MMTT2013
Ng動畛i h動畛ng d畉n: L棚 狸nh Nh但n
TP.H畛 Ch鱈 Minh, ngy 26 th叩ng 4 nm 2017
Trang 2
L畛I C畉M N ................................................................................................................................. 3
NH畉N XT C畛A N V畛 TH畛C T畉P ....................................................................................... 4
NH畉N XT C畛A KHOA .............................................................................................................. 5
CH働NG 1: GI畛I THI畛U V畛 N V畛 TH畛C T畉P................................................................... 6
1.1 Gi畛i thi畛u chung............................................................................................................... 6
1.2 L挑nh v畛c ho畉t 畛ng .......................................................................................................... 6
1.3 畛i ng滴 nh但n s畛 ............................................................................................................... 8
1.4 C董 s畛 v畉t ch畉t................................................................................................................... 8
1.5 D畛ch v畛 h畛 tr畛................................................................................................................... 8
CH働NG 2: TH畛NG K QU TRNH TH畛C T畉P T畉I TRUNG TM.................................. 9
2.1 Th畛i gian th畛c t畉p ................................................................................................................. 9
2.2 Li畛t k棚 n畛i dung th畛c t畉p....................................................................................................... 9
CH働NG 3: N畛I DUNG TH畛C T畉P CHI TI畉T ...................................................................... 10
3.1 S畛 d畛ng ISPConfig Server ............................................................................................. 10
3.1.1 Gi畛i thi畛u v畛 qu畉n tr畛 hosting tr棚n ISPConfig Server............................................. 10
3.1.2 S畛 d畛ng ISPConfg Server....................................................................................... 11
3.2 D畛ch V畛 Samba Server................................................................................................... 17
3.2.1 Gi畛i thi畛u Samba .................................................................................................... 17
3.2.2 C畉u h狸nh Samba ...................................................................................................... 18
3.3 D畛ch v畛 Lamp Server ..................................................................................................... 28
3.3.1 Gi畛i thi畛u Lamp Server........................................................................................... 28
3.3.2 C畉u h狸nh Lamp Server ............................................................................................ 29
3.4 D畛ch v畛 Mail Server ....................................................................................................... 36
3.4.1 Gi畛i thi畛u Mail Server ............................................................................................ 36
3.4.2 C畉u h狸nh MailServer ............................................................................................... 37
3.5 S畛 d畛ng CA Server t畉o ch畛ng ch畛 SSL.......................................................................... 46
3.5.1 Gi畛i thi畛u ch畛ng ch畛 SSL........................................................................................ 46
3.5.2 T畉o ch畛ng ch畛 SSL tr棚n CA Server ........................................................................ 47
CH働NG 4: K畉T LU畉N ............................................................................................................ 50
PH畛 L畛C I: VIDEO QU TRNH TH畛C HI畛N ....................................................................... 51
PH畛 L畛C II: TRCH D畉N NGU畛N THAM KH畉O ................................................................. 52
Trang 3
L畛I C畉M N
Tr但n tr畛ng g畛i l畛i c畉m 董n 畉n Trung t但m o T畉o Qu畉n Tr畛 M畉ng v An Ninh M畉ng
Qu畛c T畉 Athena 達 t畉o i畛u ki畛n cho em c坦 c董 h畛i 動畛c th畛c t畉p t畉i Trung t但m.
Ch畛 trong m畛t th畛i gian ng畉n, nh動ng nh畛 s畛 ch畛 d畉n nhi畛t t狸nh c畛a c叩c th畉y c担 t畉i Trung
t但m. 畉c bi畛t l th畉y L棚 狸nh Nh但n 達 t畉n t狸nh gi炭p 畛 c畉 nh畛ng kh坦 khn trong c担ng vi畛c, 畉n
nh畛ng kh坦 khn vi畛c lm quen v畛i m担i tr動畛ng m畛i, t畉o i畛u ki畛n cho em h畛c h畛i kinh nghi畛m
th畛c t畉 畛 th畛c hi畛n 畛 ti. Ch但n thnh c畉m 董n th畉y 達 b畛 ra nhi畛u th畛i gian, c担ng s畛c 畛 h動畛ng
d畉n em hon thnh 畛t th畛c t畉p ny.
K鱈nh ch炭c m畛i ng動畛i lu担n vui v畉 h畉nh ph炭c, d畛i do s畛c kh畛e v thnh c担ng trong c担ng
vi畛c.
Em xin ch但n thnh c畉m 董n!
Trang 4
NH畉N XT C畛A N V畛 TH畛C T畉P
















....
TP.H畛 Ch鱈 Minh, ngy th叩ng nm 2017
Trang 5
NH畉N XT C畛A KHOA
















....
TP.H畛 Ch鱈 Minh, ngy th叩ng nm 2017
Trang 6
畉nh ch畛p v畛i Gi叩m 畛c Trung t但m V探 畛 Th畉ng v nh坦m th畛c t畉p
CH働NG 1: GI畛I THI畛U V畛 N V畛 TH畛C T畉P
1.1 Gi畛i thi畛u chung.
Trung T但m o T畉o Qu畉n Tr畛 M畉ng & An Ninh M畉ng Qu畛c T畉 ATHENA 動畛c thnh
l畉p t畛 nm 2004, l m畛t t畛 ch畛c qui t畛 nhi畛u tr鱈 th畛c Vi畛t Nam 畉y nng 畛ng, nhi畛t
huy畉t v kinh nghi畛m trong l挑nh v畛c CNTT, v畛i t但m huy畉t g坦p ph畉n vo c担ng cu畛c th炭c
畉y ti畉n tr狸nh 動a c担ng ngh畛 th担ng tin l ngnh kinh t畉 m滴i nh畛n, g坦p ph畉n ph叩t tri畛n
n動畛c nh .
1.2 L挑nh v畛c ho畉t 畛ng
- Trung t但m ATHENA 達 v ang t畉p trung ch畛 y畉u vo o t畉o, t動 v畉n, cung c畉p nh但n
l畛c chuy棚n s但u trong l挑nh v畛c qu畉n tr畛 m畉ng, an ninh m畉ng, th動董ng m畉i i畛n t畛, truy畛n
Trang 7
th担ng x達 h畛i ( social Network) theo c叩c ti棚u chu畉n qu畛c t畉 c畛a c叩c h達ng n畛i ti畉ng nh動
Microsoft, Cisco, Oracle, Linux LPI , AEH, Song song 坦, trung t但m ATHENA c嘆n
c坦 nh畛ng ch動董ng tr狸nh o t畉o cao c畉p dnh ri棚ng theo 董n 畉t hng c畛a c叩c 董n v畛
nh動 B畛 Qu畛c Ph嘆ng, B畛 C担ng An , ng但n hng, doanh nghi畛p SME, c叩c c董 quan ch鱈nh
ph畛, t畛 ch畛c ti ch鱈nh..
- Sau h董n 10 nm ho畉t 畛ng,nhi畛u h畛c vi棚n t畛t nghi畛p trung t但m ATHENA 達 l chuy棚n
gia 畉m nh畉n c担ng t叩c qu畉n l箪 h畛 th畛ng m畉ng, an ninh m畉ng, qu畉n l箪 h畛 th畛ng kinh
doanh Online ( Internet Business) cho nhi畛u b畛 ngnh nh動 C畛c C担ng Ngh畛 Th担ng Tin
 B畛 Qu畛c Ph嘆ng , B畛 C担ng An, S畛 Th担ng Tin Truy畛n Th担ng c叩c t畛nh, S畛 Th動董ng
M畉i,doanh nghi畛p SME..
- B棚n c畉nh 坦, Trung t但m ATHENA c嘆n c坦 nhi畛u ch動董ng tr狸nh h畛p t叩c v trao 畛i c担ng
ngh畛 v畛i nhi畛u 畉i h畛c l畛n nh動 畉i h畛c B叩ch Khoa Thnh Ph畛 H畛 Ch鱈 Minh, H畛c Vi畛n
An Ninh Nh但n D但n( Th畛 畛c), H畛c Vi畛n B動u Ch鱈nh Vi畛n Th担ng, Hi畛p h畛i an ton
th担ng tin (VNISA), Vi畛n K畛 Thu畉t Qu但n S畛 ,
- Song song v畛i c叩c ho畉t 畛ng o t畉o, Trung t但m ATHENA c嘆n tham gia t動 v畉n 畛ng
d畛ng c担ng ngh畛 vo n但ng cao nng su畉t lao 畛ng v cung c畉p nh但n s畛 cho hng ngn
doanh nghi畛p SME ( kh畛i doanh nghi畛p v畛a v nh畛). Ho畉t 畛ng ny 動畛c c畛ng 畛ng
doanh nghi畛p 叩nh gi叩 r畉t cao, mang l畉i l畛i 鱈ch thi畉t th畛c , doanh nghi畛p v畛a 動畛c t動
v畉n c担ng ngh畛 v畛a t狸m 動畛c ngu畛n nh但n l畛c ph湛 h畛p cho ho畉t 畛ng kinh doanh. 但y
c滴ng l c董 s畛 畛 c叩c h畛c vi棚n t畛t nghi畛p ATHENA lu担n c坦 vi畛c lm theo 炭ng y棚u c畉u
x達 h畛i
Trang 8
1.3 畛i ng滴 nh但n s畛
- T畉t c畉 c叩c gi畉ng vi棚n, chuy棚n vi棚n trung t但m ATHENA 畛u l c叩c chuy棚n gia trong
l挑nh v畛c qu畉n tr畛 m畉ng, an ninh m畉ng, ph叩t tri畛n th動董ng m畉i i畛n t畛, kinh doanh tr棚n
Internet v畛i nhi畛u nm kinh nghi畛m. B棚n c畉nh c担ng t叩c gi畉ng d畉y, c叩c gi畉ng vi棚n
th動畛ng xuy棚n tham gia c叩c d畛 叩n t動 v畉n, tri畛n khai c担ng ngh畛 t畉i doanh nghi畛p v畛i
m畛c 鱈ch 動a ki畉n th畛c c担ng ngh畛 vo ph叩t tri畛n kinh t畉 v c畉p nh畉t nh畛ng bi畉n 畛i
th動畛ng xuy棚n c畛a x達 h畛i 畛 動a vo ch動董ng tr狸nh gi畉ng d畉y.
- Ph動董ng ch但m ho畉t 畛ng c畛a 畛i ng滴 gi畉ng vi棚n ATHENA l Lu担n Lu担n S叩ng T畉o
畛 叩p 畛ng Nhu C畉u X達 H畛i.
1.4 C董 s畛 v畉t ch畉t
- Thi畉t b畛 畉y 畛 v hi畛n 畉i
- Ch動董ng tr狸nh c畉p nh畉t li棚n t畛c, b畉o 畉m h畛c vi棚n lu担n ti畉p c畉n v畛i nh畛ng c担ng ngh畛
m畛i nh畉t
1.5 D畛ch v畛 h畛 tr畛
- 畉m b畉o vi畛c lm cho h畛c vi棚n t畛t nghi畛p
- Gi畛i thi畛u vi畛c lm cho m畛i h畛c vi棚n
- Th畛c t畉p c坦 l動董ng cho h畛c vi棚n 叩p 畛ng 動畛c y棚u c畉u
- Ngoi gi畛 h畛c ch鱈nh th畛c, h畛c vi棚n 動畛c th畛c hnh th棚m mi畛n ph鱈, kh担ng gi畛i h畉n
th畛i gian.
- H畛 tr畛 k畛 thu畉t kh担ng th畛i h畉n trong t畉t c畉 c叩c l挑nh v畛c li棚n quan 畉n m叩y t鱈nh, m畉ng
m叩y t鱈nh, b畉o m畉t m畉ng, ph叩t tri畛n Internet Business
- H畛 tr畛 thi Ch畛ng ch畛 Qu畛c t畉.
Trang 9
CH働NG 2: TH畛NG K QU TRNH TH畛C T畉P T畉I TRUNG TM
2.1 Th畛i gian th畛c t畉p
- Th畛i gian b畉t 畉u: 21/2/2017
- Th畛i gian k畉t th炭c: 23/4/2017
- Gi畛 th畛c t畉p t畉i Trung t但m: 9h 畉n 16h, 3 bu畛i 1 tu畉n
2.2 Li畛t k棚 n畛i dung th畛c t畉p
B畉ng b棚n d動畛i l n畛i dung c担ng vi畛c trong su畛t qu叩 tr狸nh th畛c t畉p
Th畛i gian N畛i dung c担ng vi畛c
Tu畉n 1
(21/2/2017  26/2/2017)
- G畉p GVHD nh畉n 畛 ti v ti li畛u h動畛ng d畉n
- T狸m hi畛u v畛 Trung t但m
- Quay clip gi畛i thi畛u v畛 b畉n th但n
Tu畉n 2
(27/2/2017  5/3/2017)
- S畛 d畛ng ISPConfig
- Quay clip h動畛ng d畉n s畛 d畛ng ISPCongfig
Tu畉n 3
(6/3/2017  12/3/2017)
- T狸m hi畛u c畉u h狸nh d畛ch v畛 Samba Server
- Quay clip h動畛ng d畉n c畉u h狸nh d畛ch v畛 Samba Server
Tu畉n 4
(13/3/2017  19/3/2017)
- T狸m hi畛u c畉u h狸nh d畛ch LAMP Server
- Ci 畉t v c畉u hinh cho webserver apache s畛 d畛ng
apache-itk
Tu畉n 5
(20/3/2017  26/3/2017)
- Quay clip h動畛ng d畉n ci 畉t v c畉u hinh cho webserver
apache s畛 d畛ng apache-itk
- Tham gia bu畛i ph畛ng v畉n th畛 t畉i Trung t但m
Tu畉n 6
(27/3/2017  2/4/2017)
- T狸m hi畛u c畉u h狸nh d畛ch v畛 Mail Server v畛i postfix v
dovecot
- Ci 畉t webmail v畛i Roudcube
Tu畉n 7
(3/4/2017  9/4/2017)
- Quay video h動畛ng d畉n c畉u h狸nh d畛ch v畛 Mail Server v畛i
postfix v dovecot
- Quay video h動畛ng d畉n ci 畉t webmail v畛i Roudcube
- T狸m hi畛u ci 畉t v c畉u h狸nh CA-Server
Tu畉n 8
(10/4/2017  16/4/2017)
- T狸m hi畛u s畛 d畛ng CA-Server 畛 c畉p ch畛ng ch畛 cho
website
- Quay clip h動畛ng d畛ng s畛 d畛ng d畛ng CA-Server 畛 c畉p
ch畛ng ch畛 cho website
Tu畉n 9
(17/4/2017  23/4/2017)
- T畛ng h畛p v lm b叩o c叩o t畛ng k畉t
Trang 10
CH働NG 3: N畛I DUNG TH畛C T畉P CHI TI畉T
3.1 S畛 d畛ng ISPConfig Server
3.1.1 Gi畛i thi畛u v畛 qu畉n tr畛 hosting tr棚n ISPConfig Server
- ISPConfig 動畛c ph叩t tri畛n b畛i c担ng ty projektfarm GmbH c畛a 畛c, l m畛t trong s畛
hi畉m hoi ch動董ng tr狸nh qu畉n l箪 hosting tr棚n m達 ngu畛n m畛 (BSD license). V畛i c叩c t鱈nh
nng qu畉n l箪 chuy棚n nghi畛p v d畛 s畛 d畛ng ch畉c h畉n ISPConfig s畉 l l畛a ch畛n t畛t cho
Sinh Vi棚n, c叩c nh但n v Doanh nghi畛p 動a chu畛n m達 ngu畛n m畛.
- ISPConfig 3 l 1 lo畉i cpanel m達 ngu畛n m畛 dnh ri棚ng cho h畛 th畛ng Linux. N坦 cho
ph辿p qu畉n l箪 muti server th担ng qua 1 h畛 th畛ng control cpanel
- M畛t s畛 d畛ch v畛 ISPConfig c坦 th畛 qu畉n l箪:
+ Qu畉n tr畛 1 ho畉c nhi畛u server th担ng qua Control Panel
+ Cho ph辿p qu畉n l箪 a c畉p + Ti kho畉ng ng動畛i d湛ng email 動畛c cung c畉p b畛i
roundcube
+ Httpd (virtual hosts, domain and IP based)
+ FTP
+ Bind (A, CNAME, MX and SPF Records)
+ POP3 Auto-Responder
+ MySQL client-databases
+ Harddisk quota
+ Mail-Quota
+ Traffic limits
+ IP-addresses
+ SSL
Trang 11
- H畛 tr畛 c叩c ng担n ng畛:
+ English
+ German
+ French
+ Spanish
+ Dutch
+ Italian
+ Polish
+ Swedish
+ Brazilian Portuguese
+ Greek
+ Romanian
+ Russian
3.1.2 S畛 d畛ng ISPConfg Server
- Ci 畉t Client v Website
Trang 12
- Ci 畉t DNS
Trang 13
K畉t Qu畉:
- Ci 畉t FTP
Trang 14
- Ci 畉t Email
Trang 15
K畉t Qu畉:
- Ci 畉t WordPress v Database
Trang 16
- T畉o Subdomain
Trang 17
K畉t Qu畉:
3.2 D畛ch V畛 Samba Server
3.2.1 Gi畛i thi畛u Samba
- Samba l d畛ch v畛 c畛a h畛 i畛u hnh Linux, ch畉y tr棚n n畛n giao th畛c SMB (Server
Message Block) cho phep chia s畉 file h畛 th畛ng, m叩y in v畛i c叩c m叩y ch畉y Win95, 98
ho畉c NT. SMB l giao th畛c 動畛c c叩c h畛 i畛u hnh c畛a Microsoft s畛 d畛ng 畛 chia s畉
Trang 18
d畛 li畛u qua m畉ng. V畛i Linux Samba c滴ng d畛a vo giao th畛c SMB 畛 vi畉t ra m畛t s畛
ti畉n tr狸nh i畛n h狸nh nh動 smbd, nmbd, 畛 n坦i chuy畛n  v畛i c叩c h畛 i畛u hnh c畛a
Microsoft 畛 ng動畛i d湛ng c坦 th畛 lm vi畛c v畛i m叩y Linux qua Network Neighborhood.
3.2.2 C畉u h狸nh Samba
 C畉u h狸nh SAMBA Server Full Permission
- - Install Samba server
[root@centos1 ~]# yum install samba
- thi畉t l畉p folder shared v c畉u h狸nh permission
[root@centos1 ~]# mkdir -p /data/share => t畉o ra folder d湛ng 畛 shared d畛 li畛u
[root@centos1 ~]# chmod 777 /data/share/ => c畉p quy畛n 777 cho folder ny, nh動 v畉y
OTHER s畉 ton quy畛n tr棚n folder ny
- Ch畛nh s畛a file c畉u hinh Samba
[root@centos1 ~]# vi /etc/samba/smb.conf
#Di den dong 58 sau [global]
unix charset = UTF-8
dos charset = CP932
#Dong 75 thay doi gia tri
workgroup = WORKGROUP
netbios name = centos1
hosts allow = 127. 192.168.12. 192.168.13. 192.168.1.
interfaces = lo eth1 192.168.1.13/24
#Dong 102
Trang 19
security = share
passdb backend = tdbsam
#Them vao cuoi cung file cau hinh
[Share]
path = /data/share
writable = yes
guest ok = yes
guest only = yes
create mode = 0777
directory mode = 0777
fully accessed
share modes = yes
- Start Samba Server
[root@server ~]# /etc/init.d/smb start
Starting SMB services: [ OK ]
[root@server ~]# /etc/init.d/iptables stop
 C畉u h狸nh SAMBA v ph但n quy畛n theo user
- K鱈ch ho畉t t鱈nh nng ACL cho partition
[root@centos1 share]# vi /etc/fstab => kich hoat tinh nang ACL cho phan vung "/"
- T畉o ra folder "/data/share" v s畛 d畛ng ACL 畛 ph但n quy畛n
[root@centos1 share]# mkdir /data/share
[root@centos1 share]# groupadd student
[root@centos1 share]# groupadd teacher
Trang 20
[root@centos1 share]#useradd -g student user1
[root@centos1 share]#useradd -g student user2
[root@centos1 share]#useradd -g teacher gv1
[root@centos1 share]#useradd -g teacher gv2
-
[root@vmware data]# cd /data
[root@vmware data]# chmod 750 share => nh動 v畉y OTHER s畉 kh担ng c坦 quy畛n tr棚n
folder share
- S畛 d畛ng ACL 畛 ph但n quy畛n cho t畛ng lo畉i group kh叩c nhau
[root@vmware data]# setfacl -m g:student:r-x share/
[root@vmware data]# setfacl -m g:teacher:rwx share/
- Ki畛m tra l畉i c叩c quy畛n 動畛c g叩n cho group student v teacher
[root@vmware data]# getfacl share/
# file: share/
# owner: root
# group: root
user::rwx
group::r-x
group:student:rwx
group:teacher:rwx
mask::rwx
other::r-x
Trang 21
- S畛 d畛ng "smbpasswd" 畛 t畉o ra password cho c叩c user
[root@vmware data]#smbpasswd -a user1
New Password: 123
Retype Password: 123
[root@vmware data]#smbpasswd -a user2
[root@vmware data]#smbpasswd -a gv1
[root@vmware data]#smbpasswd -a gv2
- C畉u h狸nh Samba server 畛 file "/etc/samba/smb.conf"
[root@vmware data]# vi /etc/samba/smb.conf
#Di den dong 58 sau [global]
unix charset = UTF-8
dos charset = CP932
#Dong 75 thay doi gia tri
workgroup = WORKGROUP
netbios name = Centos_Server
hosts allow = 127. 192.168.12. 192.168.13. 192.168.1.
interfaces = lo eth1 192.168.1.13/24
#Di den dong 102 thay doi gia tri
security = user => su dung username va password de xac thuc
Trang 22
- C畉u h狸nh t畉o folder shared s畛 d畛ng username v password 畛 x叩c th畛c. V ch畛 c坦 user
thu畛c group teacher v student 動畛c k畉t n畛i vo.
[Shared_Security]
comment = Samba Shared
path = /data/share
writable = yes
create mode = 0775
directory mode = 0770
share modes = yes
guest ok = no
valid users = @teacher @student
- Restart d畛ch v畛 Samba
[root@server data]# /etc/init.d/smb restart
- T畉i client window 7 th畛 k畉t n畛i vo SAMBA SERVER
Trang 23
- Su dung "veto file" va "hide files"
+ veto files: khong cho phep mot loai file nao do
+ hiden files: an loai nao do
[Shared_Security]
comment = Samba Shared
path = /data/share
writable = yes
create mode = 0775
directory mode = 0770
share modes = yes
guest ok = no
valid users = @teacher @student
Trang 24
#Su dung "veto files" khong cho phep ghi file .exe vao folder shared
veto files = /*.exe
#Su dung "hide files", cac file .rar khi ghi vao folder se bi hidden
hide files = /*.rar
K畉t Qu畉:
- Kh担ng cho ph辿p ghi file .exe
Trang 25
- 畉n file .rar
 S畛 d畛ng "Sticky Bit" k畉t h畛p v畛i SAMBA
Trang 26
- Shared voi "Sticky Bit" ( user owner va user Root co quyen Rename va Xoa File.
User cung 1 group khong xoa duoc file)
- Ta k鱈ch ho畉t t鱈nh nng Sticky Bit cho folder /data/share
[root@server data]# chmod o+t share/
- Ta c畉u h狸nh l畉i file /etc/samba/smb.conf
[Shared_Security]
comment = Samba Shared
path = /data/share
writable = yes
create mode = 1770
create mask = 1770
force create mode= 1770
directory mode = 1770
directory mask = 1770
force directory mode = 1770
share modes = yes
guest ok = no
valid users = @teacher @student
Trang 27
- Restart d畛ch v畛 Samba
[root@server data]# /etc/init.d/smb restart
- Ki畛m tra k畉t n畛i t畉i window 7
Khi ng nh畉p ti kho畉n gv2 畛 xoa file gv1 達 t畉o => H畛 th畛ng b叩o kh担ng c坦 quy畛n
Trang 28
3.3 D畛ch v畛 Lamp Server
3.3.1 Gi畛i thi畛u Lamp Server
- LAMP l ch畛 vi畉t t畉t th動畛ng 動畛c d湛ng 畛 ch畛 s畛 s畛 d畛ng c叩c ph畉n m畛m Linux,
Apache, MySQL v ng担n ng畛 vn l畛nh PHP hay Perl hay Python 畛 t畉o n棚n m畛t m担i
tr動畛ng m叩y ch畛 Web c坦 kh畉 nng ch畛a v ph但n ph畛i c叩c trang Web 畛ng.
+ Linux: Linux l m畛t h畛 i畛u hnh. V畛 m畉t nguy棚n t畉c h畛 i畛u hnh c滴ng l m畛t
software; nh動ng 但y l m畛t software 畉c bi畛t 動畛c d湛ng 畛 qu畉n l箪, i畛u ph畛i c叩c ti
nguy棚n (resource) c畛a h畛 th畛ng (bao g畛m c畉 hardware v c叩c software kh叩c).
+ Apache: l ph畉n m畛m m叩y ch畛 web ph畛 bi畉n nh畉t tr棚n m畉ng. N坦 r畉t an ton, nhanh
ch坦ng, v 叩ng tin c畉y. Ch炭ng ta c坦 th畛 t湛y ch畛nh 畛 Apache h畛 tr畛 c叩c ng担n nh畛 web
kh叩c nhau nh動 PHP, CGI / Perl, SSL, SSI, ePerl, v th畉m ch鱈 ASP.
+ MySQL l h畛 qu畉n tr畛 c董 s畛 d畛 li畛u nhanh nh畉t tr棚n th畉 gi畛i, n坦 tr畛 thnh c董 s畛 d畛 li畛u
ngu畛n m畛 ph畛 bi畉n nh畉t tr棚n th畉 gi畛i v狸 hi畛u su畉t cao, 畛 tin c畉y cao v d畛 s畛 d畛ng. N坦
r畉t t畛t cho c叩c 畛ng d畛ng d畛a tr棚n web. R畉t nhi畛u c叩c c担ng c畛 h畛 tr畛 達 動畛c ph叩t tri畛n
cho MySQL v畛i PHP, ch畉ng h畉n nh動 phpMyAdmin l m畛t c担ng c畛 qu畉n tr畛 web r畉t t畛t
cho MySQL, v gi炭p b畉n c坦 th畛 lm b畉t c畛 i畛u g狸 m b畉n mong mu畛n v畛i MySQL. N坦
c滴ng l s畛 l畛a ch畛n cho m畛t th畉 h畛 m畛i c叩c 畛ng d畛ng 動畛c x但y d畛ng tr棚n LAMP.
+ PHP 動畛c ph叩t tri畛n nh動 l m畛t ng担n ng畛 k畛ch b畉n tr棚n m叩y ch畛 (server-side scripting
language). N坦 動畛c ph叩t tri畛n b畛i Rasmus Lerdorf, v nh畛ng ng動畛i kh叩c. Hi畛n t畉i, c叩c
phi棚n b畉n c畛a n坦 c坦 nhi畛u l畛i th畉 h董n c叩c 畛i th畛 c畉nh tranh nh動 ASP, Cold Fusion, Perl,
Java,... ch畉ng h畉n nh動 v畛 h動畛ng 畛i t動畛ng v kh畉 nng nh炭ng vo ng担n ng畛 HTML 動畛c
x畛 l箪 r畉t nhanh, t動董ng th鱈ch v畛i nhi畛u n畛n t畉ng h畛 i畛u hnh, ho畉t 畛ng nh動 m畛t thnh
Trang 29
ph畉n c畛a Apache. N坦 動畛c c畉p nh畉t li棚n t畛c c叩c k畛 thu畉t m畛i b畉ng c叩ch vay m動畛n nh畛ng
t鱈nh nng t畛t nh畉t t畛 nhi畛u ng担n ng畛 l畉p tr狸nh kh叩c.
3.3.2 C畉u h狸nh Lamp Server
 Ci 畉t v c畉u h狸nh web server Apache
- Ci 畉t web server Apache v k鱈ch ho畉t cho web server ho畉t 畛ng
[root@srv01 ~]# yum install httpd => ci 畉t web server Apache
[root@srv01 ~]# /etc/init.d/httpd start => kh畛i 畛ng web server apache
- Thi畉t l畉p c叩c th担ng s畛 ton c畛c cho web server Apache
[root@server /]# vi /etc/httpd/conf/httpd.conf
#Dong 44 thay doi gia tri
ServerTokens Athena
#Dong 136
Listen 80
#Dong 221
Include conf.d/*.conf
#Dong 262 thay doi gia tri
ServerAdmin admin@athena.lab
#Dong 276 thay doi gia tri
ServerName www.athena.lab:80
#Dong 292
Trang 30
DocumentRoot "/var/www/html"
#Dong 331 thay doi gia tri
Options FollowSymLinks ExecCGI
#Dong 338
AllowOverride All
#Dong 402
DirectoryIndex index.html index.html.var index.cgi index.php
#Dong 536
ServerSignature Off
#Dong 759 - Them Dau "#" khong su dung UTF-8
# AddDefaultCharset UTF-8
#Dong 796
AddHandler cgi-script .cgi .pl
 Thi畉t l畉p NameBase VirtualHost
[root@server html]# cd /etc/httpd/conf.d/
[root@server conf.d]# vi vhost.conf
NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin vanthu1@vmware.lab
ServerName vanthu1.vmware.lab
Trang 31
ServerAlias vanthu1.vmware.lab
DocumentRoot /srv/www/ vanthu1.vmware.lab/public_html/
ErrorLog /srv/www/ vanthu1.vmware.lab/logs/error.log
CustomLog /srv/www/vanthu1.vmware.lab/logs/access.log combined
</VirtualHost>
- T畉o c叩c file v folder theo c畉u tr炭c 畛 tr棚n
[root@srv01 ~]# mkdir -p /srv/www/vanthu1.vmware.lab/public_html/
[root@srv01 ~]# mkdir -p /srv/www/vanthu1.vmware.lab/logs/
[root@srv01 ~]# touch /srv/www/vanthu1.vmware.lab/logs/error.log
[root@srv01 ~]# touch /srv/www/vanthu1.vmware.lab/logs/access.log
 Thi畉t l畉p c董 s畛 d畛 li畛u cho c叩c website
- Ci 畉t thnh ph畉n database server v 畛nh ngh挑a username v password 畛 truy c畉p
vo database server
[root@srv01 ~]# yum install mysql-server
[root@srv01 ~]# /etc/init.d/mysqld start
[root@srv01 ~]# mysql_secure_installation
=> l畉n 畉u ti棚n th狸 ENTER
=> thi畉t l畉p password cho user "root" c畛a database server
[root@srv01 ~]# mysql -u root -p654321
mysql> create database vanthu1;
Query OK, 1 row affected (0.00 sec)
mysql> CREATE USER 'vanthu1@'localhost' IDENTIFIED BY
'vanthu1_password';
Trang 32
Query OK, 0 rows affected (0.00 sec)
mysql> GRANT ALL PRIVILEGES ON site1.* TO 'vanthu1'@'localhost';
Query OK, 0 rows affected (0.00 sec)
mysql> exit
- Ci 畉t ng担n ng畛 PHP
[root@server ~]# yum -y install php-gd php-ncurses php-snmp php-mbstring php-
mysql php-devel php-imap
[root@server ~]# yum -y install php-odbc php-pear php-xml
[root@server ~]# yum -y install php-xmlrpc php-dba php-pear-DB php-process php-
pear-DB php-mcrypt
 Ci 畉t website th畛 nghi畛m
[root@srv01 ~]# wget https://wordpress.org/latest.tar.gz
[root@srv01 ~]# tar xf latest.tar.gz
[root@srv01 ~]# cd wordpress/
[root@srv01 wordpress]# cp v -R * /srv/www/vanthu1.vmware.lab/public_html/
[root@srv01 wordpress]# cd /srv/www/vanthu1.vmware.lab/public_html/
[root@srv01 public_html]#
[root@srv01 public_html]# cp wp-config-sample.php wp-config.php
[root@srv01 public_html]# vi wp-config.php
- 畛 m叩y t鱈nh client k畉t n畛i vo "http://vanthu1.vmware.lab" ki畛m tra k畉t n畛i vo trang
web
Trang 33
 C畉u h狸nh cho web server apache s畛 d畛ng httpd-itk
[root@srv01 ~]# yum install httpd-itk
- B畉t t鱈nh nng http-itk cho trang web
[root@srv01 ~]# vi /etc/sysconfig/httpd
#Dong so 9 them vao noi dung
HTTPD=/usr/sbin/httpd.itk
- Thi畉t l畉p th担ng s畛 itk
[root@srv01 ~]# vi /etc/httpd/conf.d/mpm-itk.conf
<IfModule itk.c>
StartServers 8
MinSpareServers 5
Trang 34
MaxSpareServers 20
ServerLimit 256
MaxClients 256
MaxRequestsPerChild 4000
</IfModule>
[root@srv01 ~]# vi /etc/httpd/conf.d/php.conf
#Them vao noi dung
<IfModule itk.c>
LoadModule php5_module modules/libphp5.so
</IfModule>
- Ki畛m tra itk 達 n畉 vo apache ch動a
[root@srv01 conf.d]# apachectl -t -D DUMP_MODULES | grep mpm
mpm_itk_module (static)
Syntax OK
- Ki畛m tra c畉u h狸nh Apache c坦 OK kh担ng
[root@srv01 conf.d]# /etc/init.d/httpd configtest
Syntax OK
[root@srv01 ~]# mkdir -p /srv/www
[root@srv01 ~]# useradd site3.vmware.lab -d /srv/www/site3.vmware.lab -s
/sbin/nologin
[root@srv01 ~]# cd /srv/www/site3.vmware.lab
[root@srv01 site1.vmware.lab]# mkdir tmp logs public_html
[root@srv01 site1.vmware.lab]# chown -R site3.vmware.lab: public_html/
Trang 35
[root@srv01 site1.vmware.lab]# chmod -R 750 public_html
[root@srv01 ~]# cd /etc/httpd/conf.d
[root@srv01 conf.d]# vi vhost.conf
NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin webmaster@site1.vmware.lab
ServerName site1.vmware.lab
<IfModule itk.c>
AssignUserId site1.vmware.lab site1.vmware.lab
</IfModule>
DocumentRoot /srv/www/site1.vmware.lab/public_html
ErrorLog /srv/www/site1.vmware.lab/logs/error_log
CustomLog /srv/www/site1.vmware.lab/logs/access_log "combined"
LogLevel info
DirectoryIndex index.php index.html
php_admin_value upload_tmp_dir /srv/www/site1.vmware.lab/tmp
php_value session.save_path /srv/www/site1.vmware.lab/tmp
php_admin_value open_basedir
/srv/www/site1.vmware.lab/public_html:/srv/www/site1.vmware.lab/tmp
php_admin_value suhosin.executor.func.blacklist "passthru, shell_exec, system,
proc_open, popen, apache_child_terminate, apache_setenv, define_syslog_variables,
pcntl_exec, openlog, posix_getpwuid, posix_kill, posix_setpgid, posix_setsid,
Trang 36
posix_setuid, posix_setuid, posix_uname, proc_close, proc_get_status, proc_open,
proc_terminate, syslog, curl_exec, curl_multi_exec, php_uname"
</VirtualHost>
Ch炭 th鱈ch c叩c th担ng s畛
- open_basedir l tham s畛 c畛c k狸 quan tr畛ng trong vi畛c ph嘆ng ch畛ng local attack, khi
website ch畉y trong th動 m畛c ny, n坦 s畉 kh担ng th畛 th畛c hi畛n thao t叩c v畛i c叩c th動 m畛c
b棚n ngoi
- AssignUserId site1.vmware.lab site1.vmware.lab t畉t c畉 m畛i ti nguy棚n trong th動
m畛c ch畛a d畛 li畛u c畛a website ny 畛u ch畉y d動畛i quy畛n user site1.vmware.lab
- upload_tmp_dir thu muc khi uplad file len wweb
- session.save_path thu muc de luu phien lam viec cua website
3.4 D畛ch v畛 Mail Server
3.4.1 Gi畛i thi畛u Mail Server
- Mail Server l m畛t m叩y ch畛 d湛ng 畛 nh畉n v g畛i mail
- Ch畛c nng c畛a Mail Server
+ Qu畉n l箪 account
+ Nh畉n mail c畛a ng動畛i g畛i (c畛a nh畛ng ng動畛i c坦 account) v g畛i cho ng動畛i nh畉n ho畉c
mail server c畛a ng動畛i nh畉n.
+ Nh畉n mail t畛 mail server c畛a ng動畛i g畛i (t畛 b棚n ngoi) v ph但n ph畛i mail cho ng動畛i
trong h畛 th畛ng.
Trang 37
+ T湛y thu畛c vo vi畛c ci 畉t m mail-server cho phep ng動畛i d湛ng s畛 d畛ng web-mail
(web) 畛 nh畉n mail (gi畛ng yahoo), hay cho ph辿p s畛 d畛ng outlook (application), hay c畉 2
(gi畛ng nh動 gmail)
3.4.2 C畉u h狸nh MailServer
 Ci 畉t v c畉u h狸nh POSTFIX
- Tao group va user
groupadd vmail -g 2222
useradd vmail -r -g 2222 -u 2222 -d /var/vmail -m -c "mail user"
- Ch畛nh s畛a file c畉u h狸nh postfix
cp /etc/postfix/main.cf /etc/postfix/main.cf.bak
cat /dev/null > /etc/postfix/main.cf
vi /etc/postfix/main.cf
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
mail_owner = postfix
unknown_local_recipient_reject_code = 550
alias_maps = hash:/etc/postfix/aliases
alias_database = $alias_maps
inet_interfaces = all
inet_protocols = ipv4
mydestination = $myhostname, localhost.$mydomain, localhost
Trang 38
debug_peer_level = 2
debugger_command =
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
ddd $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
html_directory = no
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix-2.6.6/samples
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
relay_domains = *
virtual_alias_maps=hash:/etc/postfix/vmail_aliases
virtual_mailbox_domains=hash:/etc/postfix/vmail_domains
virtual_mailbox_maps=hash:/etc/postfix/vmail_mailbox
virtual_mailbox_base = /var/vmail
virtual_minimum_uid = 2222
virtual_transport = virtual
virtual_uid_maps = static:2222
virtual_gid_maps = static:2222
smtpd_sasl_auth_enable = yes
smtpd_sasl_type = dovecot
Trang 39
smtpd_sasl_path = /var/run/dovecot/auth-client
smtpd_sasl_security_options = noanonymous
smtpd_sasl_tls_security_options = $smtpd_sasl_security_options
smtpd_sasl_local_domain = $mydomain
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated,
reject_unauth_destination
smtpd_relay_restrictions = permit_mynetworks, permit_sasl_authenticated,
reject_unauth_destination
- T畉o file c畉u h狸nh vmail_domain. D畛 th棚m 1 virtual domain
- vi /etc/postfix/vmail_domains
- vmware.lab OK
- T畉o file c畉u h狸nh vmail_mailbox. N董i 畛 ch畛a h畛p th動
vi /etc/postfix/vmail_mailbox
info@vmware.lab vmware.lab/info/
- T畉o file c畉u h狸nh vmail_aliases. X叩c inh t棚n b鱈 danh
vi /etc/postfix/vmail_aliases
info@vmware.lab info@vmware.lab
- N畉p files c畉u h狸nh
postmap /etc/postfix/vmail_domains
postmap /etc/postfix/vmail_mailbox
postmap /etc/postfix/vmail_aliases
Trang 40
touch /etc/postfix/aliases
- Ch畛nh s畛a c畉u h狸nh trong file master.cf
vi /etc/postfix/master.cf
#Dong 12
submission inet n - n - - smtpd
 Ci 畉t v c畉u h狸nh DOVECOT
yum install dovecot
- Ch畛nh s畛a file c畉u h狸nh dovecot
cp /etc/dovecot/dovecot.conf /etc/dovecot/dovecot.conf.bak
cat /dev/null > /etc/dovecot/dovecot.conf
vi /etc/dovecot/dovecot.conf
listen = *
ssl = no
protocols = imap lmtp
disable_plaintext_auth = no
auth_mechanisms = plain login
mail_access_groups = vmail
default_login_user = vmail
first_valid_uid = 2222
first_valid_gid = 2222
#mail_location = maildir:~/Maildir
mail_location = maildir:/var/vmail/%d/%n
passdb {
Trang 41
driver = passwd-file
args = scheme=SHA1 /etc/dovecot/passwd
}
userdb {
driver = static
args = uid=2222 gid=2222 home=/var/vmail/%d/%n allow_all_users=yes
}
service auth {
unix_listener auth-client {
group = postfix
mode = 0660
user = postfix
}
user = root
}
service imap-login {
process_min_avail = 1
user = vmail
}
- Hash password
touch /etc/dovecot/passwd
doveadm pw -s sha1 | cut -d '}' -f2
vi /etc/dovecot/passwd
Trang 42
info@vmware.lab:fCIvspJ9goryL1khNOiTJIBjfA0=
- G畉n quy畛n cho file passwd
chown root: /etc/dovecot/passwd
chmod 600 /etc/dovecot/passwd
- Kh畛i 畛ng d畛ch v畛
chkconfig postfix on
chkconfig dovecot on
service postfix restart
service dovecot restart
/etc/init.d/iptables stop
- T動董ng t畛
K畉t Qu畉:
- T畉o 2 ti kho畉n tr棚n Thunderbird
Trang 43
- 2 ti kho畉n ny g畛i mail qua l畉i cho nhau
 Ci 畉t v thi畉t l畉p giao di畛n Webmail Roundcube
- Gi炭p ng動畛i d湛ng qu畉n l箪 v s畛 d畛ng d畛ch v畛 mail m畛t c叩ch hi畛u qu畉 nh畉t, 但y l
ch動董ng tr狸nh c坦 giao di畛n th但n thi畛n, d畛 s畛 d畛ng, ph湛 h畛p v畛i 畉i a s畛 ng動畛i d湛ng
Trang 44
- M叩y 達 ci s畉n LAMP (Linux Apache MySQL and PHP )
- Link tham kh畉o :https://www.rosehosting.com/blog/how-to-install-lamp-linux-
apache-mysql-and-php-on-centos-6-with-phpmyadmin-and-apc-cache/
- Thi畉t l畉p databases cho Roundcube
mysql -u root -p
mysql> CREATE DATABASE IF NOT EXISTS `roundcube`;
mysql> GRANT ALL PRIVILEGES ON `roundcube` . * TO 'roundcube'@'localhost'
IDENTIFIED BY 'mySecretPassword';
mysql> FLUSH PRIVILEGES;
mysql> quit
- Tr動畛c khi t畉i v ci 畉t roundcube. Ta t畉o file c畉u h狸nh Roundcube Apache
vi /etc/httpd/conf.d/90-roundcube.conf
Alias /webmail /var/www/html/roundcube
<Directory /var/www/html/roundcube>
Options -Indexes
AllowOverride All
</Directory>
<Directory /var/www/html/roundcube/config>
Order Deny,Allow
Deny from All
</Directory>
<Directory /var/www/html/roundcube/temp>
Order Deny,Allow
Trang 45
Deny from All
</Directory>
<Directory /var/www/html/roundcube/logs>
Order Deny,Allow
Deny from All
</Directory>
- T畉i v ci 畉t Roundcube
curl -L
"http://sourceforge.net/projects/roundcubemail/files/latest/download?source=files" >
/tmp/roundcube-latest.tar.gz
tar -zxf /tmp/roundcube-latest.tar.gz -C /var/www/html
rm -rf /tmp/roundcube-latest.tar.gz
cd /var/www/html
mv roundcubemail-* roundcube
chown root: -R roundcube/
chown apache: -R roundcube/temp/
chown apache: -R roundcube/logs/
- T畉o b畉ng databases c畉n thi畉t cho roundcube
mysql -u roundcube -p"mySecretPassword" roundcube <
roundcube/SQL/mysql.initial.sql
- Client: server.vmware.lab/webmail/installer
- Copy file config.inc.php vo /var/www/html/roundcube/config/
Trang 46
vi config.inc.php
- X坦a file installer
rm -rf roundcube/installer/
- Kh畛i 畛ng l畉i d畛ch v畛
/etc/init.d/httpd restart
/etc/init.d/httpd restart
/etc/init.d/iptables stop
- M畛 Client : server.vmware.lab/webmail
3.5 S畛 d畛ng CA Server t畉o ch畛ng ch畛 SSL
3.5.1 Gi畛i thi畛u ch畛ng ch畛 SSL
- SSL l vi畉t t畉t c畛a t畛 Secure Sockets Layer. 但y l m畛t ti棚u chu畉n an ninh c担ng ngh畛
ton c畉u t畉o ra m畛t li棚n k畉t gi畛a m叩y ch畛 web v tr狸nh duy畛t. Li棚n k畉t ny 畉m b畉o
t畉t c畉 d畛 li畛u trao 畛i gi畛a m叩y ch畛 web v tr狸nh duy畛t lu担n 動畛c b畉o m畉t v an
ton.SSL 畉m b畉o r畉ng t畉t c畉 c叩c d畛 li畛u 動畛c truy畛n gi畛a c叩c m叩y ch畛 web v c叩c
tr狸nh duy畛t 動畛c mang t鱈nh ri棚ng t動, t叩ch r畛i. SSL l m畛t chu畉n c担ng ngh畛 動畛c s畛
Trang 47
d畛ng b畛i hng tri畛u trang web trong vi畛c b畉o v畛 c叩c giao d畛ch tr畛c tuy畉n v畛i kh叩ch
hng c畛a h畛.
- 畛 t畉o k畉t n畛i an ton ny, m畛t ch畛ng ch畛 SSL (c嘆n 動畛c g畛i l ch畛ng ch畛 s畛) 動畛c
ci 畉t tr棚n m叩y ch畛 web v th畛c hi畛n hai ch畛c nng
+ N坦 x叩c th畛c danh t鱈nh c畛a trang web (i畛u ny 畉m b畉o v畛i kh叩ch truy c畉p r畉ng h畛
ang kh担ng 畛 trang web gi畉 m畉o)
+ N坦 m達 h坦a d畛 li畛u ang 動畛c truy畛n i
- C畛ng ch畛 SSL 動畛c c畉p b畛i c叩c C董 quan qu畉n l箪 Ch畛ng ch畛 (Certificate Authorities,
CA), t畛 ch畛c 動畛c tin c畉y 畛 x叩c minh danh t鱈nh v t鱈nh h畛p ph叩p c畛a b畉t k畛 t畛 ch畛c
no y棚u c畉u ch畛ng ch畛.
3.5.2 T畉o ch畛ng ch畛 SSL tr棚n CA Server
 Tr棚n m叩y Linux
- Ci 畉t mod-ssl v openssl cho m叩y Web Server Apache
[root@vmware ~]# yum install mod_ssl openssl
- T畉o ra Certifcate Request Signed 畛ng v畛i m畛i website
- [root@vmware ~]# openssl req -new -newkey rsa:2048 -nodes -keyout
site1.vmware.lab.key -out site1.vmware.lab.csr
 Tr棚n m叩y Windows Server 2016
- Submit CSR c畛a site2.vmware.lab 畉n CA-Server v vo CA-SERVER 畛 ISSUSED
CERTIFICATE
 Tr棚n m叩y client Windows 10
- Download site2.vmware.lab certifcate
- Th畛c hi畛n convert certifcate t畛 u担i .cer chuy畛n thnh .crt
Trang 48
C:Userskatap>cd C:OpenSSLbin
C:OpenSSLbin>openssl.exe x509 -inform der -in site1.vmware.lab.cer -out
site1.vmware.lab.crt
- Copy c叩c file site1.vmware.lab.crt 畛 tr棚n vo m叩y linux
 Tr棚n m叩y Linux
- Copy Private Key vo folder Cert
[root@vmware ~]# cp -v site2.vmware.lab.key /cert/
- COPY FILE site2.vmware.lab.crt vo folder /cert 畛 tr棚n m叩y
- C畉u h狸nh NameBaseVirtualHost v畛i port 443
[root@vmware ~]# cd /etc/httpd/conf.d
[root@vmware conf.d]# vi vhost-ssl.conf
NameVirtualHost *:443
<VirtualHost *:443>
ServerAdmin admin@vmware.lab
ServerName site.vmware.lab
ServerAlias site1.vmware.lab
DocumentRoot /srv/www/site1.vmware.lab/public_html/
SSLEngine on
SSLCertificateFile /cert/site2.vmware.lab.crt
SSLCertificateKeyFile /cert/site2.vmware.lab.key
ErrorLog /srv/www/site1.vmware.lab/logs/error.log
CustomLog /srv/www/site1.vmware.lab/logs/access.log combined
</VirtualHost>-
Trang 49
- Kh畛i 畛ng l畉i httpd
[root@vmware conf.d]# /etc/init.d/httpd restart
K畉t Qu畉:
Trang 50
CH働NG 4: K畉T LU畉N
- Tuy th畛i gian th畛c t畉p 畛 Trung t但m Athena kh担ng 動畛c nhi畛u nh動ng c滴ng 畛 l畉i cho
em nh畛ng ki畉n th畛c b畛 鱈ch v nh畛ng kinh nghi畛m s畉 gi炭p 鱈ch cho em sau ny c坦 th畉
lm vi畛c t畛t h董n. Em c坦 動畛c nh畛ng ki畉n th畛c v kinh nghi畛m l 動畛c s畛 gi炭p 畛 t畉n
t狸nh c畛a Trung t但m, 畉c bi畛t l th畉y L棚 狸nh Nh但n trong su畛t th畛i gian qua 達 cho em
h畛c h畛i 動畛c th棚m r畉t nhi畛u i畛u. Nh畛ng k挑 nng lm vi畛c v b叩o c叩o c畛a em t畛t h董n.
Em 達 畉t 動畛c nh畛ng c担ng vi畛c sau:
+ Bi畉t s畛 d畛ng ISPConfig 畛 qu畉n tr畛 hosting, lm n畛n t畉ng 畛 c坦 th畛 s畛 d畛ng c叩c
Cpanel kh叩c
+ 動畛c tr畉i nghi畛m v tri畛n khai c叩c d畛ch v畛 tr棚n h畛 i畛u hnh Linux: Samba,
Lamp, Mail..
+ Bi畉t 動畛c nhi畛u h董n c叩c l畛nh c畛 b畉n tr棚n Linux
+ H畛c 動畛c c叩ch s畛a nh畛ng l畛i c董 b畉n tr棚n Linux
+ H畛c 動畛c c叩ch tr狸nh by, di畛n 畉t tr動畛c m畛i ng動畛i, tr動畛c camera
+ H畛c 動畛c c叩ch lm vi畛c 炭ng th畛i gian, ph但n b畛 c担ng vi畛c ph湛 h畛p
+ C畉i thi畛n 動畛c k挑 nng giao ti畉p, k畛 nng 畛ng x畛, th叩i 畛 lm vi畛c khi 動畛c c畉p
tr棚n giao ph坦
- Do th畛i gian th畛c t畉p ch動a l但u, ki畉n th畛c b畉n th但n c嘆n h畉n ch畉 n棚n d湛 達 c畛 g畉ng
nh動ng b叩o c叩o th畛c t畉p c畛a em s畉 kh担ng tr叩nh kh畛i s畛 sai s坦t, khuy畉t i畛m. Em r畉t
mong 動畛c s畛 g坦p 箪 ch畛 b畉o c畛a c叩c th畉y c担 畛 b叩o c叩o th畛c t畉p c畛a em hon ch畛nh
h董n.
Trang 51
PH畛 L畛C I: VIDEO QU TRNH TH畛C HI畛N
 Gi畛i thi畛u b畉n th但n
https://www.youtube.com/watch?v=cshUhIJSgs8
 S畛 d畛ng ISPConfig
https://www.youtube.com/watch?v=apS32CKMPb0
 Ci 畉t c畉u h狸nh Samba Server
https://www.youtube.com/watch?v=jm1uEr3yV9I
 Ci 畉t c畉u h狸nh webserver apache s畛 d畛ng apache-itk
https://www.youtube.com/watch?v=4fSjgU9IL1U
 Ci 畉t v c畉u hinh MailSerev v畛i postfix v dovecot
https://www.youtube.com/watch?v=DBKxPAy6vKU
 Ci 畉t v c畉u h狸nh webmail clien v畛i Roundcube
https://www.youtube.com/watch?v=0nILUrQUgxg&t=504s
 C畉p ch畛ng ch畛 SSL cho website tr棚n CA Server
https://www.youtube.com/watch?v=tU9FcHB7GHA
Trang 52
PH畛 L畛C II: TRCH D畉N NGU畛N THAM KH畉O
[1] L棚 狸nh Nh但n, Qu畉n Tr畛 M畉ng Linux LPI2, Athena. [Online].
Available: http://e-learning.athena.edu.vn/course/view.php?id=7 [Accesed 22-2-2017].
[2] RoseHosting, Mailserver with virtual users and domains using Postfix and Dovecot on a
CentOS 6 VPS, 2013.[Online].
Available: https://www.rosehosting.com/blog/mailserver-with-virtual-users-and-domains-using-
postfix-and-dovecot-on-a-centos-6-vps/ [Access 28-3-2017].
[3] RoseHosting, Install and set-up Roundcube webmail interface, 2013.[Online].
Available: https://www.rosehosting.com/blog/install-and-set-up-roundcube-webmail-interface/
[Accessed 30-3-2017].
[4] John C動畛ng, C畉u h狸nh SSL cho website th担ng qua CA tr棚n Windows Server 2008  Part 1,
2013.[Online].
Available: https://johncuongit.wordpress.com/2013/11/08/cau-hinh-ssl-cho-website-thong-qua-
ca-tren-windows-server-2008-part-1/ [Accessed 8-4-2017]
[4] John C動畛ng, C畉u h狸nh SSL cho website th担ng qua CA tr棚n Windows Server 2008  Part 2,
2013.[Online].
Available: https://johncuongit.wordpress.com/2013/11/08/cau-hinh-ssl-cho-website-thong-qua-
ca-tren-windows-server-2008-part-2/ [Accessed 10-4-2017]
[5] Athena, Gi畛i thi畛u Trung t但m Qu畉n Tr畛 M畉ng v An Ninh M畉ng Qu畛c T畉 Athena.[Online]
Available: http://athena.edu.vn/gioi-thieu/ [Accessed 21-2-2017]
Trang 53
[6] freelanceTEK.com, ISPConfig,2016.[Online]
Available: https://www.youtube.com/watch?v=fx5LCtDlNeU&list=PLkE-
4cQPDFuf4ZatH3_5yoWO4KzVGqgQp [Accessed 28-2-2017]
[7] Wikipedia, LAMP,2016.[Online]
Available: https://vi.wikipedia.org/wiki/LAMP [Accessed 25-4-2017]

More Related Content

Thuctap report

  • 2. Trang 1 畉I H畛C QU畛C GIA TP.H畛 CH MINH TR働畛NG 畉I H畛C CNG NGH畛 THNG TIN KHOA M畉NG MY TNH V TRUY畛N THNG BO CO TH畛C T畉P 畛 TI: TM HI畛U V THI畉T L畉P D畛CH V畛 TRN H畛 I畛U HNH LINUX C担ng ty th畛c t畉p: Trung T但m o T畉o Qu畉nTr畛 M畉ng v An Ninh M畉ng Qu畛c T畉 Athena Sinh vi棚n th畛c hi畛n: Vn H畛ng Th動 MSSV: 13520857 L畛p: MMTT2013 Ng動畛i h動畛ng d畉n: L棚 狸nh Nh但n TP.H畛 Ch鱈 Minh, ngy 26 th叩ng 4 nm 2017
  • 3. Trang 2 L畛I C畉M N ................................................................................................................................. 3 NH畉N XT C畛A N V畛 TH畛C T畉P ....................................................................................... 4 NH畉N XT C畛A KHOA .............................................................................................................. 5 CH働NG 1: GI畛I THI畛U V畛 N V畛 TH畛C T畉P................................................................... 6 1.1 Gi畛i thi畛u chung............................................................................................................... 6 1.2 L挑nh v畛c ho畉t 畛ng .......................................................................................................... 6 1.3 畛i ng滴 nh但n s畛 ............................................................................................................... 8 1.4 C董 s畛 v畉t ch畉t................................................................................................................... 8 1.5 D畛ch v畛 h畛 tr畛................................................................................................................... 8 CH働NG 2: TH畛NG K QU TRNH TH畛C T畉P T畉I TRUNG TM.................................. 9 2.1 Th畛i gian th畛c t畉p ................................................................................................................. 9 2.2 Li畛t k棚 n畛i dung th畛c t畉p....................................................................................................... 9 CH働NG 3: N畛I DUNG TH畛C T畉P CHI TI畉T ...................................................................... 10 3.1 S畛 d畛ng ISPConfig Server ............................................................................................. 10 3.1.1 Gi畛i thi畛u v畛 qu畉n tr畛 hosting tr棚n ISPConfig Server............................................. 10 3.1.2 S畛 d畛ng ISPConfg Server....................................................................................... 11 3.2 D畛ch V畛 Samba Server................................................................................................... 17 3.2.1 Gi畛i thi畛u Samba .................................................................................................... 17 3.2.2 C畉u h狸nh Samba ...................................................................................................... 18 3.3 D畛ch v畛 Lamp Server ..................................................................................................... 28 3.3.1 Gi畛i thi畛u Lamp Server........................................................................................... 28 3.3.2 C畉u h狸nh Lamp Server ............................................................................................ 29 3.4 D畛ch v畛 Mail Server ....................................................................................................... 36 3.4.1 Gi畛i thi畛u Mail Server ............................................................................................ 36 3.4.2 C畉u h狸nh MailServer ............................................................................................... 37 3.5 S畛 d畛ng CA Server t畉o ch畛ng ch畛 SSL.......................................................................... 46 3.5.1 Gi畛i thi畛u ch畛ng ch畛 SSL........................................................................................ 46 3.5.2 T畉o ch畛ng ch畛 SSL tr棚n CA Server ........................................................................ 47 CH働NG 4: K畉T LU畉N ............................................................................................................ 50 PH畛 L畛C I: VIDEO QU TRNH TH畛C HI畛N ....................................................................... 51 PH畛 L畛C II: TRCH D畉N NGU畛N THAM KH畉O ................................................................. 52
  • 4. Trang 3 L畛I C畉M N Tr但n tr畛ng g畛i l畛i c畉m 董n 畉n Trung t但m o T畉o Qu畉n Tr畛 M畉ng v An Ninh M畉ng Qu畛c T畉 Athena 達 t畉o i畛u ki畛n cho em c坦 c董 h畛i 動畛c th畛c t畉p t畉i Trung t但m. Ch畛 trong m畛t th畛i gian ng畉n, nh動ng nh畛 s畛 ch畛 d畉n nhi畛t t狸nh c畛a c叩c th畉y c担 t畉i Trung t但m. 畉c bi畛t l th畉y L棚 狸nh Nh但n 達 t畉n t狸nh gi炭p 畛 c畉 nh畛ng kh坦 khn trong c担ng vi畛c, 畉n nh畛ng kh坦 khn vi畛c lm quen v畛i m担i tr動畛ng m畛i, t畉o i畛u ki畛n cho em h畛c h畛i kinh nghi畛m th畛c t畉 畛 th畛c hi畛n 畛 ti. Ch但n thnh c畉m 董n th畉y 達 b畛 ra nhi畛u th畛i gian, c担ng s畛c 畛 h動畛ng d畉n em hon thnh 畛t th畛c t畉p ny. K鱈nh ch炭c m畛i ng動畛i lu担n vui v畉 h畉nh ph炭c, d畛i do s畛c kh畛e v thnh c担ng trong c担ng vi畛c. Em xin ch但n thnh c畉m 董n!
  • 5. Trang 4 NH畉N XT C畛A N V畛 TH畛C T畉P .... TP.H畛 Ch鱈 Minh, ngy th叩ng nm 2017
  • 6. Trang 5 NH畉N XT C畛A KHOA .... TP.H畛 Ch鱈 Minh, ngy th叩ng nm 2017
  • 7. Trang 6 畉nh ch畛p v畛i Gi叩m 畛c Trung t但m V探 畛 Th畉ng v nh坦m th畛c t畉p CH働NG 1: GI畛I THI畛U V畛 N V畛 TH畛C T畉P 1.1 Gi畛i thi畛u chung. Trung T但m o T畉o Qu畉n Tr畛 M畉ng & An Ninh M畉ng Qu畛c T畉 ATHENA 動畛c thnh l畉p t畛 nm 2004, l m畛t t畛 ch畛c qui t畛 nhi畛u tr鱈 th畛c Vi畛t Nam 畉y nng 畛ng, nhi畛t huy畉t v kinh nghi畛m trong l挑nh v畛c CNTT, v畛i t但m huy畉t g坦p ph畉n vo c担ng cu畛c th炭c 畉y ti畉n tr狸nh 動a c担ng ngh畛 th担ng tin l ngnh kinh t畉 m滴i nh畛n, g坦p ph畉n ph叩t tri畛n n動畛c nh . 1.2 L挑nh v畛c ho畉t 畛ng - Trung t但m ATHENA 達 v ang t畉p trung ch畛 y畉u vo o t畉o, t動 v畉n, cung c畉p nh但n l畛c chuy棚n s但u trong l挑nh v畛c qu畉n tr畛 m畉ng, an ninh m畉ng, th動董ng m畉i i畛n t畛, truy畛n
  • 8. Trang 7 th担ng x達 h畛i ( social Network) theo c叩c ti棚u chu畉n qu畛c t畉 c畛a c叩c h達ng n畛i ti畉ng nh動 Microsoft, Cisco, Oracle, Linux LPI , AEH, Song song 坦, trung t但m ATHENA c嘆n c坦 nh畛ng ch動董ng tr狸nh o t畉o cao c畉p dnh ri棚ng theo 董n 畉t hng c畛a c叩c 董n v畛 nh動 B畛 Qu畛c Ph嘆ng, B畛 C担ng An , ng但n hng, doanh nghi畛p SME, c叩c c董 quan ch鱈nh ph畛, t畛 ch畛c ti ch鱈nh.. - Sau h董n 10 nm ho畉t 畛ng,nhi畛u h畛c vi棚n t畛t nghi畛p trung t但m ATHENA 達 l chuy棚n gia 畉m nh畉n c担ng t叩c qu畉n l箪 h畛 th畛ng m畉ng, an ninh m畉ng, qu畉n l箪 h畛 th畛ng kinh doanh Online ( Internet Business) cho nhi畛u b畛 ngnh nh動 C畛c C担ng Ngh畛 Th担ng Tin B畛 Qu畛c Ph嘆ng , B畛 C担ng An, S畛 Th担ng Tin Truy畛n Th担ng c叩c t畛nh, S畛 Th動董ng M畉i,doanh nghi畛p SME.. - B棚n c畉nh 坦, Trung t但m ATHENA c嘆n c坦 nhi畛u ch動董ng tr狸nh h畛p t叩c v trao 畛i c担ng ngh畛 v畛i nhi畛u 畉i h畛c l畛n nh動 畉i h畛c B叩ch Khoa Thnh Ph畛 H畛 Ch鱈 Minh, H畛c Vi畛n An Ninh Nh但n D但n( Th畛 畛c), H畛c Vi畛n B動u Ch鱈nh Vi畛n Th担ng, Hi畛p h畛i an ton th担ng tin (VNISA), Vi畛n K畛 Thu畉t Qu但n S畛 , - Song song v畛i c叩c ho畉t 畛ng o t畉o, Trung t但m ATHENA c嘆n tham gia t動 v畉n 畛ng d畛ng c担ng ngh畛 vo n但ng cao nng su畉t lao 畛ng v cung c畉p nh但n s畛 cho hng ngn doanh nghi畛p SME ( kh畛i doanh nghi畛p v畛a v nh畛). Ho畉t 畛ng ny 動畛c c畛ng 畛ng doanh nghi畛p 叩nh gi叩 r畉t cao, mang l畉i l畛i 鱈ch thi畉t th畛c , doanh nghi畛p v畛a 動畛c t動 v畉n c担ng ngh畛 v畛a t狸m 動畛c ngu畛n nh但n l畛c ph湛 h畛p cho ho畉t 畛ng kinh doanh. 但y c滴ng l c董 s畛 畛 c叩c h畛c vi棚n t畛t nghi畛p ATHENA lu担n c坦 vi畛c lm theo 炭ng y棚u c畉u x達 h畛i
  • 9. Trang 8 1.3 畛i ng滴 nh但n s畛 - T畉t c畉 c叩c gi畉ng vi棚n, chuy棚n vi棚n trung t但m ATHENA 畛u l c叩c chuy棚n gia trong l挑nh v畛c qu畉n tr畛 m畉ng, an ninh m畉ng, ph叩t tri畛n th動董ng m畉i i畛n t畛, kinh doanh tr棚n Internet v畛i nhi畛u nm kinh nghi畛m. B棚n c畉nh c担ng t叩c gi畉ng d畉y, c叩c gi畉ng vi棚n th動畛ng xuy棚n tham gia c叩c d畛 叩n t動 v畉n, tri畛n khai c担ng ngh畛 t畉i doanh nghi畛p v畛i m畛c 鱈ch 動a ki畉n th畛c c担ng ngh畛 vo ph叩t tri畛n kinh t畉 v c畉p nh畉t nh畛ng bi畉n 畛i th動畛ng xuy棚n c畛a x達 h畛i 畛 動a vo ch動董ng tr狸nh gi畉ng d畉y. - Ph動董ng ch但m ho畉t 畛ng c畛a 畛i ng滴 gi畉ng vi棚n ATHENA l Lu担n Lu担n S叩ng T畉o 畛 叩p 畛ng Nhu C畉u X達 H畛i. 1.4 C董 s畛 v畉t ch畉t - Thi畉t b畛 畉y 畛 v hi畛n 畉i - Ch動董ng tr狸nh c畉p nh畉t li棚n t畛c, b畉o 畉m h畛c vi棚n lu担n ti畉p c畉n v畛i nh畛ng c担ng ngh畛 m畛i nh畉t 1.5 D畛ch v畛 h畛 tr畛 - 畉m b畉o vi畛c lm cho h畛c vi棚n t畛t nghi畛p - Gi畛i thi畛u vi畛c lm cho m畛i h畛c vi棚n - Th畛c t畉p c坦 l動董ng cho h畛c vi棚n 叩p 畛ng 動畛c y棚u c畉u - Ngoi gi畛 h畛c ch鱈nh th畛c, h畛c vi棚n 動畛c th畛c hnh th棚m mi畛n ph鱈, kh担ng gi畛i h畉n th畛i gian. - H畛 tr畛 k畛 thu畉t kh担ng th畛i h畉n trong t畉t c畉 c叩c l挑nh v畛c li棚n quan 畉n m叩y t鱈nh, m畉ng m叩y t鱈nh, b畉o m畉t m畉ng, ph叩t tri畛n Internet Business - H畛 tr畛 thi Ch畛ng ch畛 Qu畛c t畉.
  • 10. Trang 9 CH働NG 2: TH畛NG K QU TRNH TH畛C T畉P T畉I TRUNG TM 2.1 Th畛i gian th畛c t畉p - Th畛i gian b畉t 畉u: 21/2/2017 - Th畛i gian k畉t th炭c: 23/4/2017 - Gi畛 th畛c t畉p t畉i Trung t但m: 9h 畉n 16h, 3 bu畛i 1 tu畉n 2.2 Li畛t k棚 n畛i dung th畛c t畉p B畉ng b棚n d動畛i l n畛i dung c担ng vi畛c trong su畛t qu叩 tr狸nh th畛c t畉p Th畛i gian N畛i dung c担ng vi畛c Tu畉n 1 (21/2/2017 26/2/2017) - G畉p GVHD nh畉n 畛 ti v ti li畛u h動畛ng d畉n - T狸m hi畛u v畛 Trung t但m - Quay clip gi畛i thi畛u v畛 b畉n th但n Tu畉n 2 (27/2/2017 5/3/2017) - S畛 d畛ng ISPConfig - Quay clip h動畛ng d畉n s畛 d畛ng ISPCongfig Tu畉n 3 (6/3/2017 12/3/2017) - T狸m hi畛u c畉u h狸nh d畛ch v畛 Samba Server - Quay clip h動畛ng d畉n c畉u h狸nh d畛ch v畛 Samba Server Tu畉n 4 (13/3/2017 19/3/2017) - T狸m hi畛u c畉u h狸nh d畛ch LAMP Server - Ci 畉t v c畉u hinh cho webserver apache s畛 d畛ng apache-itk Tu畉n 5 (20/3/2017 26/3/2017) - Quay clip h動畛ng d畉n ci 畉t v c畉u hinh cho webserver apache s畛 d畛ng apache-itk - Tham gia bu畛i ph畛ng v畉n th畛 t畉i Trung t但m Tu畉n 6 (27/3/2017 2/4/2017) - T狸m hi畛u c畉u h狸nh d畛ch v畛 Mail Server v畛i postfix v dovecot - Ci 畉t webmail v畛i Roudcube Tu畉n 7 (3/4/2017 9/4/2017) - Quay video h動畛ng d畉n c畉u h狸nh d畛ch v畛 Mail Server v畛i postfix v dovecot - Quay video h動畛ng d畉n ci 畉t webmail v畛i Roudcube - T狸m hi畛u ci 畉t v c畉u h狸nh CA-Server Tu畉n 8 (10/4/2017 16/4/2017) - T狸m hi畛u s畛 d畛ng CA-Server 畛 c畉p ch畛ng ch畛 cho website - Quay clip h動畛ng d畛ng s畛 d畛ng d畛ng CA-Server 畛 c畉p ch畛ng ch畛 cho website Tu畉n 9 (17/4/2017 23/4/2017) - T畛ng h畛p v lm b叩o c叩o t畛ng k畉t
  • 11. Trang 10 CH働NG 3: N畛I DUNG TH畛C T畉P CHI TI畉T 3.1 S畛 d畛ng ISPConfig Server 3.1.1 Gi畛i thi畛u v畛 qu畉n tr畛 hosting tr棚n ISPConfig Server - ISPConfig 動畛c ph叩t tri畛n b畛i c担ng ty projektfarm GmbH c畛a 畛c, l m畛t trong s畛 hi畉m hoi ch動董ng tr狸nh qu畉n l箪 hosting tr棚n m達 ngu畛n m畛 (BSD license). V畛i c叩c t鱈nh nng qu畉n l箪 chuy棚n nghi畛p v d畛 s畛 d畛ng ch畉c h畉n ISPConfig s畉 l l畛a ch畛n t畛t cho Sinh Vi棚n, c叩c nh但n v Doanh nghi畛p 動a chu畛n m達 ngu畛n m畛. - ISPConfig 3 l 1 lo畉i cpanel m達 ngu畛n m畛 dnh ri棚ng cho h畛 th畛ng Linux. N坦 cho ph辿p qu畉n l箪 muti server th担ng qua 1 h畛 th畛ng control cpanel - M畛t s畛 d畛ch v畛 ISPConfig c坦 th畛 qu畉n l箪: + Qu畉n tr畛 1 ho畉c nhi畛u server th担ng qua Control Panel + Cho ph辿p qu畉n l箪 a c畉p + Ti kho畉ng ng動畛i d湛ng email 動畛c cung c畉p b畛i roundcube + Httpd (virtual hosts, domain and IP based) + FTP + Bind (A, CNAME, MX and SPF Records) + POP3 Auto-Responder + MySQL client-databases + Harddisk quota + Mail-Quota + Traffic limits + IP-addresses + SSL
  • 12. Trang 11 - H畛 tr畛 c叩c ng担n ng畛: + English + German + French + Spanish + Dutch + Italian + Polish + Swedish + Brazilian Portuguese + Greek + Romanian + Russian 3.1.2 S畛 d畛ng ISPConfg Server - Ci 畉t Client v Website
  • 13. Trang 12 - Ci 畉t DNS
  • 14. Trang 13 K畉t Qu畉: - Ci 畉t FTP
  • 15. Trang 14 - Ci 畉t Email
  • 16. Trang 15 K畉t Qu畉: - Ci 畉t WordPress v Database
  • 17. Trang 16 - T畉o Subdomain
  • 18. Trang 17 K畉t Qu畉: 3.2 D畛ch V畛 Samba Server 3.2.1 Gi畛i thi畛u Samba - Samba l d畛ch v畛 c畛a h畛 i畛u hnh Linux, ch畉y tr棚n n畛n giao th畛c SMB (Server Message Block) cho phep chia s畉 file h畛 th畛ng, m叩y in v畛i c叩c m叩y ch畉y Win95, 98 ho畉c NT. SMB l giao th畛c 動畛c c叩c h畛 i畛u hnh c畛a Microsoft s畛 d畛ng 畛 chia s畉
  • 19. Trang 18 d畛 li畛u qua m畉ng. V畛i Linux Samba c滴ng d畛a vo giao th畛c SMB 畛 vi畉t ra m畛t s畛 ti畉n tr狸nh i畛n h狸nh nh動 smbd, nmbd, 畛 n坦i chuy畛n v畛i c叩c h畛 i畛u hnh c畛a Microsoft 畛 ng動畛i d湛ng c坦 th畛 lm vi畛c v畛i m叩y Linux qua Network Neighborhood. 3.2.2 C畉u h狸nh Samba C畉u h狸nh SAMBA Server Full Permission - - Install Samba server [root@centos1 ~]# yum install samba - thi畉t l畉p folder shared v c畉u h狸nh permission [root@centos1 ~]# mkdir -p /data/share => t畉o ra folder d湛ng 畛 shared d畛 li畛u [root@centos1 ~]# chmod 777 /data/share/ => c畉p quy畛n 777 cho folder ny, nh動 v畉y OTHER s畉 ton quy畛n tr棚n folder ny - Ch畛nh s畛a file c畉u hinh Samba [root@centos1 ~]# vi /etc/samba/smb.conf #Di den dong 58 sau [global] unix charset = UTF-8 dos charset = CP932 #Dong 75 thay doi gia tri workgroup = WORKGROUP netbios name = centos1 hosts allow = 127. 192.168.12. 192.168.13. 192.168.1. interfaces = lo eth1 192.168.1.13/24 #Dong 102
  • 20. Trang 19 security = share passdb backend = tdbsam #Them vao cuoi cung file cau hinh [Share] path = /data/share writable = yes guest ok = yes guest only = yes create mode = 0777 directory mode = 0777 fully accessed share modes = yes - Start Samba Server [root@server ~]# /etc/init.d/smb start Starting SMB services: [ OK ] [root@server ~]# /etc/init.d/iptables stop C畉u h狸nh SAMBA v ph但n quy畛n theo user - K鱈ch ho畉t t鱈nh nng ACL cho partition [root@centos1 share]# vi /etc/fstab => kich hoat tinh nang ACL cho phan vung "/" - T畉o ra folder "/data/share" v s畛 d畛ng ACL 畛 ph但n quy畛n [root@centos1 share]# mkdir /data/share [root@centos1 share]# groupadd student [root@centos1 share]# groupadd teacher
  • 21. Trang 20 [root@centos1 share]#useradd -g student user1 [root@centos1 share]#useradd -g student user2 [root@centos1 share]#useradd -g teacher gv1 [root@centos1 share]#useradd -g teacher gv2 - [root@vmware data]# cd /data [root@vmware data]# chmod 750 share => nh動 v畉y OTHER s畉 kh担ng c坦 quy畛n tr棚n folder share - S畛 d畛ng ACL 畛 ph但n quy畛n cho t畛ng lo畉i group kh叩c nhau [root@vmware data]# setfacl -m g:student:r-x share/ [root@vmware data]# setfacl -m g:teacher:rwx share/ - Ki畛m tra l畉i c叩c quy畛n 動畛c g叩n cho group student v teacher [root@vmware data]# getfacl share/ # file: share/ # owner: root # group: root user::rwx group::r-x group:student:rwx group:teacher:rwx mask::rwx other::r-x
  • 22. Trang 21 - S畛 d畛ng "smbpasswd" 畛 t畉o ra password cho c叩c user [root@vmware data]#smbpasswd -a user1 New Password: 123 Retype Password: 123 [root@vmware data]#smbpasswd -a user2 [root@vmware data]#smbpasswd -a gv1 [root@vmware data]#smbpasswd -a gv2 - C畉u h狸nh Samba server 畛 file "/etc/samba/smb.conf" [root@vmware data]# vi /etc/samba/smb.conf #Di den dong 58 sau [global] unix charset = UTF-8 dos charset = CP932 #Dong 75 thay doi gia tri workgroup = WORKGROUP netbios name = Centos_Server hosts allow = 127. 192.168.12. 192.168.13. 192.168.1. interfaces = lo eth1 192.168.1.13/24 #Di den dong 102 thay doi gia tri security = user => su dung username va password de xac thuc
  • 23. Trang 22 - C畉u h狸nh t畉o folder shared s畛 d畛ng username v password 畛 x叩c th畛c. V ch畛 c坦 user thu畛c group teacher v student 動畛c k畉t n畛i vo. [Shared_Security] comment = Samba Shared path = /data/share writable = yes create mode = 0775 directory mode = 0770 share modes = yes guest ok = no valid users = @teacher @student - Restart d畛ch v畛 Samba [root@server data]# /etc/init.d/smb restart - T畉i client window 7 th畛 k畉t n畛i vo SAMBA SERVER
  • 24. Trang 23 - Su dung "veto file" va "hide files" + veto files: khong cho phep mot loai file nao do + hiden files: an loai nao do [Shared_Security] comment = Samba Shared path = /data/share writable = yes create mode = 0775 directory mode = 0770 share modes = yes guest ok = no valid users = @teacher @student
  • 25. Trang 24 #Su dung "veto files" khong cho phep ghi file .exe vao folder shared veto files = /*.exe #Su dung "hide files", cac file .rar khi ghi vao folder se bi hidden hide files = /*.rar K畉t Qu畉: - Kh担ng cho ph辿p ghi file .exe
  • 26. Trang 25 - 畉n file .rar S畛 d畛ng "Sticky Bit" k畉t h畛p v畛i SAMBA
  • 27. Trang 26 - Shared voi "Sticky Bit" ( user owner va user Root co quyen Rename va Xoa File. User cung 1 group khong xoa duoc file) - Ta k鱈ch ho畉t t鱈nh nng Sticky Bit cho folder /data/share [root@server data]# chmod o+t share/ - Ta c畉u h狸nh l畉i file /etc/samba/smb.conf [Shared_Security] comment = Samba Shared path = /data/share writable = yes create mode = 1770 create mask = 1770 force create mode= 1770 directory mode = 1770 directory mask = 1770 force directory mode = 1770 share modes = yes guest ok = no valid users = @teacher @student
  • 28. Trang 27 - Restart d畛ch v畛 Samba [root@server data]# /etc/init.d/smb restart - Ki畛m tra k畉t n畛i t畉i window 7 Khi ng nh畉p ti kho畉n gv2 畛 xoa file gv1 達 t畉o => H畛 th畛ng b叩o kh担ng c坦 quy畛n
  • 29. Trang 28 3.3 D畛ch v畛 Lamp Server 3.3.1 Gi畛i thi畛u Lamp Server - LAMP l ch畛 vi畉t t畉t th動畛ng 動畛c d湛ng 畛 ch畛 s畛 s畛 d畛ng c叩c ph畉n m畛m Linux, Apache, MySQL v ng担n ng畛 vn l畛nh PHP hay Perl hay Python 畛 t畉o n棚n m畛t m担i tr動畛ng m叩y ch畛 Web c坦 kh畉 nng ch畛a v ph但n ph畛i c叩c trang Web 畛ng. + Linux: Linux l m畛t h畛 i畛u hnh. V畛 m畉t nguy棚n t畉c h畛 i畛u hnh c滴ng l m畛t software; nh動ng 但y l m畛t software 畉c bi畛t 動畛c d湛ng 畛 qu畉n l箪, i畛u ph畛i c叩c ti nguy棚n (resource) c畛a h畛 th畛ng (bao g畛m c畉 hardware v c叩c software kh叩c). + Apache: l ph畉n m畛m m叩y ch畛 web ph畛 bi畉n nh畉t tr棚n m畉ng. N坦 r畉t an ton, nhanh ch坦ng, v 叩ng tin c畉y. Ch炭ng ta c坦 th畛 t湛y ch畛nh 畛 Apache h畛 tr畛 c叩c ng担n nh畛 web kh叩c nhau nh動 PHP, CGI / Perl, SSL, SSI, ePerl, v th畉m ch鱈 ASP. + MySQL l h畛 qu畉n tr畛 c董 s畛 d畛 li畛u nhanh nh畉t tr棚n th畉 gi畛i, n坦 tr畛 thnh c董 s畛 d畛 li畛u ngu畛n m畛 ph畛 bi畉n nh畉t tr棚n th畉 gi畛i v狸 hi畛u su畉t cao, 畛 tin c畉y cao v d畛 s畛 d畛ng. N坦 r畉t t畛t cho c叩c 畛ng d畛ng d畛a tr棚n web. R畉t nhi畛u c叩c c担ng c畛 h畛 tr畛 達 動畛c ph叩t tri畛n cho MySQL v畛i PHP, ch畉ng h畉n nh動 phpMyAdmin l m畛t c担ng c畛 qu畉n tr畛 web r畉t t畛t cho MySQL, v gi炭p b畉n c坦 th畛 lm b畉t c畛 i畛u g狸 m b畉n mong mu畛n v畛i MySQL. N坦 c滴ng l s畛 l畛a ch畛n cho m畛t th畉 h畛 m畛i c叩c 畛ng d畛ng 動畛c x但y d畛ng tr棚n LAMP. + PHP 動畛c ph叩t tri畛n nh動 l m畛t ng担n ng畛 k畛ch b畉n tr棚n m叩y ch畛 (server-side scripting language). N坦 動畛c ph叩t tri畛n b畛i Rasmus Lerdorf, v nh畛ng ng動畛i kh叩c. Hi畛n t畉i, c叩c phi棚n b畉n c畛a n坦 c坦 nhi畛u l畛i th畉 h董n c叩c 畛i th畛 c畉nh tranh nh動 ASP, Cold Fusion, Perl, Java,... ch畉ng h畉n nh動 v畛 h動畛ng 畛i t動畛ng v kh畉 nng nh炭ng vo ng担n ng畛 HTML 動畛c x畛 l箪 r畉t nhanh, t動董ng th鱈ch v畛i nhi畛u n畛n t畉ng h畛 i畛u hnh, ho畉t 畛ng nh動 m畛t thnh
  • 30. Trang 29 ph畉n c畛a Apache. N坦 動畛c c畉p nh畉t li棚n t畛c c叩c k畛 thu畉t m畛i b畉ng c叩ch vay m動畛n nh畛ng t鱈nh nng t畛t nh畉t t畛 nhi畛u ng担n ng畛 l畉p tr狸nh kh叩c. 3.3.2 C畉u h狸nh Lamp Server Ci 畉t v c畉u h狸nh web server Apache - Ci 畉t web server Apache v k鱈ch ho畉t cho web server ho畉t 畛ng [root@srv01 ~]# yum install httpd => ci 畉t web server Apache [root@srv01 ~]# /etc/init.d/httpd start => kh畛i 畛ng web server apache - Thi畉t l畉p c叩c th担ng s畛 ton c畛c cho web server Apache [root@server /]# vi /etc/httpd/conf/httpd.conf #Dong 44 thay doi gia tri ServerTokens Athena #Dong 136 Listen 80 #Dong 221 Include conf.d/*.conf #Dong 262 thay doi gia tri ServerAdmin admin@athena.lab #Dong 276 thay doi gia tri ServerName www.athena.lab:80 #Dong 292
  • 31. Trang 30 DocumentRoot "/var/www/html" #Dong 331 thay doi gia tri Options FollowSymLinks ExecCGI #Dong 338 AllowOverride All #Dong 402 DirectoryIndex index.html index.html.var index.cgi index.php #Dong 536 ServerSignature Off #Dong 759 - Them Dau "#" khong su dung UTF-8 # AddDefaultCharset UTF-8 #Dong 796 AddHandler cgi-script .cgi .pl Thi畉t l畉p NameBase VirtualHost [root@server html]# cd /etc/httpd/conf.d/ [root@server conf.d]# vi vhost.conf NameVirtualHost *:80 <VirtualHost *:80> ServerAdmin vanthu1@vmware.lab ServerName vanthu1.vmware.lab
  • 32. Trang 31 ServerAlias vanthu1.vmware.lab DocumentRoot /srv/www/ vanthu1.vmware.lab/public_html/ ErrorLog /srv/www/ vanthu1.vmware.lab/logs/error.log CustomLog /srv/www/vanthu1.vmware.lab/logs/access.log combined </VirtualHost> - T畉o c叩c file v folder theo c畉u tr炭c 畛 tr棚n [root@srv01 ~]# mkdir -p /srv/www/vanthu1.vmware.lab/public_html/ [root@srv01 ~]# mkdir -p /srv/www/vanthu1.vmware.lab/logs/ [root@srv01 ~]# touch /srv/www/vanthu1.vmware.lab/logs/error.log [root@srv01 ~]# touch /srv/www/vanthu1.vmware.lab/logs/access.log Thi畉t l畉p c董 s畛 d畛 li畛u cho c叩c website - Ci 畉t thnh ph畉n database server v 畛nh ngh挑a username v password 畛 truy c畉p vo database server [root@srv01 ~]# yum install mysql-server [root@srv01 ~]# /etc/init.d/mysqld start [root@srv01 ~]# mysql_secure_installation => l畉n 畉u ti棚n th狸 ENTER => thi畉t l畉p password cho user "root" c畛a database server [root@srv01 ~]# mysql -u root -p654321 mysql> create database vanthu1; Query OK, 1 row affected (0.00 sec) mysql> CREATE USER 'vanthu1@'localhost' IDENTIFIED BY 'vanthu1_password';
  • 33. Trang 32 Query OK, 0 rows affected (0.00 sec) mysql> GRANT ALL PRIVILEGES ON site1.* TO 'vanthu1'@'localhost'; Query OK, 0 rows affected (0.00 sec) mysql> exit - Ci 畉t ng担n ng畛 PHP [root@server ~]# yum -y install php-gd php-ncurses php-snmp php-mbstring php- mysql php-devel php-imap [root@server ~]# yum -y install php-odbc php-pear php-xml [root@server ~]# yum -y install php-xmlrpc php-dba php-pear-DB php-process php- pear-DB php-mcrypt Ci 畉t website th畛 nghi畛m [root@srv01 ~]# wget https://wordpress.org/latest.tar.gz [root@srv01 ~]# tar xf latest.tar.gz [root@srv01 ~]# cd wordpress/ [root@srv01 wordpress]# cp v -R * /srv/www/vanthu1.vmware.lab/public_html/ [root@srv01 wordpress]# cd /srv/www/vanthu1.vmware.lab/public_html/ [root@srv01 public_html]# [root@srv01 public_html]# cp wp-config-sample.php wp-config.php [root@srv01 public_html]# vi wp-config.php - 畛 m叩y t鱈nh client k畉t n畛i vo "http://vanthu1.vmware.lab" ki畛m tra k畉t n畛i vo trang web
  • 34. Trang 33 C畉u h狸nh cho web server apache s畛 d畛ng httpd-itk [root@srv01 ~]# yum install httpd-itk - B畉t t鱈nh nng http-itk cho trang web [root@srv01 ~]# vi /etc/sysconfig/httpd #Dong so 9 them vao noi dung HTTPD=/usr/sbin/httpd.itk - Thi畉t l畉p th担ng s畛 itk [root@srv01 ~]# vi /etc/httpd/conf.d/mpm-itk.conf <IfModule itk.c> StartServers 8 MinSpareServers 5
  • 35. Trang 34 MaxSpareServers 20 ServerLimit 256 MaxClients 256 MaxRequestsPerChild 4000 </IfModule> [root@srv01 ~]# vi /etc/httpd/conf.d/php.conf #Them vao noi dung <IfModule itk.c> LoadModule php5_module modules/libphp5.so </IfModule> - Ki畛m tra itk 達 n畉 vo apache ch動a [root@srv01 conf.d]# apachectl -t -D DUMP_MODULES | grep mpm mpm_itk_module (static) Syntax OK - Ki畛m tra c畉u h狸nh Apache c坦 OK kh担ng [root@srv01 conf.d]# /etc/init.d/httpd configtest Syntax OK [root@srv01 ~]# mkdir -p /srv/www [root@srv01 ~]# useradd site3.vmware.lab -d /srv/www/site3.vmware.lab -s /sbin/nologin [root@srv01 ~]# cd /srv/www/site3.vmware.lab [root@srv01 site1.vmware.lab]# mkdir tmp logs public_html [root@srv01 site1.vmware.lab]# chown -R site3.vmware.lab: public_html/
  • 36. Trang 35 [root@srv01 site1.vmware.lab]# chmod -R 750 public_html [root@srv01 ~]# cd /etc/httpd/conf.d [root@srv01 conf.d]# vi vhost.conf NameVirtualHost *:80 <VirtualHost *:80> ServerAdmin webmaster@site1.vmware.lab ServerName site1.vmware.lab <IfModule itk.c> AssignUserId site1.vmware.lab site1.vmware.lab </IfModule> DocumentRoot /srv/www/site1.vmware.lab/public_html ErrorLog /srv/www/site1.vmware.lab/logs/error_log CustomLog /srv/www/site1.vmware.lab/logs/access_log "combined" LogLevel info DirectoryIndex index.php index.html php_admin_value upload_tmp_dir /srv/www/site1.vmware.lab/tmp php_value session.save_path /srv/www/site1.vmware.lab/tmp php_admin_value open_basedir /srv/www/site1.vmware.lab/public_html:/srv/www/site1.vmware.lab/tmp php_admin_value suhosin.executor.func.blacklist "passthru, shell_exec, system, proc_open, popen, apache_child_terminate, apache_setenv, define_syslog_variables, pcntl_exec, openlog, posix_getpwuid, posix_kill, posix_setpgid, posix_setsid,
  • 37. Trang 36 posix_setuid, posix_setuid, posix_uname, proc_close, proc_get_status, proc_open, proc_terminate, syslog, curl_exec, curl_multi_exec, php_uname" </VirtualHost> Ch炭 th鱈ch c叩c th担ng s畛 - open_basedir l tham s畛 c畛c k狸 quan tr畛ng trong vi畛c ph嘆ng ch畛ng local attack, khi website ch畉y trong th動 m畛c ny, n坦 s畉 kh担ng th畛 th畛c hi畛n thao t叩c v畛i c叩c th動 m畛c b棚n ngoi - AssignUserId site1.vmware.lab site1.vmware.lab t畉t c畉 m畛i ti nguy棚n trong th動 m畛c ch畛a d畛 li畛u c畛a website ny 畛u ch畉y d動畛i quy畛n user site1.vmware.lab - upload_tmp_dir thu muc khi uplad file len wweb - session.save_path thu muc de luu phien lam viec cua website 3.4 D畛ch v畛 Mail Server 3.4.1 Gi畛i thi畛u Mail Server - Mail Server l m畛t m叩y ch畛 d湛ng 畛 nh畉n v g畛i mail - Ch畛c nng c畛a Mail Server + Qu畉n l箪 account + Nh畉n mail c畛a ng動畛i g畛i (c畛a nh畛ng ng動畛i c坦 account) v g畛i cho ng動畛i nh畉n ho畉c mail server c畛a ng動畛i nh畉n. + Nh畉n mail t畛 mail server c畛a ng動畛i g畛i (t畛 b棚n ngoi) v ph但n ph畛i mail cho ng動畛i trong h畛 th畛ng.
  • 38. Trang 37 + T湛y thu畛c vo vi畛c ci 畉t m mail-server cho phep ng動畛i d湛ng s畛 d畛ng web-mail (web) 畛 nh畉n mail (gi畛ng yahoo), hay cho ph辿p s畛 d畛ng outlook (application), hay c畉 2 (gi畛ng nh動 gmail) 3.4.2 C畉u h狸nh MailServer Ci 畉t v c畉u h狸nh POSTFIX - Tao group va user groupadd vmail -g 2222 useradd vmail -r -g 2222 -u 2222 -d /var/vmail -m -c "mail user" - Ch畛nh s畛a file c畉u h狸nh postfix cp /etc/postfix/main.cf /etc/postfix/main.cf.bak cat /dev/null > /etc/postfix/main.cf vi /etc/postfix/main.cf queue_directory = /var/spool/postfix command_directory = /usr/sbin daemon_directory = /usr/libexec/postfix data_directory = /var/lib/postfix mail_owner = postfix unknown_local_recipient_reject_code = 550 alias_maps = hash:/etc/postfix/aliases alias_database = $alias_maps inet_interfaces = all inet_protocols = ipv4 mydestination = $myhostname, localhost.$mydomain, localhost
  • 39. Trang 38 debug_peer_level = 2 debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5 sendmail_path = /usr/sbin/sendmail.postfix newaliases_path = /usr/bin/newaliases.postfix mailq_path = /usr/bin/mailq.postfix setgid_group = postdrop html_directory = no manpage_directory = /usr/share/man sample_directory = /usr/share/doc/postfix-2.6.6/samples readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES relay_domains = * virtual_alias_maps=hash:/etc/postfix/vmail_aliases virtual_mailbox_domains=hash:/etc/postfix/vmail_domains virtual_mailbox_maps=hash:/etc/postfix/vmail_mailbox virtual_mailbox_base = /var/vmail virtual_minimum_uid = 2222 virtual_transport = virtual virtual_uid_maps = static:2222 virtual_gid_maps = static:2222 smtpd_sasl_auth_enable = yes smtpd_sasl_type = dovecot
  • 40. Trang 39 smtpd_sasl_path = /var/run/dovecot/auth-client smtpd_sasl_security_options = noanonymous smtpd_sasl_tls_security_options = $smtpd_sasl_security_options smtpd_sasl_local_domain = $mydomain broken_sasl_auth_clients = yes smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination smtpd_relay_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination - T畉o file c畉u h狸nh vmail_domain. D畛 th棚m 1 virtual domain - vi /etc/postfix/vmail_domains - vmware.lab OK - T畉o file c畉u h狸nh vmail_mailbox. N董i 畛 ch畛a h畛p th動 vi /etc/postfix/vmail_mailbox info@vmware.lab vmware.lab/info/ - T畉o file c畉u h狸nh vmail_aliases. X叩c inh t棚n b鱈 danh vi /etc/postfix/vmail_aliases info@vmware.lab info@vmware.lab - N畉p files c畉u h狸nh postmap /etc/postfix/vmail_domains postmap /etc/postfix/vmail_mailbox postmap /etc/postfix/vmail_aliases
  • 41. Trang 40 touch /etc/postfix/aliases - Ch畛nh s畛a c畉u h狸nh trong file master.cf vi /etc/postfix/master.cf #Dong 12 submission inet n - n - - smtpd Ci 畉t v c畉u h狸nh DOVECOT yum install dovecot - Ch畛nh s畛a file c畉u h狸nh dovecot cp /etc/dovecot/dovecot.conf /etc/dovecot/dovecot.conf.bak cat /dev/null > /etc/dovecot/dovecot.conf vi /etc/dovecot/dovecot.conf listen = * ssl = no protocols = imap lmtp disable_plaintext_auth = no auth_mechanisms = plain login mail_access_groups = vmail default_login_user = vmail first_valid_uid = 2222 first_valid_gid = 2222 #mail_location = maildir:~/Maildir mail_location = maildir:/var/vmail/%d/%n passdb {
  • 42. Trang 41 driver = passwd-file args = scheme=SHA1 /etc/dovecot/passwd } userdb { driver = static args = uid=2222 gid=2222 home=/var/vmail/%d/%n allow_all_users=yes } service auth { unix_listener auth-client { group = postfix mode = 0660 user = postfix } user = root } service imap-login { process_min_avail = 1 user = vmail } - Hash password touch /etc/dovecot/passwd doveadm pw -s sha1 | cut -d '}' -f2 vi /etc/dovecot/passwd
  • 43. Trang 42 info@vmware.lab:fCIvspJ9goryL1khNOiTJIBjfA0= - G畉n quy畛n cho file passwd chown root: /etc/dovecot/passwd chmod 600 /etc/dovecot/passwd - Kh畛i 畛ng d畛ch v畛 chkconfig postfix on chkconfig dovecot on service postfix restart service dovecot restart /etc/init.d/iptables stop - T動董ng t畛 K畉t Qu畉: - T畉o 2 ti kho畉n tr棚n Thunderbird
  • 44. Trang 43 - 2 ti kho畉n ny g畛i mail qua l畉i cho nhau Ci 畉t v thi畉t l畉p giao di畛n Webmail Roundcube - Gi炭p ng動畛i d湛ng qu畉n l箪 v s畛 d畛ng d畛ch v畛 mail m畛t c叩ch hi畛u qu畉 nh畉t, 但y l ch動董ng tr狸nh c坦 giao di畛n th但n thi畛n, d畛 s畛 d畛ng, ph湛 h畛p v畛i 畉i a s畛 ng動畛i d湛ng
  • 45. Trang 44 - M叩y 達 ci s畉n LAMP (Linux Apache MySQL and PHP ) - Link tham kh畉o :https://www.rosehosting.com/blog/how-to-install-lamp-linux- apache-mysql-and-php-on-centos-6-with-phpmyadmin-and-apc-cache/ - Thi畉t l畉p databases cho Roundcube mysql -u root -p mysql> CREATE DATABASE IF NOT EXISTS `roundcube`; mysql> GRANT ALL PRIVILEGES ON `roundcube` . * TO 'roundcube'@'localhost' IDENTIFIED BY 'mySecretPassword'; mysql> FLUSH PRIVILEGES; mysql> quit - Tr動畛c khi t畉i v ci 畉t roundcube. Ta t畉o file c畉u h狸nh Roundcube Apache vi /etc/httpd/conf.d/90-roundcube.conf Alias /webmail /var/www/html/roundcube <Directory /var/www/html/roundcube> Options -Indexes AllowOverride All </Directory> <Directory /var/www/html/roundcube/config> Order Deny,Allow Deny from All </Directory> <Directory /var/www/html/roundcube/temp> Order Deny,Allow
  • 46. Trang 45 Deny from All </Directory> <Directory /var/www/html/roundcube/logs> Order Deny,Allow Deny from All </Directory> - T畉i v ci 畉t Roundcube curl -L "http://sourceforge.net/projects/roundcubemail/files/latest/download?source=files" > /tmp/roundcube-latest.tar.gz tar -zxf /tmp/roundcube-latest.tar.gz -C /var/www/html rm -rf /tmp/roundcube-latest.tar.gz cd /var/www/html mv roundcubemail-* roundcube chown root: -R roundcube/ chown apache: -R roundcube/temp/ chown apache: -R roundcube/logs/ - T畉o b畉ng databases c畉n thi畉t cho roundcube mysql -u roundcube -p"mySecretPassword" roundcube < roundcube/SQL/mysql.initial.sql - Client: server.vmware.lab/webmail/installer - Copy file config.inc.php vo /var/www/html/roundcube/config/
  • 47. Trang 46 vi config.inc.php - X坦a file installer rm -rf roundcube/installer/ - Kh畛i 畛ng l畉i d畛ch v畛 /etc/init.d/httpd restart /etc/init.d/httpd restart /etc/init.d/iptables stop - M畛 Client : server.vmware.lab/webmail 3.5 S畛 d畛ng CA Server t畉o ch畛ng ch畛 SSL 3.5.1 Gi畛i thi畛u ch畛ng ch畛 SSL - SSL l vi畉t t畉t c畛a t畛 Secure Sockets Layer. 但y l m畛t ti棚u chu畉n an ninh c担ng ngh畛 ton c畉u t畉o ra m畛t li棚n k畉t gi畛a m叩y ch畛 web v tr狸nh duy畛t. Li棚n k畉t ny 畉m b畉o t畉t c畉 d畛 li畛u trao 畛i gi畛a m叩y ch畛 web v tr狸nh duy畛t lu担n 動畛c b畉o m畉t v an ton.SSL 畉m b畉o r畉ng t畉t c畉 c叩c d畛 li畛u 動畛c truy畛n gi畛a c叩c m叩y ch畛 web v c叩c tr狸nh duy畛t 動畛c mang t鱈nh ri棚ng t動, t叩ch r畛i. SSL l m畛t chu畉n c担ng ngh畛 動畛c s畛
  • 48. Trang 47 d畛ng b畛i hng tri畛u trang web trong vi畛c b畉o v畛 c叩c giao d畛ch tr畛c tuy畉n v畛i kh叩ch hng c畛a h畛. - 畛 t畉o k畉t n畛i an ton ny, m畛t ch畛ng ch畛 SSL (c嘆n 動畛c g畛i l ch畛ng ch畛 s畛) 動畛c ci 畉t tr棚n m叩y ch畛 web v th畛c hi畛n hai ch畛c nng + N坦 x叩c th畛c danh t鱈nh c畛a trang web (i畛u ny 畉m b畉o v畛i kh叩ch truy c畉p r畉ng h畛 ang kh担ng 畛 trang web gi畉 m畉o) + N坦 m達 h坦a d畛 li畛u ang 動畛c truy畛n i - C畛ng ch畛 SSL 動畛c c畉p b畛i c叩c C董 quan qu畉n l箪 Ch畛ng ch畛 (Certificate Authorities, CA), t畛 ch畛c 動畛c tin c畉y 畛 x叩c minh danh t鱈nh v t鱈nh h畛p ph叩p c畛a b畉t k畛 t畛 ch畛c no y棚u c畉u ch畛ng ch畛. 3.5.2 T畉o ch畛ng ch畛 SSL tr棚n CA Server Tr棚n m叩y Linux - Ci 畉t mod-ssl v openssl cho m叩y Web Server Apache [root@vmware ~]# yum install mod_ssl openssl - T畉o ra Certifcate Request Signed 畛ng v畛i m畛i website - [root@vmware ~]# openssl req -new -newkey rsa:2048 -nodes -keyout site1.vmware.lab.key -out site1.vmware.lab.csr Tr棚n m叩y Windows Server 2016 - Submit CSR c畛a site2.vmware.lab 畉n CA-Server v vo CA-SERVER 畛 ISSUSED CERTIFICATE Tr棚n m叩y client Windows 10 - Download site2.vmware.lab certifcate - Th畛c hi畛n convert certifcate t畛 u担i .cer chuy畛n thnh .crt
  • 49. Trang 48 C:Userskatap>cd C:OpenSSLbin C:OpenSSLbin>openssl.exe x509 -inform der -in site1.vmware.lab.cer -out site1.vmware.lab.crt - Copy c叩c file site1.vmware.lab.crt 畛 tr棚n vo m叩y linux Tr棚n m叩y Linux - Copy Private Key vo folder Cert [root@vmware ~]# cp -v site2.vmware.lab.key /cert/ - COPY FILE site2.vmware.lab.crt vo folder /cert 畛 tr棚n m叩y - C畉u h狸nh NameBaseVirtualHost v畛i port 443 [root@vmware ~]# cd /etc/httpd/conf.d [root@vmware conf.d]# vi vhost-ssl.conf NameVirtualHost *:443 <VirtualHost *:443> ServerAdmin admin@vmware.lab ServerName site.vmware.lab ServerAlias site1.vmware.lab DocumentRoot /srv/www/site1.vmware.lab/public_html/ SSLEngine on SSLCertificateFile /cert/site2.vmware.lab.crt SSLCertificateKeyFile /cert/site2.vmware.lab.key ErrorLog /srv/www/site1.vmware.lab/logs/error.log CustomLog /srv/www/site1.vmware.lab/logs/access.log combined </VirtualHost>-
  • 50. Trang 49 - Kh畛i 畛ng l畉i httpd [root@vmware conf.d]# /etc/init.d/httpd restart K畉t Qu畉:
  • 51. Trang 50 CH働NG 4: K畉T LU畉N - Tuy th畛i gian th畛c t畉p 畛 Trung t但m Athena kh担ng 動畛c nhi畛u nh動ng c滴ng 畛 l畉i cho em nh畛ng ki畉n th畛c b畛 鱈ch v nh畛ng kinh nghi畛m s畉 gi炭p 鱈ch cho em sau ny c坦 th畉 lm vi畛c t畛t h董n. Em c坦 動畛c nh畛ng ki畉n th畛c v kinh nghi畛m l 動畛c s畛 gi炭p 畛 t畉n t狸nh c畛a Trung t但m, 畉c bi畛t l th畉y L棚 狸nh Nh但n trong su畛t th畛i gian qua 達 cho em h畛c h畛i 動畛c th棚m r畉t nhi畛u i畛u. Nh畛ng k挑 nng lm vi畛c v b叩o c叩o c畛a em t畛t h董n. Em 達 畉t 動畛c nh畛ng c担ng vi畛c sau: + Bi畉t s畛 d畛ng ISPConfig 畛 qu畉n tr畛 hosting, lm n畛n t畉ng 畛 c坦 th畛 s畛 d畛ng c叩c Cpanel kh叩c + 動畛c tr畉i nghi畛m v tri畛n khai c叩c d畛ch v畛 tr棚n h畛 i畛u hnh Linux: Samba, Lamp, Mail.. + Bi畉t 動畛c nhi畛u h董n c叩c l畛nh c畛 b畉n tr棚n Linux + H畛c 動畛c c叩ch s畛a nh畛ng l畛i c董 b畉n tr棚n Linux + H畛c 動畛c c叩ch tr狸nh by, di畛n 畉t tr動畛c m畛i ng動畛i, tr動畛c camera + H畛c 動畛c c叩ch lm vi畛c 炭ng th畛i gian, ph但n b畛 c担ng vi畛c ph湛 h畛p + C畉i thi畛n 動畛c k挑 nng giao ti畉p, k畛 nng 畛ng x畛, th叩i 畛 lm vi畛c khi 動畛c c畉p tr棚n giao ph坦 - Do th畛i gian th畛c t畉p ch動a l但u, ki畉n th畛c b畉n th但n c嘆n h畉n ch畉 n棚n d湛 達 c畛 g畉ng nh動ng b叩o c叩o th畛c t畉p c畛a em s畉 kh担ng tr叩nh kh畛i s畛 sai s坦t, khuy畉t i畛m. Em r畉t mong 動畛c s畛 g坦p 箪 ch畛 b畉o c畛a c叩c th畉y c担 畛 b叩o c叩o th畛c t畉p c畛a em hon ch畛nh h董n.
  • 52. Trang 51 PH畛 L畛C I: VIDEO QU TRNH TH畛C HI畛N Gi畛i thi畛u b畉n th但n https://www.youtube.com/watch?v=cshUhIJSgs8 S畛 d畛ng ISPConfig https://www.youtube.com/watch?v=apS32CKMPb0 Ci 畉t c畉u h狸nh Samba Server https://www.youtube.com/watch?v=jm1uEr3yV9I Ci 畉t c畉u h狸nh webserver apache s畛 d畛ng apache-itk https://www.youtube.com/watch?v=4fSjgU9IL1U Ci 畉t v c畉u hinh MailSerev v畛i postfix v dovecot https://www.youtube.com/watch?v=DBKxPAy6vKU Ci 畉t v c畉u h狸nh webmail clien v畛i Roundcube https://www.youtube.com/watch?v=0nILUrQUgxg&t=504s C畉p ch畛ng ch畛 SSL cho website tr棚n CA Server https://www.youtube.com/watch?v=tU9FcHB7GHA
  • 53. Trang 52 PH畛 L畛C II: TRCH D畉N NGU畛N THAM KH畉O [1] L棚 狸nh Nh但n, Qu畉n Tr畛 M畉ng Linux LPI2, Athena. [Online]. Available: http://e-learning.athena.edu.vn/course/view.php?id=7 [Accesed 22-2-2017]. [2] RoseHosting, Mailserver with virtual users and domains using Postfix and Dovecot on a CentOS 6 VPS, 2013.[Online]. Available: https://www.rosehosting.com/blog/mailserver-with-virtual-users-and-domains-using- postfix-and-dovecot-on-a-centos-6-vps/ [Access 28-3-2017]. [3] RoseHosting, Install and set-up Roundcube webmail interface, 2013.[Online]. Available: https://www.rosehosting.com/blog/install-and-set-up-roundcube-webmail-interface/ [Accessed 30-3-2017]. [4] John C動畛ng, C畉u h狸nh SSL cho website th担ng qua CA tr棚n Windows Server 2008 Part 1, 2013.[Online]. Available: https://johncuongit.wordpress.com/2013/11/08/cau-hinh-ssl-cho-website-thong-qua- ca-tren-windows-server-2008-part-1/ [Accessed 8-4-2017] [4] John C動畛ng, C畉u h狸nh SSL cho website th担ng qua CA tr棚n Windows Server 2008 Part 2, 2013.[Online]. Available: https://johncuongit.wordpress.com/2013/11/08/cau-hinh-ssl-cho-website-thong-qua- ca-tren-windows-server-2008-part-2/ [Accessed 10-4-2017] [5] Athena, Gi畛i thi畛u Trung t但m Qu畉n Tr畛 M畉ng v An Ninh M畉ng Qu畛c T畉 Athena.[Online] Available: http://athena.edu.vn/gioi-thieu/ [Accessed 21-2-2017]
  • 54. Trang 53 [6] freelanceTEK.com, ISPConfig,2016.[Online] Available: https://www.youtube.com/watch?v=fx5LCtDlNeU&list=PLkE- 4cQPDFuf4ZatH3_5yoWO4KzVGqgQp [Accessed 28-2-2017] [7] Wikipedia, LAMP,2016.[Online] Available: https://vi.wikipedia.org/wiki/LAMP [Accessed 25-4-2017]