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

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
stephaneeybertAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
ramazanyichConnect With a Mentor Commented:
Could you send your httpd.conf ?
0
 
ramazanyichCommented:
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
 
stephaneeybertAuthor Commented:
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
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
ramazanyichCommented:
can user who owns apache process access /home/httpd/vhosts/website/httpdocs/engine/admin.html file ?
0
 
stephaneeybertAuthor Commented:
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
 
ramazanyichCommented:
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
 
stephaneeybertAuthor Commented:
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
 
ramazanyichCommented:
try to add following directives:
<Location />
Options FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
</Location>
0
 
stephaneeybertAuthor Commented:
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
 
stephaneeybertAuthor Commented:
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
 
ramazanyichCommented:
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
 
ramazanyichCommented:
instead <Location /> it should be <Location / > (extra whitespace after slash)
0
 
stephaneeybertAuthor Commented:
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
 
stephaneeybertAuthor Commented:
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
 
ramazanyichCommented:
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
 
stephaneeybertAuthor Commented:
I did.

Restarted Apache.

Exactly the same message.
0
 
ramazanyichCommented:
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
 
stephaneeybertAuthor Commented:
Will do!

Thanks
0
 
stephaneeybertAuthor Commented:
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
 
ramazanyichCommented:
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
 
stephaneeybertAuthor Commented:
Yes, I had done it.

They all have x execute permissions.

Thanks
0
 
ramazanyichCommented:
try to start Apache as root user. In httpd.conf set:
User root

And see if it solves a problem.
0
 
stephaneeybertAuthor Commented:
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
 
stephaneeybertAuthor Commented:
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
 
stephaneeybertAuthor Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.