Solve No matching DirectoryIndex without adding index - apache

I want to solve or disable this error:
[Thu Jan 02 23:48:06.382888 2020] [autoindex:error] [pid 17460:tid 140351947863808] [client 92.36.xxx.xxx:49018] AH01276: Cannot serve directory /home/user/public_html/kodi/repository/: No matching DirectoryIndex (index.php,index.html.var,index.htm,index.html,index.shtml,index.xhtml,index.wml,index.perl,index.pl,index.plx,index.ppl,index.cgi,index.jsp,index.js,index.jp,index.php4,index.php3,index.phtml,default.htm,default.html,home.htm,index.php5,Default.html,Default.htm,home.html) found, and server-generated directory index forbidden by Options directive
Folder repository doesn't have any index or .htacess file.
I need this folder without index file.
I have apache 2.4 and this config:
<Directory "/home/user/public_html/kodi/">
Require all granted
</Directory>
<Directory "/home/user/public_html/kodi/repository/">
Require all granted
</Directory>
How to solve this error?

I solved this error.
I deleted code above, and enter this:
<Directory "/home/user/public_html/kodi">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
Also deleted .htaccess in kodi folder.
And made default.php empty file and now all works great!

Related

htaccess to disable directory browsing in Apache/2.4.10 (Debian) doesn't work

I create a .htaccess file with this content: (in the folder of the site)
#Disable directory indexes
Options -Indexes
But I still see the directories in the browser.
And in apache2.conf I rewrite this:
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
What did I do wrong?
If that didn't work and you got no error then it looks like .htaccess files are not enabled on your server. You'll need something like AllowOverride All in the server config that controls this area of the filesystem.
At the very least you would need the following to permit just that one directive.
AllowOverride Options=Indexes

apache + symlinks = 403

So I've been reading up a lot on the subject but can't figure out what I'm doing wrong, I also tried a couple solutions found here but still...
I have multilple vhosts set up with Apache, everything working fine serving different files from both /home/usr1/html and /home/usr2/html.
Now I symlinked /home/usr1/html/thisfolder to /home/usr2/html/thatfolder, double checked the FollowSymlinks option is enabled both in apache2.conf and in vhost.conf, but I'm getting a 403 Error.
Why should this be about permits? I mean, www-data can read without any problem from both folders, how is it that when symlinked it just doesn't?
Thanks
EDIT:
Error returned by Apache: (notice the missing script filename, only extension is provided)
[Wed Apr 20 12:13:11.297208 2016] [authz_core:error] [pid 19883] [client 192.168.0.1:12345] AH01630: client denied by server configuration: /home/usr2/html/thatfolder/.php
Virtual Host conf file:
<VirtualHost *:80>
ServerName server.domain.lan
ServerAdmin adm#lan
DocumentRoot /home/usr2/html
<Directory /home/usr2/html>
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
<Directory /home/usr1/html/thisfolder> // original folder
Require all granted
</Directory>
</VirtualHost>

Multiviews on VPS gives me Negotiation error

I'm just started using a VPS and i'm pretty new to Apache and everything.
So i have a few sites up and running, but for some reason i can't get Multiviews to work. I've searched on the internet and found an article that describes my problem, but their solution doesn't work. Also this thread on stackoverflow don't seem to work for me.
I started with the following (site.conf) configuration file in /etc/apache2/sites-availlable
<VirtualHost *:80>
ServerName site.com
DocumentRoot /var/www/vhosts/site.com/webroot/
<Directory /var/www/vhosts/site.com/webroot/>
Options Indexes FollowSymLinks Multiviews
AllowOverride all
</Directory>
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/site_acces.log combined
ErrorLog ${APACHE_LOG_DIR}/site_error.log
</VirtualHost>
Now when i go to www.site.com/index.php it works fine, but www.site.com/index gives me a 404 and the following log message:
[Tue Feb 24 10:18:45 2015] [error] [client 213.125.184.74] Negotiation: discovered file(s) matching request: /var/www/vhosts/site.com/webroot/index (None could be negotiated).
So i changed site.conf to the following:
<VirtualHost *:80>
ServerName site.com
DocumentRoot /var/www/vhosts/site.com/webroot/
<Directory /var/www/vhosts/site.com/webroot/>
Options Indexes +FollowSymLinks -Multiviews
AllowOverride all
</Directory>
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/site_acces.log combined
ErrorLog ${APACHE_LOG_DIR}/site_error.log
</VirtualHost>
Unfortunately, still the same error in my log file, so i disabled the negotiation module (as mentioned), but that just gives me this message:
[Tue Feb 24 10:21:02 2015] [error] [client 213.125.184.74] File does not exist: /var/www/vhosts/site.com/webroot/index
After all my modifications to site.conf i did an service apache2 restart and/or service apache2 reload
At this point i have no clue on how to solve this problem so i hope anyone point me in the right direction.
I think "Options Indexes FollowSymLinks Multiviews" is the correct configuration. And yes, you need do "apache reload" after you modify the configuration.
Also make sure you accept "php" in content Negotiation. (by default it might not accept)

"client denied by server configuration" after password protection setup in apache2

I created .htaccess and .htpassword for password protection in apache. Then, I modified https.conf.
<Directory "/Library/WebServer/Documents">
Options Indexes FollowSymLinks MultiViews
#AllowOverride None
AllowOverride AuthConfig All
Order allow,deny
Allow from all
</Directory>
After the setting, password protection works fine, but the issue is that the webpage cannot load image file which is in subdirectory of "/Library/WebServer/Documents". Executing tail /var/log/apache2/error_log gives me this error message.
[error] [client 127.0.0.1] client denied by server configuration: /Library/WebServer/Documents/moniwiki/data/cache/gnuplot/wikipagesetupMacBookProTask]-wikipages.png, referer: http://localhost/moniwiki/wiki.php/setupMacBookProTask
When I make AllowOverride AuthConfig None, the error is gone, then there is no password protection.
What's wrong with this? How can I access the subdirectory with password protection?
Following the instruction on this wiki, I added
<Directory "/Library/WebServer/Documents/moniwiki/data/cache/gnuplot">
Order allow,deny
Allow from all
</Directory>
to the https.conf, and it works fine.

Apache 403 Error WampServer 2

I have WampServer 2 installed and I have created an alias on my computer called test which points to directory g:/test/.
However I keep getting a 403 error when I try and access localhost/test/
Which is being caused by these lines in my httpd.conf (if I comment these lines out it loads)
<Directory />
AllowOverride none
Require all denied
</Directory>
My conf for test is as follows:
Alias /test/ "g:/test/"
<Directory "g:/test/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
Allow from all
</Directory>
How do I override the Require all denied in my test.conf file to stop the 403 errors?
Error Log reads:
[Sun Dec 09 18:51:23.757803 2012] [authz_core:error] [pid 5128:tid 884] [client ::1:50622] AH01630: client denied by server configuration: G:/test/
Access Log reads:
::1 - - [09/Dec/2012:18:51:23 +0000] "GET /test/ HTTP/1.1" 403 207
Try to replace deprecated:
Order allow,deny
Allow from all
By:
Require all granted
Concerns only Apache >= 2.4. However, I recommand to disable mod_access_compat (line LoadModule) to avoid Order/Allow/Deny conflicts with Require.
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Allow from all
#Require local
Require all granted
above file comment #Require local
add extra Require all granted
solved