檢視CentOS上Apache位置,版本,停止,啟動

風靈使發表於2018-07-27

檢視Apache是否被安裝:

[root@asg11 ~]# 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

由此確定Apache被安裝的地方是/etc/httpd

檢視Apache版本

首先進入httpd所在目錄

[root@asg11 ~]# cd /etc/httpd

進而檢視版本

[root@asg11 httpd]# httpd -v
Server version: Apache/2.2.15 (Unix)
Server built:   Aug 13 2013 17:29:28

停止httpd

[root@asg11 httpd]# service httpd stop
Stopping httpd: [  OK  ]

啟動httpd

[root@asg11 httpd]# service httpd start
Starting httpd: [  OK  ]

用瀏覽器訪問試試:
這裡寫圖片描述

[root@asg11 httpd]#

Apache的重要配置檔案httpd.conf的位置在/etc/httpd/conf/httpd.conf

[root@asg11 conf]# pwd
/etc/httpd/conf
[root@asg11 conf]# ls
httpd.conf  magic
[root@asg11 conf]#

相關文章