Solved

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

Posted on 2004-10-16
12
145,631 Views
Last Modified: 2011-08-18
Hi all experts.
I installed apache 2.0.52 and php4.3.9 on my fedora linux box.
I configured apache first and was able to open the defalt apache welcome page by accessing the server using IP address.
And then I created a php info page in the apache default directory to see if php works. php worked no problem.
The problem occurred when I added a domain to virtual hosting section.
Now I have only one domain to host, but I am going to host more so I created a web directory in user's home directory and
in http.conf file I added the virtual host settings like below

NameVirtualHost     ip of my server

<VirtaulHost ipaddress>
    ServerAdmin webmaster@domain.com
    DocumentRoot /home/user1/www
    ServerName domain.com
    ServerAlias www.domain.com
    DirectoryIndex index.html index.php
</VirtualHost>

I have tried to access a file in the user1's web directory by www.domain.com/file1.php. But still got the permission error.
I have set all directory and file permissions in the user1's directory 777 in order to test it. But no hope.
Please help me out with this problem.. Thanks advance.
0
Comment
Question by:soweyoung
[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
  • 3
  • 3
  • 2
  • +4
12 Comments
 
LVL 19

Expert Comment

by:ramazanyich
ID: 12330159
Did you check error log of your Apache server?
some times you can find useful info there.
Could you send what is in error.log ?
0
 

Author Comment

by:soweyoung
ID: 12330200
I found nothing special in the apache error log file.
I am not sure if the web server even tries to open a correct directory.

[Fri Oct 15 18:22:29 2004] [notice] Apache/2.0.52 (Unix) configured -- resuming normal operations
[Fri Oct 15 18:36:48 2004] [notice] caught SIGTERM, shutting down
[Fri Oct 15 18:36:57 2004] [notice] Apache/2.0.52 (Unix) PHP/4.3.9 configured -- resuming normal operations
[Sat Oct 16 10:14:43 2004] [notice] caught SIGTERM, shutting down
[Sat Oct 16 10:16:08 2004] [notice] Apache/2.0.52 (Unix) PHP/4.3.9 configured -- resuming normal operations
[Sat Oct 16 10:16:15 2004] [error] [client 68.145.84.236] (13)Permission denied: access to / denied
[Sat Oct 16 10:17:15 2004] [notice] caught SIGTERM, shutting down
[Sat Oct 16 10:17:19 2004] [notice] Apache/2.0.52 (Unix) PHP/4.3.9 configured -- resuming normal operations
[Sat Oct 16 10:18:32 2004] [error] [client 68.145.84.236] (13)Permission denied: access to / denied
[Sat Oct 16 10:18:33 2004] [error] [client 68.145.84.236] (13)Permission denied: access to / denied
[Sat Oct 16 10:18:41 2004] [error] [client 68.145.84.236] (13)Permission denied: access to /index.php denied
[Sat Oct 16 10:23:07 2004] [error] [client 68.145.84.236] (13)Permission denied: access to /main.html denied
[Sat Oct 16 10:23:13 2004] [error] [client 68.145.84.236] (13)Permission denied: access to /main.htm denied
[Sat Oct 16 10:29:04 2004] [error] [client 68.145.84.236] (13)Permission denied: access to /main.htm denied
[Sat Oct 16 10:29:05 2004] [error] [client 68.145.84.236] (13)Permission denied: access to /main.htm denied
[Sat Oct 16 10:29:10 2004] [error] [client 68.145.84.236] (13)Permission denied: access to /main.htm denied
[Sat Oct 16 10:32:24 2004] [error] [client 68.145.84.236] (13)Permission denied: access to /index.html denied
[Sat Oct 16 10:33:14 2004] [error] [client 68.145.84.236] (13)Permission denied: access to /index.html denied
[Sat Oct 16 10:33:19 2004] [error] [client 68.145.84.236] (13)Permission denied: access to /index.php denied
[Sat Oct 16 10:37:01 2004] [error] [client 68.145.84.236] (13)Permission denied: access to /index.php denied
[Sat Oct 16 10:37:09 2004] [error] [client 68.145.84.236] (13)Permission denied: access to /index.php denied
[Sat Oct 16 10:44:44 2004] [notice] caught SIGTERM, shutting down
[Sat Oct 16 10:44:47 2004] [notice] Apache/2.0.52 (Unix) PHP/4.3.9 configured -- resuming normal operations
[Sat Oct 16 10:44:57 2004] [error] [client 68.145.84.236] (13)Permission denied: access to / denied
[Sat Oct 16 10:56:58 2004] [notice] caught SIGTERM, shutting down
[Sat Oct 16 10:57:26 2004] [notice] Apache/2.0.52 (Unix) PHP/4.3.9 configured -- resuming normal operations
[Sat Oct 16 10:57:30 2004] [error] [client 68.145.84.236] (13)Permission denied: access to / denied
[Sat Oct 16 11:04:49 2004] [error] [client 68.145.84.236] (13)Permission denied: access to / denied
[Sat Oct 16 11:04:51 2004] [error] [client 68.145.84.236] (13)Permission denied: access to / denied
[Sat Oct 16 11:08:22 2004] [notice] caught SIGTERM, shutting down
[Sat Oct 16 11:08:24 2004] [notice] Apache/2.0.52 (Unix) PHP/4.3.9 configured -- resuming normal operations
[Sat Oct 16 11:27:35 2004] [notice] caught SIGTERM, shutting down
[Sat Oct 16 11:27:39 2004] [notice] Apache/2.0.52 (Unix) PHP/4.3.9 configured -- resuming normal operations
[Sat Oct 16 11:27:44 2004] [error] [client 68.145.84.236] (13)Permission denied: access to /index.php denied
[Sat Oct 16 14:30:01 2004] [error] [client 68.145.84.236] (13)Permission denied: access to / denied

 

0
 
LVL 19

Expert Comment

by:ramazanyich
ID: 12330279
Try to add follozing in under <VirtualHost> element:
<Location />
allow from all
</Location
0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
LVL 15

Expert Comment

by:periwinkle
ID: 12330303
Or perhaps:

<VirtualHost ipaddress>
    ServerAdmin webmaster@domain.com
    DocumentRoot /home/user1/www
    ServerName domain.com
    ServerAlias www.domain.com
    DirectoryIndex index.html index.php
    <Directory /home/user1/www>
      order allow,deny
      allow from all
     </Directory>
</VirtualHost>
0
 
LVL 15

Expert Comment

by:periwinkle
ID: 12330304
Is it only the PHP files that can't be used?
0
 

Author Comment

by:soweyoung
ID: 12331205
I added Directoy tag as you said, but still got the same error.
I now have a couple of simpe php and html files in the apache default web directory and user directory to test.
However I can't access any of the files using ip or domain, not even with files names after.
This is the error message I get in the browser.

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

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

--------------------------------------------------------------------------------

Apache/2.0.52 (Unix) PHP/4.3.9 Server at 216.240.152.97 Port 80

Any idea or clue about this?
0
 

Author Comment

by:soweyoung
ID: 12331310
If I comment out the virtual hosting portion from the httpd.conf and put all kinds of html and php files, every file works well.
But I have to host multiple sites later so I need to figure out how to exactly correct this problem.
0
 
LVL 19

Expert Comment

by:ramazanyich
ID: 12331532
As it is described in doc:
"If you are adding virtual hosts to an existing web server, you must also create a <VirtualHost> block for the existing host. The ServerName and DocumentRoot included in this virtual host should be the same as the global ServerName and DocumentRoot. List this virtual host first in the configuration file so that it will act as the default host."
example:

NameVirtualHost *:80
<VirtualHost *:80>
ServerName www.domain.tld
ServerAlias domain.tld *.domain.tld
DocumentRoot /www/domain
</VirtualHost>
<VirtualHost *:80>
ServerName www.otherdomain.tld
DocumentRoot /www/otherdomain
</VirtualHost>



check http://httpd.apache.org/docs-2.0/vhosts/name-based.html for details
0
 
LVL 51

Accepted Solution

by:
ahoffmann earned 125 total points
ID: 12331963
>  (13)Permission denied: access to /index.php denied

is a filesystem permission problem. Check owner and group of directory and file, and the permissions of them. The user of your httpd-process need read permissions to the file and execute permission to the directory
0
 

Expert Comment

by:davemiles871
ID: 12998275
Chances are this is not in fact the correct solution- I'm guessing but if its working for you, then you probably changed something else already. I have had the same problem, and just changing permissions does not in fact work. The actual cause of this is 'by design' if you have a default installation of FC3. SE-Linux which is installed as part of the default installation, stops access to aliased directories and the like, including virtual hosts. Bizare though it is, it also stops Apache from accessing some of its own directories (note the ErrorDocument error)

Whilst I don't have a complete workround, the simplest solution to get the system up and working is to go to System Settings->Security level and disable SE-Linux. This will prove one way or another what's what, and we can move on from there. If I get better fix, I'll post again.
0
 

Expert Comment

by:svinet
ID: 13225688
excellent answer
here is how to disable SELinux. vi /etc/sysconfig/selinux then disable it.
0
 
LVL 1

Expert Comment

by:kbensch
ID: 13450958
The problem you are expericneing is not a problem as such but ratrher a feature of FC3 called Security enhanced linux.

Try this

ls -Z /dir/where/www/root/will/be

chcon -R -h -t httpd_sys_content_t /dir/where/www/root/will/be

ls -Z /dir/where/www/root/will/be

It will prob be a good idea to turn selinux on again in the /etc/sysconfig/selinux conf file as it makes it so much more secure.

Hope this helps
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

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). #…
In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

726 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