1. TRUNG TÂM ĐÀO TẠO QUẢN TRỊ MẠNG & AN NINH MẠNG QUỐC TẾ
ATHENA
--------------------
BÁO CÁO TUẦN 3 & 4
THỰC TẬP
Đề tài:
XÂY DỰNG HỆ THỐNG MAIL SERVER
DOANH NGHIỆP TRÊN LINUX
Ngành : Công Nghệ Thông Tin
GIÁO VIÊN HƯỚNG DẪN: VÕ ĐỖ THẮNG
SINH VIÊN THỰC HIỆN: Nguyễn Lê Chánh Duy
Thành Phố Hồ Chí Minh
2014
2. 1. Cấu hình IP tĩnh cho máy ảo server và client:
Từ terminal ta truy cập vào mode superuser vớilệnh: su
Ta cấu hình IP tĩnh cho Ethernet với lệnh:
vi /etc/sysconfig/network-scripts/ifcfg-eth (có thể là eth0, eth1…tùy vào
máy)
Trong file ifcfg-eth ta sẽ thêm 5 dòng sau:
BOOTPROTO=static
IPADDR=192.168.1.245
NETMASK=255.255.255.0
GATEWAY=192.168.1.254
DNS1=8.8.8.8
Tương tự máy client ta cũng làm như các bước trên với IP tĩnh cùng lớp
mạng vớimáy server
2. Cấu hình hosts:
Từ terminal ta truy cập vào mode superuser vớilệnh: su
Ta cấu hình hosts với lệnh:
vi /etc/hosts
Trong file hosts ta thêm vào dòng: 192.168.1.245 server.athena.lab
3. Cài đặt thunderbird trên máy client:
Từ terminal ta truy cập vào mode superuser vớilệnh: su
Ta sẽ cài đặt tự động mozzila thunderbird với lệnh:
yuminstall thunderbird
4. Tạo mail account với thunderbird:
Trên máy server ta tiến hành tạo 2 users mới để sử dụng vớilệnh:
useradd user và passwd user
Trong thunderbird ta sẽtạo 2 email accounts trùng với 2 users vừa tạo
mới trên server (vídụ: user1 và user2)
Trên client tiến hành truy cập vào thunderbird với các bước:
Applications > Internet> Thunserbird Email
Trên thunderbird ta sẽ tạo email account với các bước sau:
Trong mục Accounts , Create a new account chọn Email
Yourname: user1
3. Email address: user1@athena.lab
Password: 1234
Bấm chọn: Remember password
Nhấn chọn continue
Chọn Manual config
Incoming: 192.168.1.245(IP server)
Outgoing: 192.168.1.245
Nhấn chọn Re-test để chương trình tự động nhận Port, SSL và
Authentication
Khi có thông báo về bảo mật thì nhấn chọn confirm security > done
Sau khihoàn thành tạo user1@athena.lab, ta tiến hành tạo
user2@athena.lab vớicác bước như trên
5. Kiểm tra hoạt động của thunderbird:
Ta sẽ khởi động dovecotvới postfix trên server vớilệnh:
servicepostfix restart
servicedovecot restart
Ta cần phải dừng iptables trên cả máy server và client với lệnh:
serviceiptables stop
Trên client tiến hành truy cập vào thunderbird với các bước:
Applications > Internet> Thunserbird Email
Lúc này trong thunderbird đã có 2 accounts:
user1@athena.lab và user2@athena.lab
Ta tiến hành gừi messagetừ user1 cho user2:
chọn Write a new message> To user2@athena.lab > Send
sau khi gửi ta kiểm tra inbox của user2 sẽ thấy 1 mail mới được gửi từ
use1@athena.lab
6. Cài đặt squirrelmail:
Để cài đặt squirrelmail ta thực hiện các bước sau:
Truy nhập vào mode superuser: su
Dùng 2 lệnh sau để cài đặt squirrelmail:
rpm–Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-
release-6-8.noarch.rpm
Yum install squirrelmail
7. Cấu hình squirrelmail:
4. Ta cấu hình squirrelmail bằng lệnh:
/usr/share/sbin/squirrelmail/config/conf.pl
Trong file conf.plta tiến hành cấu hình như sau:
Chọn 2 > chọn 1 > đổi domain name thành athena.lab > chọn R để
return
Chọn 3 > chọn SMTP > chọn R
Chọn D > type dovecot > enter
Chọn S > chọn Q để savevà quit
8. Cài đặt cyrus và httpd service:
yuminstall httpd
yum -y install cyrus-saslcyrus-sasl-develcyrus-sasl-gssapicyrus-sasl-md5
cyrus-sasl-plain
mkdir /etc/postfix/ssl
cd /etc/postfix/ssl/
opensslgenrsa -des3 -rand /etc/hosts -out smtpd.key 1024
chmod 600 smtpd.key
opensslreq -new -key smtpd.key -outsmtpd.csr
opensslx509 -req -days 365 -in smtpd.csr -signkey smtpd.key -out
smtpd.crt
opensslrsa -in smtpd.key -outsmtpd.key.unencrypted
mv -f smtpd.key.unencrypted smtpd.key
opensslreq -new -x509 -extensions v3_ca -keyoutcakey.pem -out
cacert.pem -days 365
9. Kiểm tra hoạt động của squirrelmail:
Từ máy client truy cập vào 192.168.1.245/webmail vớifirefox
Giao diện login của squirrelmailsẽ hiện ra > tiến hành login với user và
password đã được tạo trong server
Tiến hành kiểm tra mail trong squirrelmail
10. Đăng ký VPS tại văn phòng athena: