`
bewithme
  • 浏览: 423507 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

Cento OS7yum安装Apache

阅读更多

 

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

我用MAC OS终端SSH到目标服务器后输入如下命令

[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 ~]$ chkconfig --levels 235 httpd off

 

现在我们启动服务

[jerry@172 ~]$ service httpd start 

 

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

 

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

 

[jerry@172 ~]$ service httpd stop

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

还有一个问题就是用yum安装的apache居然没办法和tomcat集成,如果需要做集群只能另外下载编译版的apache进行编译安装

 

 

如果您觉得我的文章给了您帮助,请为我买一杯饮料吧!以下是我的支付宝,意思一下我将非常感激!

 

0
4
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics