Apache2 Apache 2.4.6的新站点配置文件

Apache2 Apache 2.4.6的新站点配置文件,apache2,virtualhost,Apache2,Virtualhost,今天早些时候,我刚刚升级到Ubuntu 13.10。Apache2的版本现在是2.4.6。我删除了旧的站点配置文件,并尝试创建一个新的站点配置文件。当我试图复制default.conf时,我发现格式已经发生了很大的变化。下面是一个新conf文件的示例。和很多人一样,即使我将文件夹权限设置为777,我也有一个被禁止的问题 1 <VirtualHost *:80> 2 # The ServerName directive sets the request

今天早些时候,我刚刚升级到Ubuntu 13.10。Apache2的版本现在是2.4.6。我删除了旧的站点配置文件,并尝试创建一个新的站点配置文件。当我试图复制default.conf时,我发现格式已经发生了很大的变化。下面是一个新conf文件的示例。和很多人一样,即使我将文件夹权限设置为777,我也有一个被禁止的问题

      1 <VirtualHost *:80>
      2     # The ServerName directive sets the request scheme, hostname and port th    at
      3     # the server uses to identify itself. This is used when creating
      4     # redirection URLs. In the context of virtual hosts, the ServerName
      5     # specifies what hostname must appear in the request's Host: header to
      6     # match this virtual host. For the default virtual host (this file) this
      7     # value is not decisive as it is used as a last resort host regardless.
      8     # However, you must set it for any further virtual host explicitly.
      9     ServerName www.janicezhang.me
     10 
     11     ServerAdmin webmaster@localhost
     12     DocumentRoot /home/yifan/www/janice
     13 
     14     # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
     15     # error, crit, alert, emerg.
     16     # It is also possible to configure the loglevel for particular
     17     # modules, e.g.
     18     #LogLevel info ssl:warn
     19 
     20     ErrorLog ${APACHE_LOG_DIR}/error.log
     21     CustomLog ${APACHE_LOG_DIR}/access.log combined
     22 
     23     # For most configuration files from conf-available/, which are
     24     # enabled or disabled at a global level, it is possible to
     25     # include a line for only one particular virtual host. For example the
     26     # following line enables the CGI configuration for this host only
     27     # after it has been globally disabled with "a2disconf".
     28     #Include conf-available/serve-cgi-bin.conf
     29 </VirtualHost>
1
2#ServerName指令将请求方案、主机名和端口设置为
3#服务器用于识别自身。这在创建时使用
4#重定向URL。在虚拟主机的上下文中,服务器名
5#指定必须在请求的主机:头中显示的主机名
6#匹配此虚拟主机。对于默认虚拟主机(此文件),此
7#价值不是决定性的,因为它被用作最后的主人。
8#但是,必须为任何其他虚拟主机显式设置它。
9服务器名www.janicehang.me
10
11服务器管理员webmaster@localhost
12 DocumentRoot/home/yifan/www/janice
13
14#可用日志级别:trace8、…、trace1、调试、信息、通知、警告、,
15#错误、暴击、警报、紧急情况。
16#还可以为特定应用程序配置日志级别
17#模块,例如。
18#日志级别信息ssl:警告
19
20 ErrorLog${APACHE_LOG_DIR}/error.LOG
21 CustomLog${APACHE_LOG_DIR}/access.LOG组合
22
23#对于conf/available/中的大多数配置文件
24#在全局级别启用或禁用,可以
25#仅包含一个特定虚拟主机的行。例如
26#下一行仅启用此主机的CGI配置
27#在被“A2F”全局禁用后。
28#包括可用的conf/service-cgi-bin.conf
29

我只是想知道在Ubuntu13.10中是否有为Apache2.4.6设置虚拟主机的工具。谢谢。

好的,我自己解决了这个问题。需要做两件事。 首先,在站点配置文件中添加如下行:

<Directory "/home/yifan/www/janice">
    Options ExecCGI
    AllowOverride all
    Require all granted
</Directory>

然后,恢复站点

你是说,我们应该自己添加目录标签?我有同样的问题,基于java的网站以纯文本的形式出现。对于apache的早期版本2.2.22,我需要在default.conf的新版本中设置3个目录标记。如果您在2.4.6版本的default.conf中更新您的答案,解释新的更改/添加,那就太好了。@engineer是的,默认值没有标记。所以,我认为你必须手动添加一个。
sudo apt-get install libapache2-mod-php5