Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SachinMaharana/f883d6ee7bca0a273592895177619e33 to your computer and use it in GitHub Desktop.
Save SachinMaharana/f883d6ee7bca0a273592895177619e33 to your computer and use it in GitHub Desktop.
waitercaller.py:
from flask import Flask
app = Flask(__name__)
@app.route("/")
def home():
return "Under Construction"
if __name__ == '__main__':
app.run(port=5000, debug=True)
waitercaller.wsgi:
import sys
sys.path.insert(0, "/var/www/waitercaller")
from waitercaller import app as application
Directory Structure:
.
├── conf.py
├── README.md
├── templates
│   └── home.html
├── waitercaller.py
└── waitercaller.wsgi
/etc/apache2/sites-avaliable/waitercaller.conf
<VirtualHost *>
WSGIScriptAlias / /var/www/waitercaller/waitercaller.wsgi
WSGIDaemonProcess waitercaller
<Directory /var/www/waitercaller>
WSGIProcessGroup waitercaller
WSGIApplicationGroup %{GLOBAL}
Order deny,allow
Allow from all
</Directory>
</VirtualHost>
error log:
[remote 192.168.1.8:0] mod_wsgi (pid=12092): Target WSGI script '/var/www/waitercaller/waitercaller.wsgi' cannot be loaded as Python module.
[Sun Jul 31 08:20:47.333172 2016] [wsgi:error] [pid 12092:tid 1965130800] [remote 192.168.1.8:0] mod_wsgi (pid=12092): Exception occurred processing WSGI script '/var/www/waitercaller/waitercaller.wsgi'.
[Sun Jul 31 08:20:47.333247 2016] [wsgi:error] [pid 12092:tid 1965130800] [remote 192.168.1.8:0] Traceback (most recent call last):
[Sun Jul 31 08:20:47.333322 2016] [wsgi:error] [pid 12092:tid 1965130800] [remote 192.168.1.8:0] File "/var/www/waitercaller/waitercaller.wsgi", line 3, in <module>
[Sun Jul 31 08:20:47.333502 2016] [wsgi:error] [pid 12092:tid 1965130800] [remote 192.168.1.8:0] from waitercaller import app as application
[Sun Jul 31 08:20:47.333543 2016] [wsgi:error] [pid 12092:tid 1965130800] [remote 192.168.1.8:0] File "/var/www/waitercaller/waitercaller.py", line 2, in <module>
[Sun Jul 31 08:20:47.333667 2016] [wsgi:error] [pid 12092:tid 1965130800] [remote 192.168.1.8:0] from flask import Flask
[Sun Jul 31 08:20:47.333735 2016] [wsgi:error] [pid 12092:tid 1965130800] [remote 192.168.1.8:0] ImportError: No module named flask
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment