Thread: How to add a browsable folder into a non browsable Apache conf?
hi there,
run 10.04 lts server apache 2 web site.
apache 2 configuration following:
and works pretty, configuration found on web secure wordpress powers web site. default, folder within www folder not browsable (-indexers).code:<virtualhost *:80> serveradmin webmaster@localhost documentroot /home/runner/www/ <directory /> options followsymlinks allowoverride none </directory> <directory /home/runner/www/> options -indexes followsymlinks multiviews allowoverride none order allow,deny allow rewriteengine on rewritebase / # add www (change www.example.com example.com remove www) # rewritecond %{http_host} !^www.mondomaine.com$ [nc] # rewriterule ^(.*)$ http://www.mondomaine.com/$1 [r=301,l] rewriterule ^index\.php$ - [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . /index.php [l] # 5g:[query strings] <ifmodule mod_rewrite.c> rewritecond %{query_string} (environ|localhost|mosconfig|scanner) [nc,or] rewritecond %{query_string} (menu|mod|path|tag)\=\.?/? [nc,or] rewritecond %{query_string} boot\.ini [nc,or] rewritecond %{query_string} echo.*kae [nc,or] rewritecond %{query_string} etc/passwd [nc,or] rewritecond %{query_string} \=\\%27$ [nc,or] rewritecond %{query_string} \=\\\'$ [nc,or] rewritecond %{query_string} \.\./ [nc,or] rewritecond %{query_string} \: [nc,or] rewritecond %{query_string} \[ [nc,or] rewritecond %{query_string} \] [nc] rewriterule .* - [f] </ifmodule> # 5g:[user agents] <ifmodule mod_setenvif.c> setenvifnocase user-agent ^$ keep_out setenvifnocase user-agent (casper|cmsworldmap|diavol|dotbot) keep_out setenvifnocase user-agent (flicky|ia_archiver|jakarta|kmccrew) keep_out setenvifnocase user-agent (libwww|planetwork|pycurl|skygrid) keep_out <limit post put> order allow,deny allow deny env=keep_out </limit> </ifmodule> # 5g:[request strings] <ifmodule mod_alias.c> redirectmatch 403 (https?|ftp|php)\:// redirectmatch 403 /(cgi|https?|ima|ucp)/ redirectmatch 403 (\=\\\'|\=\\%27|/\\\'/?|\)\.css\()$ redirectmatch 403 (\,|//|\)\+|/\,/|\{0\}|\(/\(|\.\.\.|\+\+\+|\|) redirectmatch 403 \.(cgi|asp|aspx|cfg|dll|jsp|mdb|sql|ini|rar)$ redirectmatch 403 /(contac|fpw|install|pingserver|register)\.php redirectmatch 403 (base64|crossdomain|localhost|wwwroot) redirectmatch 403 (eval\(|\_vti\_|\(null\)|echo.*kae) redirectmatch 403 \.well\-known/host\-meta redirectmatch 403 /function\.array\-rand redirectmatch 403 \)\;\$\(this\)\.html\( redirectmatch 403 proc/self/environ redirectmatch 403 msnbot\.htm\)\.\_ redirectmatch 403 /ref\.outcontrol redirectmatch 403 com\_cropimage redirectmatch 403 indonesia\.htm redirectmatch 403 \{\$itemurl\} redirectmatch 403 function\(\) redirectmatch 403 labels\.rdf </ifmodule> <ifmodule mod_deflate.c> # insert filter setoutputfilter deflate # netscape 4.x has problems... browsermatch ^mozilla/4 gzip-only-text/html # netscape 4.06-4.08 have more problems browsermatch ^mozilla/4\.0[678] no-gzip # msie masquerades netscape, fine browsermatch \bmsie !no-gzip !gzip-only-text/html # don't compress images setenvifnocase request_uri \.(?:gif|jpe?g|png)$ no-gzip dont-vary setenvifnocase request_uri \.(?:exe|t?gz|zip|bz2|sit|rar)$ no-gzip dont-vary setenvifnocase request_uri \.pdf$ no-gzip dont-vary # make sure proxies don't deliver wrong content header append vary user-agent env=!dont-vary </ifmodule> <ifmodule mod_expires.c> expiresactive on expiresdefault "access plus 1 seconds" expiresbytype text/html "access plus 1 seconds" expiresbytype image/gif "access plus 1 weeks" expiresbytype image/jpeg "access plus 1 weeks" expiresbytype image/png "access plus 1 weeks" expiresbytype text/css "access plus 1 weeks" expiresbytype text/javascript "access plus 1 weeks" expiresbytype application/x-javascript "access plus 1 weeks" expiresbytype text/xml "access plus 1 weeks" expiresbytype text/.js "access plus 1 weeks" </ifmodule> php_flag display_startup_errors off php_flag display_errors off php_flag html_errors off php_value docref_root 0 php_value docref_ext 0 <files .htaccess> order allow,deny deny </files> <files wp-config.php> order deny,allow deny </files> </directory> </virtualhost>
now, want make 1 folder browsable in web site, know related +indexers directive, don't know how setup such addition.
i've tried many ideas without success. help.
suppose want make /home/runner/www/visible browseable directory. add stanza inside <virtualhost></virtualhost> container:
note work if /home/runner , /home/runner/www have @ least 711 privileges , /home/runner/www/visible has 755 privileges. files visible apache user listed, if have file in /visible/ directory owned user runner 600 permissions, won't displayed web server.code:<directory "/home/runner/www/visible"> options +indexes </directory>
Forum The Ubuntu Forum Community Ubuntu Specialised Support Ubuntu Servers, Cloud and Juju Server Platforms [ubuntu] How to add a browsable folder into a non browsable Apache conf?
Ubuntu
Comments
Post a Comment