微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

php-无效命令’VirtualDocumentRoot’

我试图将虚拟PHP Devserver配置为使用域的一部分来服务不同的Directory,具体取决于请求来自的域…我猜想apache缺少了虚拟别名模块.我只是不知道如何检查它是否存在以及如何安装它…下面您会发现当我在其上运行a2dissite时正在处理的站点配置文件Apache启动正常只有当我启用vBoxsf时,它才会在启动/重新加载时失败,或者只要在其配置上运行“ configtest” …

这是/etc/apache2/sites-available/vBoxsf.conf

<VirtualHost *:80 *:8080>
  ServerName sandBox
  ServerAlias *.dev

  LogLevel info
  ErrorLog ${APACHE_LOG_DIR}/dev-error.log
  CustomLog ${APACHE_LOG_DIR}/dev-access.log combined

  RewriteEngine On

  <Directory />
    Options FollowSymLinks
    AllowOverride All
  </Directory>

  <Directory /media/>
    Order allow,deny
    Allow from all
    Require all granted
  </Directory>

  <Location /server-status>
    SetHandler server-status
    Order allow,deny
    Allow from all
    Require all granted
  </Location>

  UseCanonicalName Off
  VirtualDocumentRoot /media/sf_%1
</VirtualHost>

sudo服务apache2的输出重新加载

 * Reloading web server apache2                                                                                                                                                                                                             *
 * The apache2 configtest Failed. Not doing anything.
Output of config test was:
AH00526: Syntax error on line 30 of /etc/apache2/sites-enabled/vBoxsf.conf:
Invalid command 'VirtualDocumentRoot', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' Failed.
The Apache error log may have more information.

和尾巴/var/log/apache2/error.log

[Wed Mar 04 17:05:43.698449 2015] [mpm_prefork:notice] [pid 1172] AH00169: caught SIGTERM, shutting down
[Wed Mar 04 17:28:35.880536 2015] [mpm_prefork:notice] [pid 2604] AH00163: Apache/2.4.10 (Ubuntu) PHP/5.5.12-2ubuntu4 configured -- resuming normal operations
[Wed Mar 04 17:28:35.880657 2015] [core:notice] [pid 2604] AH00094: Command line: '/usr/sbin/apache2'
[Wed Mar 04 17:32:39.675812 2015] [mpm_prefork:notice] [pid 2604] AH00169: caught SIGTERM, shutting down
[Wed Mar 04 17:32:40.788348 2015] [mpm_prefork:notice] [pid 2715] AH00163: Apache/2.4.10 (Ubuntu) PHP/5.5.12-2ubuntu4 configured -- resuming normal operations
[Wed Mar 04 17:32:40.788487 2015] [core:notice] [pid 2715] AH00094: Command line: '/usr/sbin/apache2'
[Wed Mar 04 17:32:58.596151 2015] [mpm_prefork:notice] [pid 2715] AH00169: caught SIGTERM, shutting down
[Wed Mar 04 17:32:59.706649 2015] [mpm_prefork:notice] [pid 2787] AH00163: Apache/2.4.10 (Ubuntu) PHP/5.5.12-2ubuntu4 configured -- resuming normal operations
[Wed Mar 04 17:32:59.706763 2015] [core:notice] [pid 2787] AH00094: Command line: '/usr/sbin/apache2'
[Wed Mar 04 17:49:48.283025 2015] [mpm_prefork:notice] [pid 2787] AH00169: caught SIGTERM, shutting down

解决方法:

... or defined by a module not included in the server configuration

您很可能会错过mod_vhost_alias的Apache插件.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐