'Apache 1.3.37 server returnes 403 Access Denied when post request

update 2022-05-14

i found that server shows 403 when post request, not get request. get reqeust works well, not post.


hi i got problem with the apache server

that server started response 403 Access Denied in unexpectedly when users access some files. that files was working well before it. and other files in same directory can access well.

detailed error message is " You don't have permission to access "{FILE_PATH}/cart_write_exec.php" on this server."

i try to fix it with bunch of stackoverflow pages:

Directory Indexes: Error message "Forbidden You don't have permission to access / on this server"

cart_write_exec.php is specific php file. not directory. so i think it is useless

deny,allow directives: Error message "Forbidden You don't have permission to access / on this server"

that server's httpd.conf is already seted. and i didn't any modify to that file since 2012.

<Directory /home/*>
    AllowOverride All
    Options +ExecCGI
    Order allow,deny
    Allow from all
</Directory>

Require directive (Apache 2.4): Error message "Forbidden You don't have permission to access / on this server"

that server's apache version is 1.3.37

Files permissions: Error message "Forbidden You don't have permission to access / on this server"

cart_write_exec.php is already 777 and directory contained that file is 777 too.

drwxrwxrwx  4 image***   502   4096  5▒▒ 11 21:32 .
drwxr-xr-x 33 image***   502   4096  4▒▒ 24 18:33 ..
drwxrwxrwx  2 image*** users   4096  4▒▒  7 21:43 bak
-rwxrwxrwx  1 image*** users   3667  5▒▒ 11 21:18 cart_write_exec.php
drwxrwxrwx  3 image***   502   4096  4▒▒ 18  2012 img
-rwxrwxrwx  1 image*** users  20682  1▒▒ 24  2011 login_oo.html
-rwxrwxrwx  1 image*** users  20682  1▒▒ 24  2011 login_oo.php
-rwxrwxrwx  1 image***   502  20758  9▒▒ 29  2011 oo.html
-rwxrwxrwx  1 image*** users  10485  9▒▒ 28  2011 oo_list.html
-rwxrwxrwx  1 image*** users 100240  5▒▒ 11 21:32 pu.html
-rwxrwxrwx  1 image*** users  23934  4▒▒  7 21:37 pu.js
-rwxrwxrwx  1 image*** users  44927  4▒▒  7 22:44 pu_h.20220407.html
-rwxrwxrwx  1 image*** users  13741  4▒▒  7 22:45 pu_h.20220407.js
-rwxrwxrwx  1 image*** users  44440  4▒▒  7 22:44 pu_h.html
-rwxrwxrwx  1 image*** users   5593  4▒▒  7 22:45 pu_h.js
-rwxrwxrwx  1 image*** users   8949  4▒▒ 19  2012 web.html
-rwxrwxrwx  1 image*** users  45834  2▒▒ 17  2012 web4444.html
-rwxrwxrwx  1 image***   502   9936  7▒▒  3  2008 web4444444444.html

SELinux security context: https://www.happyjung.com/lecture/2481

i think selinux security context is not installed on my server.

cuz ls -alZ is shows nothing like below.

drwxrwxrwx  image*** users                                  bak
-rwxrwxrwx  image*** users                                  cart_write_exec.php
drwxrwxrwx  image***   502                                  img
-rwxrwxrwx  image*** users                                  login_oo.html
-rwxrwxrwx  image*** users                                  login_oo.php
-rwxrwxrwx  image***   502                                  oo.html
-rwxrwxrwx  image*** users                                  oo_list.html
-rwxrwxrwx  image*** users                                  pu.html
-rwxrwxrwx  image*** users                                  pu.js
-rwxrwxrwx  image*** users                                  pu_h.20220407.html
-rwxrwxrwx  image*** users                                  pu_h.20220407.js
-rwxrwxrwx  image*** users                                  pu_h.html
-rwxrwxrwx  image*** users                                  pu_h.js
-rwxrwxrwx  image*** users                                  web.html
-rwxrwxrwx  image*** users                                  web4444.html
-rwxrwxrwx  image***   502                                  web4444444444.html

but i try do the chcon --type=httpd_sys_content_t cart_write_exec.php. it returns error: chcon: can't apply partial context to unlabeled file cart_write_exec.php

that server's apache version is 1.3.37, php version is 4.4.7, centos version is centos-release-5-1.0.el5.centos.1... whatever..



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source