1. 程式人生 > >centos通過yum方式安裝http服務並啟動

centos通過yum方式安裝http服務並啟動

1.安裝

yum install -y httpd

2.檢視Apache是否被安裝

[[email protected] ~]# find / -name 'httpd'
/etc/sysconfig/httpd
/etc/httpd
/etc/logrotate.d/httpd
/etc/rc.d/init.d/httpd
/var/run/httpd
/var/log/httpd
/var/lock/subsys/httpd
/usr/sbin/httpd
/usr/lib64/httpd

 

3.確定Apache被安裝的地方是/etc/httpd

檢視Apache版本

首先進入httpd所在目錄
[

[email protected] ~]# cd /etc/httpd

進而檢視版本
[[email protected] httpd]# httpd -v
Server version: Apache/2.2.15 (Unix)
Server built:   Aug 13 2013 17:29:28

 

4.停止httpd
[[email protected] httpd]# service httpd stop
Stopping httpd: [  OK  ]

 

5.啟動httpd
[

[email protected] httpd]# service httpd start
Starting httpd: [  OK  ]

 

用瀏覽器訪問