web服务器练习(一)

题目

在rhel8的系统上搭建网站:该网站ip地址主机位为11,设置documentroot为/www/你的名字拼音的缩写,网页内容为:my name is…

步骤

# 下载httpd服务包
[root@localhost www]# yum install httpd -y
Updating Subscription Management repositories.
Unable to read consumer identity

This system is not registered with an entitlement server. You can use subscription-manager to register.

Last metadata expiration check: 2:13:53 ago on Fri 11 Nov 2022 10:42:46 PM EST.
Package httpd-2.4.37-43.module_el8.5.0+1022+b541f3b1.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!

# 建立目录
[root@localhost certs]# mkdir -pv /www/linboan
# 写入内容进入index.html
[root@localhost www]# echo my name is linboan > /www/linboan/index.html
[root@localhost www]# cd /etc/httpd/conf.d

# 写入规则
[root@localhost conf.d]# vim linboan.conf
<VirtualHost 192.168.182.11:80>
    DocumentRoot "/www/linboan"
    ServerName dummy-host.example.com
    ServerAlias www.dummy-host.example.com
    ErrorLog "/www/linboan/com-error_log"
    CustomLog "/www/linboan/com-access_log" common
</VirtualHost>
<directory "/www">
	Allowoverride none
	Require all granted
</directory>

# 关闭防火墙,selinux
# 重启httpd服务
[root@localhost conf.d]# systemctl stop firewalld
[root@localhost conf.d]# setenforce 0
[root@localhost conf.d]# systemctl restart httpd

# 测试
[root@localhost conf.d]# curl 192.168.182.11
my name is linboan

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值