[SOLVED] Apache2 disabling access do directories/files
Linux - SoftwareThis 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
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.
Hello,
I've got kind of "noobie" question for you, but I can't find answer any way. I have got Apache2 and PHP5 installed, and I need to restrict access to directories, for example, to /etc.
Apache2 DocumentRoot works good for mapping URLs, but I can't get rid of Php being able to include /etc/passwd and stuff like that using "../../../" trick. (I made a file which includes it).
I was wondering about chrooting Apache, but I think it may break configuration of server.
So my question: Is there a way to disable access for Php and some other scripts to some directories?
Thanks for your answer. No, (well, there are several instances to raise performance, but only one runs as root actually) but for example /etc/passwd has default "rwxr--r--" rights, and chmod-ing all these files would be really painful for me. Also, doing this recursively to all files should not work for me either, as far as I know not all files should have same rights.
Thanks much, exactly what I was looking for. (First I was little upset because safe_mod had to be on for files like /etc/passwd, and it didn't restrict access to all files. Also doc_root kindly didn't work for me...).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.