首页 > Web开发 > 详细

Ubuntu14.04配置文件Apache2.conf

时间:2016-06-16 17:48:30      阅读:172      评论:0      收藏:0      [点我收藏+]

  关于ubuntu配置文件,严格地说Ubuntu的Apache的配置文件是 /etc/apache2/apache2.conf,Apache在启动时会自动读取这个文件的配置信息。而其他的一些配置文件,如 httpd.conf等,则是通过Include指令包含进来。在apache2.conf中可以找到这些Include行: 

# Include module configuration: 
Include /etc/apache2/mods-enabled/*.load 
Include /etc/apache2/mods-enabled/*.conf 

# Include all the user configurations: 
Include /etc/apache2/httpd.conf 

# Include ports listing 
Include /etc/apache2/ports.conf 
…… 

# Include generic snippets of statements 
Include /etc/apache2/conf.d/ 

# Include the virtual host configurations: 
Include /etc/apache2/sites-enabled/ 

  结合注释,可以很清楚地看出每个配置文件的大体作用。当然,你完全可以把所有的设置放在apache2.conf或者httpd.conf或者任何一个配置文件中。Apache2的这种划分只是一种比较好的习惯。 

  安装完Apache后的最重要的一件事就是要知道Web文档根目录在什么地方,对于Ubuntu而言,默认的是/var/www。怎么知道 的呢?apache2.conf里并没有DocumentRoot项,httpd.conf又是空的,因此肯定在其他的文件中。经过搜索,发现在 /etc /apache2/sites-enabled/000-default中,里面有这样的内容: 

NameVirtualHost * 
<VirtualHost *> 
ServerAdmin webmaster @localhost 

DocumentRoot /var/www/

 

Ubuntu14.04配置文件Apache2.conf

原文:http://www.cnblogs.com/sophiewang/p/5591399.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!