appserver-io / appserver

A multithreaded application server for PHP, written in PHP.
http://appserver.io/
Open Software License 3.0
965 stars 104 forks source link

[appserver-io/webserver] problem setting directoryIndex in virtual-hosts.xml #1069

Open al-Obaidi opened 7 years ago

al-Obaidi commented 7 years ago

Setting directoryIndex in conf.d/virtual-hosts.xml doesn't work. For example, if I want to set "x.pdf" as a directoryIndex, this supposed setting will not work:

conf.d/virtual-hosts.xml

<params>
    <param name="documentRoot" type="string">/opt/appserver/webapps/example_com</param>
    <param name="directoryIndex" type="string">x.pdf</param>
</params>

As a temproray solution, "x.pdf" should be added to appserver.xml as follow

<server
name="http"
<params>
<param name="directoryIndex" type="string">index.dhtml index.do index.php index.html index.htm x.pdf</param>

But this will make "x.pdf" is a directoryIndex for the whole server not to a specific virtual-host.

Test on CentOS Linux release 7.3.1611