Solved

Forbidden You don't have permission to access /admin.html on this server.

Posted on 2004-10-19
25
754 Views
Last Modified: 2010-08-05
Dear all,

I get the message:

Forbidden
You don't have permission to access /admin.html on this server.

when trying to access my website like http://www.website.com/admin.html

I don't know what it could be...

Here is the setup in the Apache config file:

DocumentRoot "/usr/local/psa/admin/htdocs"
<Directory />
    SSLRequireSSL
    Options FollowSymLinks
    AllowOverride None
</Directory>
<Directory "/usr/local/psa/admin/htdocs">
    Options FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

#UserDir public_html

DirectoryIndex index.html index.php index.php3

AccessFileName .htaccess

<Files .htaccess>
    Order allow,deny
    Deny from all
</Files>

Any idea..?

Thanks

Stephane
0
Comment
Question by:stephaneeybert
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 14
  • 11
25 Comments
 
LVL 19

Expert Comment

by:ramazanyich
ID: 12347603
It can be that user under which apache runs doesn't have access to "/usr/local/psa/admin/htdocs directory.
Add read permissions for that user using chmod or chown to your directory
0
 

Author Comment

by:stephaneeybert
ID: 12349037
I can access to the php info file sitting next to the admin.html symbolic link.

/home/httpd/vhosts/website/httpdocs/phpinfo.php can be accessed by the browser

But not

/home/httpd/vhosts/website/httpdocs/admin.html

And it is a link
admin.html -> /home/httpd/vhosts/website/httpdocs/engine/admin.html
0
 
LVL 19

Expert Comment

by:ramazanyich
ID: 12350326
can user who owns apache process access /home/httpd/vhosts/website/httpdocs/engine/admin.html file ?
0
Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

 

Author Comment

by:stephaneeybert
ID: 12352883
Here is the setup in my apache config file:

User psaadm
Group psaadm

And here is the listing of files:

[root@wpc0797 httpdocs]# ll
total 24
drwxr-xr-x  3 thalasoft psacln 4096 Oct 14 16:06 account
drwxr-xr-x  3 thalasoft psacln 4096 Oct 14 13:54 ace
lrwxrwxrwx  1 apache    apache   59 Oct 14 14:43 admin.html -> /home/httpd/vhosts/website.com/httpdocs/engine/admin.html
-rwxr-xr-x  1 thalasoft psacln  709 Oct 14 16:06 createLink.php
drwxr-xr-x  8 thalasoft psacln 4096 Oct 18 16:13 engine
lrwxrwxrwx  1 apache    apache   58 Oct 14 14:46 index.php -> /home/httpd/vhosts/website.com/httpdocs/engine/index.php
drwxr-xr-x  2 thalasoft psacln 4096 Oct 14 14:57 ioncube
-rwxr-xr-x  1 thalasoft psacln   29 Oct 14 14:14 phpinfo.php

Why so many different users..?

0
 
LVL 19

Expert Comment

by:ramazanyich
ID: 12355080
link for file is admin.html points to file in another place. Could you also send a listing for /home/httpd/vhosts/website.com/httpdocs/engine directory ?
because permissions to file /home/httpd/vhosts/website.com/httpdocs/engine/admin.html a checked during access to /admin.html URL
0
 

Author Comment

by:stephaneeybert
ID: 12355495
Sure!

[root@wpc0797 httpdocs]# cd engine/
[root@wpc0797 engine]# ll
total 32
-rwxr-xr-x   1 thalasoft psacln  278 Oct 14 14:17 admin.html
drwxr-xr-x   3 thalasoft psacln 4096 Oct 14 14:18 api
-rwxr-xr-x   1 thalasoft psacln  228 Oct 14 14:17 index.php
drwxr-xr-x   4 thalasoft psacln 4096 Oct 14 14:18 js
drwxr-xr-x   2 thalasoft psacln 4096 Oct 18 16:28 lib
drwxr-xr-x  12 thalasoft psacln 4096 Oct 18 16:03 modules
drwxr-xr-x   2 thalasoft psacln 4096 Oct 14 16:12 setup
drwxr-xr-x  24 thalasoft psacln 4096 Oct 18 16:03 system
[root@wpc0797 engine]#

Cheers!

Stephane
0
 
LVL 19

Expert Comment

by:ramazanyich
ID: 12355541
try to add following directives:
<Location />
Options FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
</Location>
0
 

Author Comment

by:stephaneeybert
ID: 12355577
Are you sure of this closing slash..?

<Location />

I tried it in my .htaccess with and without the slash mentioned above.

It gives me a server config error.

0
 

Author Comment

by:stephaneeybert
ID: 12355591
Sorry, it's not a server config error I was given, but this:

Forbidden

You don't have permission to access /admin.html on this server.

Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.
0
 
LVL 19

Expert Comment

by:ramazanyich
ID: 12355605
Could you check your error log file ? some times there you can find more information.
Even if it is not an error in httpd.conf file, just try my solution. I suggested it because once it have solved similiar problem on my apache
0
 
LVL 19

Expert Comment

by:ramazanyich
ID: 12355615
instead <Location /> it should be <Location / > (extra whitespace after slash)
0
 

Author Comment

by:stephaneeybert
ID: 12355637
My Apache config file has now:

DirectoryIndex index.html index.php index.php3

AccessFileName .htaccess

<Location / >
Options FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
</Location>

<Files .htaccess>
    Order allow,deny
    Deny from all
</Files>

I restart Apache.

But I get the same message:

Forbidden

You don't have permission to access /admin.html on this server.

Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.
0
 

Author Comment

by:stephaneeybert
ID: 12355660
I checked these three logs

CustomLog "/usr/local/psa/admin/logs/ssl_log" ssl
CustomLog "/usr/local/psa/admin/logs/httpsd_access_log" common
ErrorLog "/usr/local/psa/admin/logs/httpsd_error_log"

but saw nothing related to denied access.

Any other log file I should check..?
0
 
LVL 19

Expert Comment

by:ramazanyich
ID: 12355665
Ok. remove <Location> element and try following:
<Directory "/usr/local/psa/admin/htdocs">
    Options FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>
<Directory "/home/httpd/vhosts/website.com/httpdocs/engine/">
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

excerpt from httpd doc:
FollowSymLinks
The server will follow symbolic links in this directory.
Even though the server follows the symlink it does not change the pathname used to match against <Directory> sections.

Note also, that this option gets ignored if set inside a <Location> section.

0
 

Author Comment

by:stephaneeybert
ID: 12355780
I did.

Restarted Apache.

Exactly the same message.
0
 
LVL 19

Expert Comment

by:ramazanyich
ID: 12355866
I suggest to check permissions to all directories in chain of "/home/httpd/vhosts/website.com/httpdocs/engine/
It can be that one of directories doesn't have permission to enter to it.
0
 

Author Comment

by:stephaneeybert
ID: 12356009
Will do!

Thanks
0
 

Author Comment

by:stephaneeybert
ID: 12356047
I checked the rights from /

Here are the last ones:

[root@wpc0797 thalasoft.net]# ll
drwxr-xr-x  6 thalasoft psaserv 4096 Oct 20 09:23 httpdocs

dr[root@wpc0797 httpdocs]# ll
wxr-xr-x  8 thalasoft psacln 4096 Oct 18 16:13 engine
lrwxrwxrwx  1 apache    apache   59 Oct 14 14:43 admin.html -> /home/httpd/vhosts/thalasoft.net/httpdocs/engine/admin.html

[root@wpc0797 engine]# ll
total 32
-rwxr-xr-x   1 thalasoft psacln  278 Oct 14 14:17 admin.html
0
 
LVL 19

Expert Comment

by:ramazanyich
ID: 12356059
I was asking to check
ll /home
ll /home/httpd
ll /home/httpd/vhosts
ll /home/httpd/vhosts/thalasoft.net
ll /home/httpd/vhosts/thalasoft.net/httpdocs
0
 

Author Comment

by:stephaneeybert
ID: 12356446
Yes, I had done it.

They all have x execute permissions.

Thanks
0
 
LVL 19

Expert Comment

by:ramazanyich
ID: 12356465
try to start Apache as root user. In httpd.conf set:
User root

And see if it solves a problem.
0
 

Author Comment

by:stephaneeybert
ID: 12356545
I did.

User root

Restarted Apapche.

Same message:

Forbidden

You don't have permission to access /admin.html on this server.

Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.
0
 
LVL 19

Accepted Solution

by:
ramazanyich earned 50 total points
ID: 12356907
Could you send your httpd.conf ?
0
 

Author Comment

by:stephaneeybert
ID: 12356986
Know what?

It is the suffix .html that poses problem.

This link does not work

lrwxrwxrwx  1 root      root     17 Oct 20 13:44 admin.html -> engine/admin.html

This link does not work

lrwxrwxrwx  1 root      root     58 Oct 20 13:18 admin.php -> /home/httpd/vhosts/thalasoft.net/httpdocs/engine/admin.php

But if I do

cp engine/admin.html engine/admin.php

Then this link works fine

lrwxrwxrwx  1 apache    apache   58 Oct 14 14:46 index.php -> /home/httpd/vhosts/thalasoft.net/httpdocs/engine/index.php

Thanks
0
 

Author Comment

by:stephaneeybert
ID: 12368335
I found the solution to my problem. It was that the file owner was not the one supposed to be.

Now it works fine.

Thanks for your support!

By the way, would you know the Apache directive to hide the full url and only display http://www.mywebsite.com ..?

Regards

Stephane
0

Featured Post

Get Actionable Data from Your Monitoring Solution

Your communication platform is only as good as the relevance of the information you send. Ensure your alerts get to the right people every time with actionable responses. Create escalation rules that ensure everyone follows the process and nothing is left to chance.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my time as an SEO for the last 2 years and in the questions I have assisted with on here I have always seen the need to redirect from non-www urls to their www versions. For instance redirecting http://domain.com (http://domain.com) to http…
If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question