htaccess deny from all gets apache server test page

I have installed zpanel with centos 6.3. Now what is the problem.

I have added domain mydomain.com and I have added blank index.php file. I added too .htaccess file with "deny from all" Now when I open the page in the browser, I get Apache 2 Test Page instead 403 Forbidden But if I open http://mydomain.com/index.php, now I get 403 Forbidden.

I tried to edit the apache config file Directoryindex but there is no positive result. Anyone can help me?

Upvotes: 4

Views: 3447

Answers (2)

n3rvio
n3rvio

Reputation: 9

Same problem, when apache has been updated, the file welcome.conf has been created. I've renamed it to disable it and now I get to see the Forbidden page for my Deny from all directives

Upvotes: 0

Maxime Pacary
Maxime Pacary

Reputation: 23041

Try to disable the default Apache CentOS welcome page:

#
# This configuration file enables the default "Welcome"
# page if there is no default index page present for
# the root URL.  To disable the Welcome page, comment
# out all the lines below.
#
<LocationMatch "^/+$">
    Options -Indexes
    ErrorDocument 403 /error/noindex.html
</LocationMatch>

Edit file /etc/httpd/conf.d/welcome.conf and comment everything. Simply removing the welcome.conf file (or renaming it as .conf.disabled for example) should do the trick too.

Then, reload apache configuration (service httpd restart) and things should work as expected.

Upvotes: 4

Related Questions