完成在Linux下的第一个网页

1.下载httpd 服务器

首先要知道软件包在什么地方?

进入命令: cd /etc/yum.repos.d/

在这里插入图片描述

在这里插入图片描述
软件包在Packages 目录下

[root@localhost media]# cd /Packages

统计一下有多少包

[root@localhost Packages]# ls | wc -l

repo文件都是存放在/etc/yum.repos.d文件夹之中的。repo文件即是我们常说的源文件(repositry匹配文件),在使用yum命令的时候系统会自动读取repo文件,然后去repositry获取软件。配置如下:

[etc]
name=rhel7.6
baseurl=file:///media
gpgcheck=0

[etc] => [名字自定义]

下载httpd 服务器:

root@localhost yum.repos.d]# yum install -y httpd

下载完成显示的界面:
在这里插入图片描述

2.启动服务器:

[root@localhost yum.repos.d]# systemctl start httpd

浏览器页面访问地址,如果出现不了Apache页面就是防火墙的问题需要关闭。

[root@localhost yum.repos.d]# iptables -L
systemctl stop firewalld 关闭防火墙
systemctl disable firewalld 避免开机起,启动防火墙

编辑网页内容:
cd /var/www/html
vim index.html

在这里插入图片描述
网页的展示:
在这里插入图片描述
html和css 的语法都可以vim index.html里面
编辑.

猜你喜欢

转载自blog.csdn.net/lirui1212/article/details/105385551