Posted August 13th, 2010 by jDictionary
I'm trying to get directory indexes enabled. I'm using the embedded Apache server. I copied the httpd.conf.template to httpd.conf and then added this to the bottom:
<Directory "$$PROJECTDIR$$">
Options Indexes
</Directory>
I then updated my project's advanced debug settings to use the modified httpd.conf file. I verified that the template was used by checking the hidden .httpd.conf file in my project dir. Unfortunately, directory indexes do not get enabled. I get the standard Apache 404 error (happens when you try to browse a directory that doesn't have a recognized index file).
BTW, I love this product. I'm trying it out now and really, really impressed. Just hoping to get this feature enabled.
Thanks,
Rick
juanc says:
Can you post the resulting .httpd.conf file?
jDictionary says:
Thanks for the reply Juan. Yes, I have included it below. The part where I tried to enable indexes is at the bottom.
Listen 127.0.0.1:35585LoadModule mime_module "C:\Program Files (x86)\Jcx.Software\VS.Php\2010\apache2/modules/mod_mime.so"
LoadModule dir_module "C:\Program Files (x86)\Jcx.Software\VS.Php\2010\apache2/modules/mod_dir.so"
LoadModule rewrite_module "C:\Program Files (x86)\Jcx.Software\VS.Php\2010\apache2/modules/mod_rewrite.so"
LoadModule alias_module "C:\Program Files (x86)\Jcx.Software\VS.Php\2010\apache2/modules/mod_alias.so"
LoadModule actions_module "C:\Program Files (x86)\Jcx.Software\VS.Php\2010\apache2/modules/mod_actions.so"
LoadModule env_module "C:\Program Files (x86)\Jcx.Software\VS.Php\2010\apache2/modules/mod_env.so"
<IfDefine PHP_4>
LoadModule cgi_module "C:\Program Files (x86)\Jcx.Software\VS.Php\2010\apache2/modules/mod_cgi.so"
SetEnv PHPRC "C:/Users/rnoelle/documents/visual studio 2010/Projects/Sitebuilder/Sitebuilder Web/"
ScriptAlias /cgi-bin/ "C:/Program Files (x86)/Jcx.Software/VS.Php/2010/PHP 5.2/"
AddType application/x-httpd-php .php .php4 .phtml
Action application/x-httpd-php "/cgi-bin/php.exe"
</IfDefine>
#Use the below for CGI mode
<IfDefine PHP_5_2_CGI>
LoadModule cgi_module "C:\Program Files (x86)\Jcx.Software\VS.Php\2010\apache2/modules/mod_cgi.so"
SetEnv PHPRC "C:/Users/rnoelle/documents/visual studio 2010/Projects/Sitebuilder/Sitebuilder Web/"
Action application/x-httpd-php "/cgi-bin/php-cgi.exe"
ScriptAlias /cgi-bin/ "C:/Program Files (x86)/Jcx.Software/VS.Php/2010/PHP 5.2/"
AddType application/x-httpd-php .php .php5 .phtml
</IfDefine>
<IfDefine PHP_5_2_SAPI>
#use the below for Apache sapi dll
AddType application/x-httpd-php .php .php5 .phtml
LoadFile "C:/Program Files (x86)/Jcx.Software/VS.Php/2010/PHP 5.2/php5ts.dll"
LoadModule php5_module "C:/Program Files (x86)/Jcx.Software/VS.Php/2010/PHP 5.2/php5apache2_2.dll"
AddType application/x-httpd-php .php .php5 .phtml
PHPINIDir "C:/Users/rnoelle/documents/visual studio 2010/Projects/Sitebuilder/Sitebuilder Web/"
</IfDefine>
#Use the below for CGI mode
<IfDefine PHP_5_3_CGI>
LoadModule cgi_module "C:\Program Files (x86)\Jcx.Software\VS.Php\2010\apache2/modules/mod_cgi.so"
SetEnv PHPRC "C:/Users/rnoelle/documents/visual studio 2010/Projects/Sitebuilder/Sitebuilder Web/"
Action application/x-httpd-php "/cgi-bin/php-cgi.exe"
ScriptAlias /cgi-bin/ "C:/Program Files (x86)/Jcx.Software/VS.Php/2010/PHP 5.2/"
AddType application/x-httpd-php .php .php5 .phtml
</IfDefine>
<IfDefine PHP_5_3_SAPI>
#use the below for Apache sapi dll
AddType application/x-httpd-php .php .php5 .phtml
LoadFile "C:/Program Files (x86)/Jcx.Software/VS.Php/2010/PHP 5.2/php5ts.dll"
LoadModule php5_module "C:/Program Files (x86)/Jcx.Software/VS.Php/2010/PHP 5.2/php5apache2_2.dll"
AddType application/x-httpd-php .php .php5 .phtml
PHPINIDir "C:/Users/rnoelle/documents/visual studio 2010/Projects/Sitebuilder/Sitebuilder Web/"
</IfDefine>
DirectoryIndex index.php index.html
ServerRoot "C:\Users\rnoelle\AppData\Roaming\Jcx.Software\VS.Php\Apache2\Sitebuilder Web"
TypesConfig "C:\Program Files (x86)\Jcx.Software\VS.Php\2010\apache2\conf\mime.types"
DefaultType text/plain
ServerName rnoelle
DocumentRoot "C:/Users/rnoelle/documents/visual studio 2010/Projects/Sitebuilder/Sitebuilder Web"
ThreadsPerChild 10
MaxRequestsPerChild 0
<Directory "C:/Users/rnoelle/documents/visual studio 2010/Projects/Sitebuilder/Sitebuilder Web">
Options Indexes
</Directory>
jDictionary says:
I was able to get around this by using IIS. IIS is my preferred web server anyway. Initially I had issues with IIS but I worked around them and documented the change here:
http://www.jcxsoftware.com/jcx/node/3188