Using apache web hosting I launched my first web app today and I noticed that if I put examply.com/example.py in my web browser I can see my python source code with my sql password in it.
How do I prevent this?
Using apache web hosting I launched my first web app today and I noticed that if I put examply.com/example.py in my web browser I can see my python source code with my sql password in it.
How do I prevent this?
2
Answers
Just change the file permission
You might want to take a look here – http://fideloper.com/user-group-permissions-chmod-apache
Hope this helps
Chown your python file with 640 will give a FORBIDDEN in the browser but the server will be able to execute it in PHP for example:
$output = shell_exec(“python python-test.py”);
echo ($output);