Apache do not show README.TXT files in directory listing. How can i enable it? - apache

In CentOS 6.0, i have apache for allowing to download drivers + one README.TXT file. But when the site is visited as http://site.mooo.com/ it shows all zip files but not the TXT file.
<VirtualHost *:80>
ServerName site.mooo.com
ServerAlias site.mooo.com
DocumentRoot /var/www/html/download
<Directory /var/www/html/download>
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Should show all, but only shows two zip file
/var/www/html/download/
driver.zip
driver.new.zip
README.TXT

I know it's old, but for what it's worth :
Edit your httpd.conf file
Locate the line with the IndexIgnore directive
Remove README* from that pattern
=> It will display the README.txt files.

create a .htaccess, try Options +Indexes

Related

Yii2 Advance application show directory listing instead web view

I just copy my Yii2 advanced app from windows to linux.
PHP, Apache2, etc already installed successfully.
But when I got to localhost/myweb It show directory listing instead of web view.
Here is my apache2.conf
<VirtualHost *:80>
DocumentRoot /var/www/html/myweb/frontend/web/
</VirtualHost>
Here is myweb/.htaccess
# prevent directory listings
Options -Indexes
IndexIgnore */*
# follow symbolic links
Options FollowSymlinks
RewriteEngine on
RewriteRule ^administrator(/.+)?$ backend/web/$1 [L,PT]
RewriteRule ^(.+)?$ frontend/web/$1
How I can show web view, instead of directory listing?
Where I doing wrong?
Thanks in advance.
On Linux, you may need to modify the httpd.conf file located at:
/etc/httpd/conf/httpd.conf
you should change the following lines from:
<Directory "/var/www/html">
AllowOverride None
</Directory>
to
<Directory "/var/www/html">
AllowOverride All
</Directory>
and then restart the httpd service

Directory 'static' gives 404 error

On a Windows machine running XAMPP I have a folder in my web root called 'static'. It and everything in it return a 404 error even though the folder is there.
If I change the name of the folder, e.g. 'statics', all is well. I have other servers (Ubuntu) running Apache and I do not have this problem.
The site is a copy of one of the sites on one of our Linux servers. What can I do or change to allow the directory to work as named?
EDIT vhosts.conf
<VirtualHost *:8080>
ServerAdmin jablanchard#foo.com
DocumentRoot "C:/xampp/htdocs/home/app/gateway"
ServerName localhost
ServerAlias 127.0.0.*
ErrorLog "logs/error.log"
CustomLog "logs/access.log" common
</VirtualHost>
<Directory C:/xampp/htdocs/home/app/gateway/>
# allow .htaccess overrides to work
AllowOverride All
DirectoryIndex login.html index.html index.php
</Directory>
# this matches a link to any project directory to the physical webui directory
AliasMatch ^/projects/([-\w]*)/(.*)$ /home/src/gateway/webui/$2
<Directory /home/src/gateway/webui>
DirectoryIndex home.html
Options All
AllowOverride All
Require all granted
</Directory>
I was getting ready to re-install XAMPP but made one last pass through the config files for Apache. I found the problem was this bit of code in the httpd.conf file -
Alias "/static" "C:/xampp/htdocs/static"
<Directory "C:/xampp/htdocs/static">
AllowOverride All
Require all granted
</Directory>
I am not sure if this is part of the XAMPP install as all of the edits I have made to this installation are in the vhosts file. Once commented out the static directory, as I have defined it, works properly now.

How come Apache retrieves files from the `html` subdirectory when only `/var/www` is specified in `<Directory>` path

I have the following (default) <Directory> directive in my apache2.conf configuration file:
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
and the /var/www directory contains only an html directory with an index.html file inside and no .htaccess (neither near or in the html directory). What default configuration value makes Apache give me files fro the html directory? I would have expected that the DocumentRoot (if nowhere provided) is the Directory path.
I am not sure which OS and distro you are using, but my Mint/Ubuntu has /etc/apache2/sites-available/000-default.conf which DocumentRoot is /var/www/html
Please check if you have the same VirtualHost

virtualhost not using htaccess on fedora 19

I've recently switched over to a fedora 19 cloud server service and got most things squared away except for htaccess. Am I doing this wrong or missing something?
This is what i have updated in my httpd.conf file
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride All
And Here is my VirtualHost telling it what folder structure and which file to use for htaccess
<VirtualHost *:80>
DocumentRoot /var/www/vhosts/domain.com/httpdocs
ServerName www.domain.com
ServerAlias www.domain.com
<Directory /var/www/vhosts/domain.com/vhosts/>
AllowOverride All
Order allow,deny
allow from all
</Directory>
AccessFileName .htaccess
</VirtualHost>
I've thrown random junk into my htaccess and I do not get a 500 error so I know its not getting read.
Your document root is:
/var/www/vhosts/domain.com/httpdocs
And your <Directory> container is for:
/var/www/vhosts/domain.com/vhosts/
Are those supposed to be different? If your htaccess file is in the httpdocs directory, then that directory doesn't have the AllowOverride All associated with it. If your htaccess file is in the vhosts directory, then it's not being accessed when you go to your website.

Server set up of project with vhosts config

Zend framework is new to me and I'm working from a book so I can get a rudimentary grasp of things (book is Zend Framework A Beginners Guide).
I have my project set up and have created it in a folder called "test"
I have also added a vhost, vhosts file contains:
<VirtualHost *:80>
DocumentRoot "C:/Program Files/Zend/Apache2/htdocs/test/public"
ServerName .localtest
# This should be omitted in the production environment
SetEnv APPLICATION_ENV development
<Directory "C:/Program Files/Zend/Apache2/htdocs/test/public">
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
I have called the vhosts file from within apaches conf file
I have also added a line to system32 hosts file:
127.0.0.1 test.localtest
My problem is that when I browse to http://test.localtest/ I get the zend server test page, when as from what I am reading I should be getting the Zend Framework projects Main Page splash, this I can reach by browsing to http://test.localtest/test/public/
Am I missing something?
Try changing
<VirtualHost *:80>
DocumentRoot "C:/Program Files/Zend/Apache2/htdocs/test/public"
ServerName .localtest
to
<VirtualHost *:80>
DocumentRoot "C:/Program Files/Zend/Apache2/htdocs/test/public"
ServerName test.localtest
EDIT
ok i have check on my system and it work perfectly, but i am using ubuntu hope this helps
edit this file
C:\Program Files\Zend\Apache2\conf (Zend Server on Windows machines)
and add this code
<VirtualHost *:80>
ServerName test.localtest
DocumentRoot "C:/Program Files/Zend/Apache2/htdocs/test/public"
SetEnv APPLICATION_ENV "development"
<Directory "C:/Program Files/Zend/Apache2/htdocs/test/public">
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
then edit this file
C:\WINDOWS\system32\drivers\etc\hosts
and add this line
127.0.0.1 test.localtest
and then dont forget to restart you apache server (wamp or xampp or anything you are using)
and then open this link
http://test.localtest
try to write the url with http:// sometimes the browser does not work without http://
try it comment if it does not work
one thing most everyone misses is that Zf needs FollowSymlinks to work most of the time.
this is the directory definition I usually use in my vhosts
<directory "C:\www\project">
Options Indexes FollowSymlinks
AllowOverride all
Order Deny,Allow
Allow from all
</directory>
not sure how DirectoryIndex will affect this.
make sure mod_rewrite is enabled in Apache:
LoadModule rewrite_module modules/mod_rewrite.so //make sure this line is uncommented httpd.conf
make vhosts is enabled in apache:
Include conf/extra/httpd-vhosts.conf //make sure this line is uncommented httpd.conf
make sure this line is present in your vhosts file usually above the vhosts definitions:
NameVirtualHost *:80