Solved

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

Posted on 2004-10-16
12
145,485 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
Comment Utility
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
Comment Utility
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
Comment Utility
Try to add follozing in under <VirtualHost> element:
<Location />
allow from all
</Location
0
 
LVL 15

Expert Comment

by:periwinkle
Comment Utility
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
Comment Utility
Is it only the PHP files that can't be used?
0
 

Author Comment

by:soweyoung
Comment Utility
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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 

Author Comment

by:soweyoung
Comment Utility
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
Comment Utility
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
Comment Utility
>  (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
Comment Utility
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
Comment Utility
excellent answer
here is how to disable SELinux. vi /etc/sysconfig/selinux then disable it.
0
 
LVL 1

Expert Comment

by:kbensch
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction As you’re probably aware the HTTP protocol offers basic / weak authentication, which in combination with the relevant configuration on your web server, provides the ability to password protect all or part of your host.  If you were not…
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…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

772 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

10 Experts available now in Live!

Get 1:1 Help Now