问题
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