skip to Main Content

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


  1. Just change the file permission

    You might want to take a look here – http://fideloper.com/user-group-permissions-chmod-apache

    Hope this helps

    Login or Signup to reply.
  2. 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);

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search