1. 显示apache的版本号
1 XXX@XXX-ThinkPad-Edge-E431:~$ apache2 -v 2 Server version: Apache/2.4.7 (Ubuntu) 3 Server built: Oct 14 2015 14:20:21
2. 为了得到apache的配置文件路径
1 XXX@XXX-ThinkPad-Edge-E431:~$ ps -ef|grep apache 2 root 13682 2157 0 16:00 ? 00:00:00 /usr/sbin/apache2 -k start 3 www-data 13686 13682 0 16:00 ? 00:00:00 /usr/sbin/apache2 -k start 4 www-data 13687 13682 0 16:00 ? 00:00:00 /usr/sbin/apache2 -k start 5 www-data 13688 13682 0 16:00 ? 00:00:00 /usr/sbin/apache2 -k start 6 www-data 13689 13682 0 16:00 ? 00:00:00 /usr/sbin/apache2 -k start 7 www-data 13690 13682 0 16:00 ? 00:00:00 /usr/sbin/apache2 -k start 8 www-data 13695 13682 0 16:00 ? 00:00:00 /usr/sbin/apache2 -k start 9 yandufe+ 13993 12792 0 16:22 pts/13 00:00:00 grep --color=auto apache
1 /usr/sbin/apache2 -V|grep SERVER_CONFIG_FILE
得到的目录是:/etc/apache2/apache2.conf