Solved

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

Posted on 2004-10-16
12
145,526 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
  • 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
 
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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 

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

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
500 Internal Server Error When I Run Code Igniter 4 60
Changing Sitemap Frequency on XML File 3 66
apache and php 3 99
Domino Website - Redirection 12 52
If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

911 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now