几个概念(以下文件默认路径为 /etc/apache2/):

1.apache2.conf 是主配置文件,httpd.conf 用户配置文件

2.虚拟目录在 httpd.conf 中

 

DocumentRoot “路径”

ServerName 名称

allow from all Options +Indexes

 

3.根设置(默认主目录)在 /etc/apache2/sites-available/default

4.重启命令

sudo /etc/init.d/apache2 restart

或者

cd /etc/init.d

sudo apache2 -k restart

stop 停止;start 启动

5.日志文件在 /var/log/apache2/