Enabling directory indexing in one folder - apache

I can't manage httpd.conf in order to enable directory index in one specific folder:
<Directory />
Options FollowSymLinks
AllowOverride All
Order deny,allow
Deny from all
IndexIgnore *
<Directory "/srv/http/testsite/images">
Options FollowSymLinks +Indexes
AllowOverride All
Order allow,deny
Allow from all
</Directory>
What's wrong?

What I think you want is:
<Directory />
Options FollowSymLinks -Indexes
AllowOverride All
Order deny,allow
Deny from all
</Directory>
<Directory "/srv/http/testsite/images">
Options FollowSymLinks +Indexes
AllowOverride All
Order allow,deny
Allow from all
</Directory>

It may also not be working depending on ~what~ you expect to be an index file... you should be able to add something this to your .htaccess as well
DirectoryIndex index.html index.html.var index.shtml index.php index.htm index.cfm index.cfml
I believe index.htm is NOT a default, may be what is missing.

Related

Apache: Install Baikal besides Seafile

I need a hint in which direction I should look for an answer on this.
I have set up a Seafile server which is accessible under https://subdomain.no-ip.org, i now want baikal to be accessible under https://subdomain.no-ip.org/baikal
However, I can't get it running because i always get a message from Seafile that this directory does not exist. (I guess seafile thinks it should be a subdirectory)
my recent try to configure apache -
sites-enabled/default-ssl
<VirtualHost *:443>
ServerAdmin webmaster#localhost
Servername gasslnet.no-ip.org
DocumentRoot /var/www
Alias /media /home/andie/seafile-directory/seafile-server-latest/seahub$
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
<Directory "/var/www/baikal/html">
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
My Seafile-Settings:
ccnet/ccnet.conf
SERVICE_URL = https://subdomain.no-ip.org
seahub_settings.py
FILE_SERVER_ROOT = 'http://subdomain.no-ip.org/seafhttp'
I think the issue is in the seafile configuration, if seafile would be accessible under url/seafile and not only the url the problem should be solved. I tried changing the SERVICE_URL, but no effect.
Do you have any ideas about this?
You have to set
SITE_ROOT = '/seafile'
in the seahub_settings.py to access Seafile under
http://subdomain.no-ip.org/seafile

Apache 2.4: How to allow access to a whole directory except a subdirectory in it

I tried this in httpd.conf but it doesn't work, I still gives me access to the subfolder "report".
<Directory "c:/Apache24/htdocs">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
<Directory "c:/Apache24/htdocs/report">
Require all denied
</Directory>
You need Allow or Deny in the Directory.
<Directory "c:/Apache24/htdocs">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
<Directory "c:/Apache24/htdocs/report">
Allow from None
Order allow,deny
</Directory>
More details in the Apache docs: http://httpd.apache.org/docs/current/mod/mod_access_compat.html#allow

Apache forbidden access

Here is a part of my httpd.conf file:
<Directory C:\wamp\www>
Options Indexes FollowSymLinks +ExecCGI
AllowOverride all
Order Allow,Deny
Allow from all
</Directory>
And the error log says:
client denied by server configuration: C:/wamp/www/Bugzilla
I try to access:
localhost/bugzilla
Try putting the following:
<Directory "C:\wamp\www">
Options Indexes FollowSymLinks +ExecCGI
AllowOverride all
Order Allow,Deny
Allow from all
</Directory>
Add this to its config:
Require all granted

AllowOverride for .htaccess on local machine giving 403 Forbidden

I have a mod_rewrite I'd like to use locally on my mac but when I change my configuration to in my directory tag I get a 403 Forbidden error. I've tried all the other solutions around but no luck.
Maybe somebody will see something I am not...
Here is the code:
httpd.conf
<Directory />
Options FollowSymLinks
AllowOverride All
Order deny,allow
Deny from all
</Directory>
<Directory "/Library/WebServer/Documents/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
Which is overridden by myusername.conf
<Directory /Users/adrianmaurer/Sites/www>
Options Indexes MultiViews FollowSymLinks ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
Virtual host file httpd-vhosts.conf
<VirtualHost *:80>
DocumentRoot /Library/WebServer/Documents
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot /Users/adrianmaurer/Sites/www
ServerName myserver.dev
</VirtualHost>
I was able to get it fixed by setting my /etc/apache2/users/username.conf file like so (Note you have to change the Options line too, not just the AllowOverride):
<Directory "/Users/tlhunter/Sites/">
Options All
AllowOverride All
Order allow,deny
Allow from all
</Directory>

how to configure apache to view hidden (`.`) files?

How do I make a directory listing in apache show the ./hidden files? I tried both
<Directory /var/www/*>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
and
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
but neither show the hidden files
check what your IndexIgnore is set to. On mine, it's:
/etc/apache2/mods-enabled/autoindex.conf:IndexIgnore .??* *~ *# RCS CVS *,v *,t
Obviously, you'd want to remove that .??*