httpd经典案例

httpd的实例(经典)

实例一

  • 1.从http://ldap.example.com/pub/example.html下载文件,并重命名为index.html,不修改文件内容
  • 2.将文件index.html拷贝到你的DocumentRoot目录
  • 3 来自于example.com的客户端可以访问web服务器
  • 4.来自于my133t.org的客户端的访问会被拒绝

    [root@server30 ~]# cd /var/www/
cgi-bin/ html/    
[root@server30 ~]# cd /var/www/html/
[root@server30 html]# wget -O index.html http://ldap.example.com/pub/example.html
--2019-01-17 19:03:11--  http://ldap.example.com/pub/example.html
Resolving ldap.example.com (ldap.example.com)... 172.16.30.254
Connecting to ldap.example.com (ldap.example.com)|172.16.30.254|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 21 [text/html]
Saving to: ‘index.html’

100%[======================================>] 21          --.-K/s   in 0s      

2019-01-17 19:03:11 (3.25 MB/s) - ‘index.html’ saved [21/21]

[root@server30 html]# ls
index.html
[root@server30 html]# cat index.html 
server30.example.com
[root@server30 html]#

[root@server30 html]# firewall-cmd --add-rich-rule 'rule family=ipv4 source address=172.16.30.0/24 service name=http accept' --permanent
success
[root@server30 html]# firewall-cmd --reload
success
[root@server30 html]# 
[root@server30 ~]# systemctl restart httpd
[root@server30 ~]# systemctl enable httpd
ln -s '/usr/lib/systemd/system/httpd.service' '/etc/systemd/system/multi-user.target.wants/httpd.service'
[root@server30 ~]# 

在这里插入图片描述

实例二

  1. 已签名证书从http://ldap.example.com/pub/server30.crt获取
  2. 证书的密钥从http://ldap.example.com/pub/server30.key获取
  3. 证书的签名授权信息从http://ldap.example.com/pub/group30.crt获取


[root@server30 ~]# rpm -qa | grep mod_ssl
mod_ssl-2.4.6-17.el7.x86_64
[root@server30 ~]# 
[root@server30 ~]# cd /etc/httpd/conf.d/
[root@server30 conf.d]# ls
autoindex.conf  README  ssl.conf 
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值