How do I secure my tornado python file?

pyRabbit

With security in mind, what is the best practice for storing my main.py on a web server? For example, is it safe to place my main.py in /var/www/mysite.com/public_html or should I place it in /var/www/mysite.com.

I am a first time subscriber to a virtual private server and I am running Nginx as a reverse proxy to a Tornado web server. If you are not familiar with Tornado, main.py is the python file that starts my Tornado web application.

Below is an example of how I plan on organizing my files.

  • /var
    • /www
      • /mysite.com
        • main.py (Is it safer here?)
        • /public_html
          • index.html
          • main.py (Or is it fine here?)
      • /mysecondsite.com
        • /public_html
          • index.html
      • /mythirdsite.com
        • /public_html
          • index.html
Ben Darnell

It's always better to keep things out of public_html unless you specifically need them there. I would recommend setting up a separate directory next to public_html for the application code:

/var/www/mysite.com/app/main.py
/var/www/mysite.com/public_html/*

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How do I secure my firestore for anonymous access of product data

How do I secure traffic between my VM and Application Gateway?

How do i secure my Google Maps API?

SendGrid incoming mail webhook - how do I secure my endpoint

How do I make my python program to write a new file

How do I record my Output from a Python file?

How do I loop and append my code to a CSV file? - Python

How do I generate a cryptographically secure alphanumeric string in Python?

How do I change my authentication from LDAP to JDBC to secure my applications

How do I secure my internet line from being spied on by my landlord?

How do I run my python file within another python file?

How do I stop Tornado web server?

How do i run my python file from any directory on my computer [Arch]

How do i copy a python file from my windows to Linux subsystem after connect ssh to my server?

I wrote a project with tornado, but this exception is always in my log file

Python Tornado: how can I make this asynchronous ?

How do I get my volley GET request to return info from a non secure protocol?

How do I secure access to a AWS classic EC2 machine from my LAN

How do I secure my web service apart from checking session variable for NULL?

How do I resolve an non-secure connection on Heroku, despite my SSL certificate being valid?

How do I tell if my UEFI bios System is running Secure Boot?

How do I make sure that links posted by the users of my website are safe and secure?

How do I secure my React Native Expo app from hackers?

Flutter - How do I secure a video so it can only play in my App?

I am a python newbie, I want to import values and parameters from a text file and pass it into my function. How do I do it?

How to set 'secure' and 'httponly' cookie in Tornado?

How to use secure websocket (wss) in Tornado

How do I access my string in my locales file?

How do I access my config variable in my helper file?