Web网站基础配置

本文介绍了如何在LAMP平台上配置Web网站服务,包括将网页资源存放在/var/www/webroot/目录,创建包含'Hello Word !'超链接的index.html首页,并确保在访问http://127.0.0.1/时能正确显示内容。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Web网站基础配置

需求:配置web网站服务,提供服务需求

1)网页资源要求存放到 /var/www/webroot/ 目录

2)新建网站首页 index.html,代码内容如下: <a href="http://tmooc.cn/">Hello Word !</a>

3)本机访问 http://127.0.0.1/ 时,页面显示“Hello Woed ! ”超链接

操作步骤:

在 LAMP 平台 基础上  做配置

#创建网站根目录

[root@pxesvr ~]# mkdir -p /var/www/webroot
#修改服务配置

[root@pxesvr ~]# vim /etc/httpd/conf/httpd.conf 

DocumentRoot /var/www/webroot

<Directory /var/www/webroot>
#重启httpd服务,以更新配置

[root@pxesvr ~]# systemctl restart httpd

 

#新建网站首页index.html,内容及操作参考如下。

[root@pxesvr ~]# vim /var/www/webroot//index.html

<a  href="http://tmooc.cn/">Hello Word !</a>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值