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
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
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
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
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>-
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]