首页 > Web开发 > 详细

Cento OS 安装Apache

时间:2016-04-03 02:05:02      阅读:324      评论:0      收藏:0      [点我收藏+]

?

??? 此次我使用yum命令安装apache http server,一般情况下安装好cento os后就自动安装了yum

我用MAC OS终端SSH到目标服务器

?

192:~ xuwenfeng$ ssh jerry@172.16.112.130

?输入密码后,再输入以下命令

?

?

[jerry@172 ~]$ yum install httpd

?提示如下

?

?

已加载插件:fastestmirror, langpacks
您需要 root 权限执行此命令。

?那么我们么用sudo

[jerry@172 ~]$ sudo yum install httpd

?显示

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

[sudo] password for jerry: 

?输入密码后显示一堆软件安装信息看到如下键入y

Is this ok [y/d/N]: y

?看到如下键入y

是否继续?[y/N]:y

?直到看到如下

?

作为依赖被安装:
  httpd-tools.x86_64 0:2.4.6-40.el7.centos     mailcap.noarch 0:2.1.41-2.el7    

完毕!

?

接下来我们将http server安装成系统服务,这样可以在系统启动时自动启动http server

[jerry@172 ~]$ chkconfig --levels 235 httpd on

?完成后我们启动服务

?

[jerry@172 ~]$ service httpd start 

?

启动成功后在服务器浏览器中输入 http://localhost 可以看到欢迎页面

?

运行如下命令可以停止服务

?

[jerry@172 ~]$ service httpd stop

?要注意的是安装服务、启动服务、停止服务都是需要输入密码

?

?

?

Cento OS 安装Apache

原文:http://bewithme.iteye.com/blog/2288241

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!