Why dir_module does NOT seem to load, although clearly it is loaded in httpd.conf and modules folder?

こ雲淡風輕ζ 提交于 2019-12-11 06:48:20

问题


I checked the httpd.conf file which has "LoadModule dir_module modules/mod_dir.so " uncommented already. I also check the apache modules folder seeing that mod_dir.so is there too. BUT still the module_dir does not seem to have loaded at all.

Because when I tried to set up this virtual folder, if I put the line Alias /myblog "D:/php/try" inside the ifmodule directive like the following:

<IfModule dir_module>
    DirectoryIndex index.html index.htm index.php
    Alias /myblog "D:/php/try"
   <Directory "d:/php/try">
   Order allow,deny
   Allow from all
   </Directory> 
</IfModule>

It would NOT work, when accessed by url /blog apache says error 404 not found.

But if I put the line
Alias /myblog "D:/php/try"
outside the ifmodule directive, then the line will work and apache can find the folder. So I think it's because the module_dir hasn't been loaded yet.

But how can I load it? I already checked the two places as mentioned above which seem to suggest that it is loaded already. Please help. Thanks in advance.

p.s. My platform is windows 7


回答1:


Remove the <IfModule> tags and only have DirectoryIndex index.html index.cgi index.pl index.php index.xhtml (in httpd.conf). That works for me in Windows 7 environment.



来源:https://stackoverflow.com/questions/13516573/why-dir-module-does-not-seem-to-load-although-clearly-it-is-loaded-in-httpd-con

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