Apache /var/www/html php pages setup

Hello all !!

I have several php pages arranged in folders and subfolders. I am using apache, php for the first time. I just did a test on apache and see a page called phpinfo.php properly. It is on /var/www/html.  however when i place my php pages directory in /var/www/html  and access a page in it,  it gives a forbidden error. i.e when i access /var/www/html/myapp/1/test.html   it gives a Forbidder error. i then placed test.html in /app folder directly instead of /app/1 and tested. same error. btw the second line says "you don't have permission to access /app/test.html on this server". i don't think it is permissions problem. Permissions are all set to 755. If you have any ideas on how to get this working, please let me know.
newbieexpertAsked:
Who is Participating?
 
firekoolCommented:
newbieexpert,

What Version of PHP are you using?
What are the permission of the directory that it is in?
Do you have suEXEC enabled?

Try changing permission to 644 see what happens.

to do this type in chmod 644 filenamehere.
0
 
newbieexpertAuthor Commented:
Hi, the php version is 5.1.2. I changed the directory permissions from 755 to 644 using chmod app. No luck. to restate, /var/www/html/test.htm works fine but /var/www/html/app/test.html won't work and displays forbidden and 403 error on http://localhost/app/test.htm page.  

I am not sure if suexec is enabled here. I searched a lot for suexec but didn't find much info about it on fedora+apache. Thank you
0
 
newbieexpertAuthor Commented:
Firekool:
I have not found suEXEC on my system yet. and  /usr/local/apache/sbin/suexec doesn't exist...
Thanks
0
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.

 
firekoolCommented:
What version of apache are you using?
What are the permissions on the file?
0
 
Jan SpringerCommented:
A couple of things:

Directories should be chmod 755 (in general)
Files should be chmod 644 (in general)

You don't need suexec to run php pages.

Do you have an .htaccess file denying you the ability to read the pages?
Do you have a configuration entry in httpd.conf for the app directory denying you access?

# cd /var/log/http
# grep test.htm error*

What do the errors specifically say?
0
 
newbieexpertAuthor Commented:
i changed the permissions of the files in app directory to 644. and 755 to app directory..

also ran this command found on the web ..

chcon  -R  -h  -t  httpd_sys_content_t    /var/www/html/bcd

i am not sure what resolved the 403 problem here...

thanks both! appreciate it.


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.