0

GOAL : I am trying to deploy my Flask app to make it public on the web. I have my own server which runs on Ubuntu 18.04

TUTORIAL : As it is the first time I am doing this, I am following this tutorial. All his steps are perfectly working for me except the last one. However, in this tutorial he used Linode and I use my own server so I directly code on my terminal

PROBLEM : In his last step after systemctl reload apache2 when I go on the my browser and type my ip address (found using ifconfig) that I put in webApp.conf (192.168.1.25) I get the following error : enter image description here

ERROR LOGS : As asked I went into the error.log which outputs the following : enter image description here You can find the code here : https://pastebin.com/g2rzRUXE

POTENTIAL PROBLEMS: From what I understand I am having two issues :

  1. Set the 'ServerName' directive globally to suppress this message . So I tried to solve it using this tutorial and I changed my private ip address to my public ip address (found on whatismyip.com) but when doing so I received the following error: error

    1. It does not seem to like my prints: error2 . Am I not allowed to keep prints

Please let me know how I could solve these problems or the other ones in the error log that I might not have seen.

I hope I was clear enough. If you need any additional info I can edit my question. I am running out of ideas so if you have any tips I would be grateful.

10
  • Refer stackoverflow.com/questions/6454564/… Commented Jun 14, 2020 at 13:55
  • You are deploying a Python 3 application on a Python 2.7 virtualenv. Commented Jun 14, 2020 at 13:56
  • python 3 @LaurentLAPORTE Commented Jun 14, 2020 at 13:58
  • @Pandurang I am using flask not django Commented Jun 14, 2020 at 13:58
  • @Reda, please, print the values of sys.version in your running application => in the logs, to be sure. You can add this in your webapp.wsgi. Commented Jun 14, 2020 at 14:01

1 Answer 1

1

In the logs, I can read:

Apache/2.4.29 (Ubuntu) mod_wsgi/4.5.17 Python/2.7 configured -- resuming normal operations

So, you are using Python 2 instead of Python 3.

You need to install a mod_wsgi module compatible with Python 3.

Follow the instruction available here : https://modwsgi.readthedocs.io/en/develop/user-guides/quick-installation-guide.html

The following link can also help: https://stackoverrun.com/fr/q/12335951 (in French).

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you very much for your time. It is working now.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.