LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Prevent others from reading php source? (https://www.linuxquestions.org/questions/linux-networking-3/prevent-others-from-reading-php-source-131441/)

Mikessu 01-04-2004 12:17 PM

Prevent others from reading php source?
 
I have server-computer where are more than just one user. I'd like to use it for PHP and Postgresql development. Now I have following problem: I have php-files in my public_html directory and I'd like to prevent other users from seeing php-sources, because they can see database passwords from those files. If I deny access (chmod to 700) to public_html directory, then nobody will be able to read my pages from internet. How can I make it only deny computer-users to see php-sources and prevent them from entering my public_html-directory? I have set ftp chroot to home directory, but they can still see those files by using ssh.

g-rod 01-04-2004 01:01 PM

Put all of the password in one php file and have the other php files include that file. Change the owner of the file to apache and group apache. Then change that one files perms to 700.

w0000422 01-04-2004 06:51 PM

i never think of that kind of question, it's good for my future reference, thks!


All times are GMT -5. The time now is 08:36 AM.