Apache 404 index.php not Found but index.php exists at document root
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Apache 404 index.php not Found but index.php exists at document root
hello all,
i m facing a problem with the apache server and PHP.
The server is running CentOS 5.2 with preconfigured Apache and PHP (5.1.6).
The document root is /home/www
The problem is I can run some files while other files (the ones I create) gives 404 error.
For example there was a file at /home/www/phpinfo.php and it runs well.
However i made a file at /home/www/test.php but when the invoke it from the browser it gives me "Not Found The requested URL /test.php was not found on this server."
I tried with other file without result. Seems like only the files that existed on the system before runs well, if I create new files they cant be found.
I have no idea what could cause this error. I really need some assistance on this matter. Thank you.
You could also try accessing those files after temporarily turning selinux off. Type "setenforce 0" as root from a terminal (setenforce 1 to turn it back on)
Last edited by billymayday; 07-26-2008 at 04:28 AM.
You could also try accessing those files after temporarily turning selinux off. Type "setenforce 0" as root from a terminal (setenforce 1 to turn it back on)
Ok, i m trying and posting the result.
Thanks for the amazingly fast response.
Yes, i put Z there, i m copying directly from putty.
Here it is,
cat /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
SELINUX=disabled
# SELINUXTYPE= type of policy in use. Possible values are:
# targeted - Only targeted network daemons are protected.
# strict - Full SELinux protection.
SELINUXTYPE=targeted
# SETLOCALDEFS= Check local definition changes
SETLOCALDEFS=0
Now i have put the test.php at /home/www/my_ip_address/test.php and its working.
Shouldnt it work from /home/www/test.php as my DOCUMENT_ROOT is set to /home/www/ ?
Why is it looking inside /home/www/my_ip_address/ ?
How can i reconfigure the doc root to /home/www/ ?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.