?
??? 此次我使用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
?要注意的是安装服务、启动服务、停止服务都是需要输入密码
?
?
?
原文:http://bewithme.iteye.com/blog/2288241