Apache 2.4 not using the new DocumentRoot, not serving the static content

…衆ロ難τιáo~ 提交于 2019-12-11 13:47:36

问题


This is in connection with this question: Apache doesn't use DocumentRoot after upgrading to Ubuntu 13.10 (Uses default page that says "It works!")

I ma working with 2.4.6 version. After changing the DocumentRoot, when I run apache2 -S, I get the values of Default virtual host, i.e. the DocumentRoot is "/var/www/.

VirtualHost configuration:
*:80                   is a NameVirtualHost
     default server 127.0.1.1 (/etc/apache2/sites-enabled/000-default.conf:1)
     port 80 namevhost 127.0.1.1 (/etc/apache2/sites-enabled/000-default.conf:1)
     port 80 namevhost 127.0.1.1 (/etc/apache2/sites-enabled/000-default.conf:1)
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex watchdog-callback: using_defaults
Mutex proxy: using_defaults
Mutex default: dir="/var/lock/apache2" mechanism=fcntl 
PidFile: "/var/run/apache2/apache2.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="www-data" id=33 not_used
Group: name="www-data" id=33 not_used

The document root is:

DocumentRoot /home/me/my_git/my_project

My Directory permissions are:

<Directory "/home/me/my_git/my_project">
        Options +Indexes +FollowSymLinks +MultiViews
        AllowOverride all
        Require all granted
</Directory>

<Directory />
    Options +FollowSymLinks
    AllowOverride all
</Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
    AllowOverride None
    Options +ExecCGI +MultiViews +SymLinksIfOwnerMatch
    Require all granted
</Directory>

I need to know the reason of this behaviour and how to correct it, my web page is displayed as a plain text. Please let me know if any other detail is needed

来源:https://stackoverflow.com/questions/21136194/apache-2-4-not-using-the-new-documentroot-not-serving-the-static-content

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!