i have problem in Apache 2.4 in Ubuntu 13.10. I try to change Document Root to /home/fandi/public_html And all working fine. But i try to create folder in my public_html/ i get an error like this :
[Sat Jan 25 10:59:50.149441 2014] [autoindex:error] [pid 1093] [client 127.0.0.1:39901] AH01276: Cannot serve directory /home/fandi/public_html/report_php/: No matching DirectoryIndex (index.html,index.cgi,index.pl,index.php,index.xhtml,index.htm) found, and server-generated directory index forbidden by Options directive
I must create file index.html
, index.php
and other index.xxx
file.
In default it must show Directory Index. How to enable Directory Index?
This is my file 000-default.conf
:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /home/fandi/public_html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory "/home/fandi/public_html">
Options All
AllowOverride All
Require all granted
Options Indexes FollowSymLinks
</Directory>
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
Please help, thanks before ^^
By default, the Apache web root or Document root folder location is at /var/www/html.
Introduction. On Ubuntu, the Apache web server serves documents stored in the var/www/html directory by default. This directory is referred to as the document root.
Turns out you need to disable DirectoryIndex in Apache 2.4 to get auto Indexes.
DirectoryIndex disabled
Options Indexes
When DirectoryIndex is not disabled, auto index does not work and apache sends either a 403 Forbidden or a 404 File not found if you use fastcgi/php-fpm.
Here are the corresponding error log lines (for search purposes):
[authz_core:error] client denied by server configuration:
[proxy_fcgi:error] Got error 'Primary script unknown\n'
Options All <--turn on all options
Options Indexes FollowSymLinks <--- replace previously set options with these two
The second line is redundant, because you've already turned on all the options with the first line, and since the two options aren't prefixed with +
, they actually REPLACE the entire options list enabled set with All
with just those two individual options.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With