LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-11-2004, 09:07 AM   #1
tonyboy
LQ Newbie
 
Registered: Mar 2004
Location: Vincennes, IN
Posts: 8

Rep: Reputation: 0
403 Forbidden on Virtual Servers with PHP scripts


I am fairly new to this PHP scripting. I am running apache-1.3.23-11
and installed php-4.1.2-7. I created a virtual host/website that has php scripts and for soem reason I am getting the 403 Forbidden error. Im sure this is simply permissions issue, I just dont have any clue where to start.

Any help would be appreciated. Thanks
 
Old 03-11-2004, 09:27 AM   #2
jharris
Senior Member
 
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243

Rep: Reputation: 46
The first things I would check are the permissions on the files and directories. You probably want to chmod files to 644 and directories to 755.

At what point do you get this? Is it when you attempt to access a specific file, or when you go to a directory (including the server root)? If it's on a specific file then it's probably file permissions (as above). If it's when you are accessing a directory it could be because there is no index.html file, and your Apache is not configured to allow directory listings.

You can always post the relevant section of you httpd.conf

HTH and welcome to LinuxQuestions

Jamie....
 
Old 03-11-2004, 09:51 AM   #3
tonyboy
LQ Newbie
 
Registered: Mar 2004
Location: Vincennes, IN
Posts: 8

Original Poster
Rep: Reputation: 0
[jamie]
actually as soon as i point my browser to the url
i immediately get the 403 forbidden error.

it seems like permissions to run any php or cgi scripts coz i tried to replace the content of the document root with plain static html and it opens up the website. but html with scripts and php scripts will not open.
this is my directory sructure

/var/www/sample-virtual-host/index.php

thanks.
 
Old 03-11-2004, 11:43 AM   #4
jharris
Senior Member
 
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243

Rep: Reputation: 46
What URL are you using? If you are using http://someServer/ and the document root doesn't contain an Index page (as specified on the DirectoryIndex line of you httpd.conf) then that's the error you get. This would me that index.html would work, but index.php wouldn't. Does http://someServer/index.php work?

Check what your DirectoryIndex is set to. Try including index.php on that line if it's not there, and then restart Apache. Have you got php and cgi working elsewhere, or is this a problem with the entire server, not just this vhost? To get CGI scripts to work you'll either need to enable the CGI handler globally, or setup a cgi-bin ScriptAlias.

cheers

Jamie...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache2 virtual host cgi 403 Forbidden / mossy Linux - Software 15 07-27-2005 05:56 PM
403 Forbidden patpawlowski Linux - Newbie 1 04-26-2005 10:20 AM
Access Forbidden 403 for PHP info page. Kitara Linux - Software 5 05-24-2004 04:41 AM
403 Forbidden access to web with php and cgi scripts tonyboy Linux - Software 3 03-17-2004 08:45 AM
403 Forbidden??? morbo Linux - Networking 11 07-04-2002 11:17 AM


All times are GMT -5. The time now is 08:58 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration