httpd的初步搭建

首先关闭防火墙:

# iptables -F

# iptables -X

# setenforce 0

 

# vi /etc/yum.repos.d/dvd.repo

进入修改yum源下的dvd文件,将以下内容写入dvd.repo文件中。

[dvd]

name=dvd

baseurl=file:///opt/dvd

gpgcheck=0

 

shift+; wq退出并保存

 

使用此命令清一下缓存配置

# yum clean all

[root@openstack ~]# yum clean all

Loaded plugins: langpacks, product-id, subscription-manager

This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.

Cleaning repos: images

Cleaning up everything

 

用yum list  

查看是否能列出dvd源中的列表文件

 

安装httpd

#yum install httpd

 

[root@openstack ~]# yum info httpd

Loaded plugins: langpacks, product-id, subscription-manager

This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.

images                               | 4.1 kB     00:00    

(1/2): images/group_gz                 | 134 kB   00:00    

(2/2): images/primary_db               | 3.4 MB   00:00    

Available Packages

Name        : httpd

Arch        : x86_64

Version     : 2.4.6

Release     : 17.el7

Size        : 1.2 M

Repo        : images

Summary     : Apache HTTP Server

URL         : http://httpd.apache.org/

Licence     : ASL 2.0

Description : The Apache HTTP Server is a powerful,

            : efficient, and extensible web server.

 

 

将服务启动起来

#systemctl start httpd

 

 

查询服务是否为启动状态,active (running)表示成功启动

# systemctl  status htttpd

 

[root@openstack ~]# systemctl  status httpd

httpd.service - The Apache HTTP Server

   Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled)

   Active: active (running) since Tue 2018-09-11 15:09:11 CST; 1h 31min ago

 Main PID: 12689 (httpd)

   Status: "Total requests: 5; Current requests/sec: 0; Current traffic:   0 B/sec"

 

打开本网段地址的任意一台主机,打开网页浏览器

http://IP(地址)

 

 

posted @ 2018-09-11 16:48  梦晚黎  阅读(137)  评论(0编辑  收藏  举报