首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Apache不加载文档根

问Apache不加载文档根
EN

Server Fault用户
提问于 2016-11-15 22:32:12
回答 1查看 1K关注 0票数 0

所以,这个问题看起来很简单,但我很不幸地试图解决这个问题,但没有结果。Apache仍然没有看到"/web“目录(例如,我无法加载那里存在的css样式或图像)。下面是我的httpd-vhosts.conf:

代码语言:javascript
复制
# Virtual Hosts
#

<VirtualHost *:80>
    ServerName localhost
    DocumentRoot c:/wamp64/www
    <Directory  "c:/wamp64/www/">
        Options +Indexes +Includes +FollowSymLinks +MultiViews
        AllowOverride All
        Require local
    </Directory>
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "C:\wamp64\www\projekt2\web"
    ServerName projekt2.dev
    ServerAlias projekt2.dev www.projekt2.dev
    Options Indexes FollowSymLinks

    <Directory "C:\wamp64\www\projekt2\web">
#        AllowOverride All
#        Order Allow,Deny
#        Allow from All

     Options Indexes FollowSymLinks Includes ExecCGI
    AllowOverride All
    Require all granted
    Allow from all

</Directory>
</VirtualHost>

以及Windows目录中的hosts.conf:

代码语言:javascript
复制
# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

# localhost name resolution is handled within DNS itself.
    127.0.0.1       localhost
#   ::1             localhost
    127.0.0.1   projekt2.dev
    ::1     projekt2.dev

有人知道怎么解决这个问题吗?我会非常感激的。

EN

回答 1

Server Fault用户

发布于 2016-11-16 07:05:42

我只想确定-你看不到哪个虚拟主机?ServerName本地主机还是ServerName本地主机?

我看到您在Windows上运行Apache,所以我不确定这些命令行开关是否能工作,因为我在linux上将它们用于apache。

/usr/local/apache2/bin/httpd -S

它将输出Apache如何解析配置文件的描述。仔细检查可能有助于发现配置错误。

httpd -t

只对配置文件运行语法测试。

权限在这里也可以发挥很大作用。apache服务(守护进程)帐户是否有权访问不可访问文件的位置?

票数 0
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/815129

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档