I installed wamp3 64 bit with php 5.6.16 and Apache 2.4.17 and MySql 5.7.9 in windows 10.
My problem:
When in a folder (in www folder) not exist index.php (OR index.html) error 404 Occurs and didn't show directories and files list.
My httpd.conf file: http://paste.ubuntu.com/14475697/
Error screenshot:
Try the following,
Create a .htaccess file and put the following directive
Options Indexes
Follow the link,
http://www.cyberciti.biz/faq/enabling-apache-file-directory-indexing/
Related
If I add Options +Indexes in .htaccess this will display all files and subdirectories. However, I would like to exclude files for the current directory. i.e. display directories only for the current directory and display files and directories for any subdirectories.
Is this possible in .htaccess or will I need to write my own script to generate the directory index?
According to the comment of CBroe above, I've maked this approach tested in debian apache2 in .htaccess:
Options +Indexes
IndexIgnore *.*
This will ignore files with a file extension such as file.html. As we usually not name a directoty with a dot extension, so directories will be shown.
Please consult also apache autoindex reference http://httpd.apache.org/docs/2.4/mod/mod_autoindex.html .
i try to work on a php project that uses symlinks (it was developped on linux).
i'm on windows, i use bash on windows aka bash on ubuntu on windows aka windows subsystem for linux as a development server.
when apache tries to reach a file within the symlinks it fails.
e.g. when i try to open /var/www/website/symlink/index.html it returns a 403 :
[core:error] [pid 742] AH00554: Access to file /var/www/website/symlink/.htaccess denied by server: not a regular file
i don't know why but it seems apache tries to open a .htaccess file that does not exist, and of course fails at it.
(the symlink points out of the scope of the virtualhost root)
everything is 777.
i can successfully access /var/www/website/symlink/index.html from the command line.
i can successfully access the index.html file when i remove the symlink and copy its target directory instead.
i've tried to delete symlinks and recreate them, it doesn't change anything.
i've tried to create /var/www/website/symlink/.htaccess but it doesn't change anything.
does it sound like a bug or a bad apache configuration or something else ?
this issue was related to this bug : https://github.com/Microsoft/BashOnWindows/issues/650
i got everything to work by removing symlinks and recreate them without trailing slash.
it seems that in a symlink with a trailing slash every directories and every files exist (just try to cd dsfkjhgfkdshjajklhdaf e.g.)
this explains that apache was finding a non existent .htaccess file and was desperately trying to read it.
i wonder when this bug will get fixed though...
I'm trying to make apache run on Linux Subsystem for Windows.
So I just installed apache and changed DocumentRoot from "/var/www/html" to "/var/www" in /etc/apache2/sites-available/000-default.conf.
This has exactly the effect I wanted it to have, namely to list all folders inside when browsing to "localhost".
My projects are located on my Windows drive in "C:/Projekte", so I created a symlink like so:
sudo ln -s /mnt/c/Projekte /var/www/projects
Now my problem is, when I browse to localhost and click on projects it runs into a loop trying to call an index.html, so the url before it breaks looks like this:
http://localhost/projects/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/
I would want to see the directory listing of my folders instead.
I know about the Options Indexes and FollowSymLinks which are both set, but there seems to be something else I have to set for symlinks to work as I expect.
If I create a folder instead in "/var/www" it works fine.
Does anybody know how to set this up correctly?
By accident I found out, that my issue here is related to this issue on BashOnWindows. Problem is that I used tab to autocomplete the path which automatically added a trailing slash to the end of the path. So the actual command I used to create the symlink was
sudo ln -s /mnt/c/Projekte/ /var/www/projects
Creating the symlink without trailing slash, just like in my question it works just fine.
I use the .htaccess file from apache2 in /var/www/html/, after a while the file gets overwritten with what seem to be a default config file and I don't know why..
I don't use Wordpress or any CMS.
Any idea?
The problem was cause by "grunt build" that would automatically create an .htaccess file for me...
Does anyone know where is the .htaccess file located after I install in linux red hat 5?
There is no .htaccess file that's installed. You will have a global config file for Apache, which is in /etc/httpd/conf/httpd.conf on RedHat (see http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/4/html/Reference_Guide/s1-apache-config.html). On the other hand, .htaccess files are something you create on a per-directory basis where the actual web files live.