[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 732
  • Last Modified:

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.
  • 3
  • 2
2 Solutions

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.
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
newbieexpertAuthor Commented:
I have not found suEXEC on my system yet. and  /usr/local/apache/sbin/suexec doesn't exist...
Transaction-level recovery for Oracle database

Veeam Explore for Oracle delivers low RTOs and RPOs with agentless transaction log backup and transaction-level recovery of Oracle databases. You can restore the database to a precise point in time, even to a specific transaction.

What version of apache are you using?
What are the permissions on the file?
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?
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.


Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now