engineer7

简介:

搭建安全的Web服务
http------》https

1.安装,实现Web加密传输的软件
[root@server0 ~]# yum -y install mod_ssl

[root@server0 ~]# ls /etc/httpd/conf.d/
autoindex.conf README userdir.conf
nsd01.conf ssl.conf welcome.conf

2.部署网站数字证书(营业执照)

cd /etc/pki/tls/certs/

ls

wget http://classroom/pub/tls/certs/server0.crt

ls

3.部署网站根证书(公安局信息)

cd /etc/pki/tls/certs/

ls

wget http://classroom/pub/example-ca.crt

ls

4.部署私钥(用于解密)

cd /etc/pki/tls/private/

ls

wget http://classroom/pub/tls/private/server0.key

ls

5.修改配置文件/etc/httpd/conf.d/ssl.conf

vim /etc/httpd/conf.d/ssl.conf

补充:vim 末行模式 :set nu 添加行号

59 DocumentRoot "/var/www/html" #去掉注释
60 ServerName server0.example.com:443 #去掉注释,修改域名

#指定网站证书位置及名称
100 SSLCertificateFile /etc/pki/tls/certs/server0.crt

#指定私钥位置及名称
107 SSLCertificateKeyFile /etc/pki/tls/private/server0.key

#指定根证书位置及名称
122 SSLCACertificateFile /etc/pki/tls/certs/example-ca.crt

6.重起httpd服务

7.Desktop验证:
[root@desktop0 ~]# firefox https://server0.example.com

点击: 我以了解安全的风险
          添加例外
          确认安全例外

########################################################

配置邮件服务器

• 电子邮件服务器的基本功能
– 为用户提供电子邮箱存储空间(用户名@邮件域名)
– 处理用户发出的邮件 —— 传递给收件服务器
– 处理用户收到的邮件 —— 投递到邮箱

 SMTP(发邮件的协议  端口:25)
 pop3(收邮件的协议  端口:110)

DNS:classrom.example.com
server0.example.com

虚拟机Server0

1.安装postfix,提供邮件功能的软件
2.建立邮件账户,邮件服务器上本地用户
[root@server0 /]# useradd -s /sbin/nologin yg
[root@server0 /]# useradd -s /sbin/nologin xln
[root@server0 /]# echo 123 | passwd --stdin yg
[root@server0 /]# echo 123 | passwd --stdin xln

3.配置邮件服务器 /etc/postfix/main.cf

[root@server0 /]# vim /etc/postfix/main.cf

99 myorigin = server0.example.com #默认补全的邮件域名后缀 
116 inet_interfaces = all #允许所有的网络接口
164 mydestination = server0.example.com #判断为本域邮件

4.重起postfix服务
[root@server0 /]# systemctl restart postfix

######################################################
测试:
使用mail命令发信/收信
• mail 发信操作
– mail -s '邮件标题' -r 发件人 收件人

• mail 收信操作
– mail [-u 用户名]

[root@server0 /]# mail -s 'test01' -r yg xln
AAAAAAAAAAAAAA
BBBBBBBBBBBBBB
.
EOT
[root@server0 /]# mail -u xln
Heirloom Mail version 12.5 7/5/10. Type ? for help.
"/var/mail/xln": 1 message 1 new

N 1 yg@server0.example.c Tue Dec 5 14:18 19/598 
& 1

########################################################
nullclient邮件服务(邮件空客户端)

• nullclient,空客户端
– 不提供任何邮箱账号,因此不需要投递邮件
– 但是可以为用户代发邮件

1.把Desktop配置成,邮件服务器
[root@desktop0 ~]# lab smtp-nullclient setup

2.配置Server为邮件空客户端
[root@server0 /]# vim /etc/postfix/main.cf
– 所发出的邮件显示来自于 desktop0.example.com

99 myorigin = desktop0.example.com
116 inet_interfaces = localhost
164 mydestination = 
317 relayhost = [172.25.0.10] #将邮件移交给那台服务器

3.重起postfix服务
[root@server0 /]# systemctl restart postfix

########################################################
验证:
在Server上发一封邮件,给本地的Student
[root@server0 /]# mail -s 'test02' -r yg studen

t
abc
.
EOT

到Desktop:最终由Desktop上的student收到
[root@desktop0 /]# mail -u student

#######################################################

#######################################################

####################################################


     本文转自sweak_h 51CTO博客,原文链接:http://blog.51cto.com/13478354/2051464,如需转载请自行联系原作者





相关文章
|
Shell Linux 开发工具
|
Web App开发 测试技术 开发工具
|
网络安全 开发工具 数据安全/隐私保护
|
存储 关系型数据库 MySQL
|
网络协议 Shell 网络安全
|
Shell Linux 开发工具
|
Devops 网络安全 开发工具
|
JavaScript Java 程序员
|
安全 C# C++
微软职位内部推荐-Senior Development Engineer
微软近期Open的职位: Job Title: Senior Software Development Engineering Work Location: Suzhou, China Enterprise customer and consumers are rapidly adopting Office 365 Cloud services.
881 0