Reputation: 657
I followed this tutorial. Here is my server:
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello World!'
if __name__ == '__main__':
app.run()
When running
python server.py
curl 127.0.0.1:5000
I get the expected result.
Now I add a test.wsgi:
import sys
sys.path.insert(0, '/var/www/test')
from server import app as application
and in /etc/apache2/sites-enabled/test.config:
<VirtualHost *:5000>
ServerName example.com
WSGIDaemonProcess test user=user1 group=user1 threads=5
WSGIScriptAlias / /var/www/test/test.wsgi
<Directory /var/www/test>
WSGIProcessGroup test
WSGIApplicationGroup %{GLOBAL}
Order deny,allow
Allow from all
</Directory>
</VirtualHost>
Now calling
sudo service apache2 restart
curl 127.0.0.1:5000
will return an error. What did I do wrong?
Upvotes: 1
Views: 1238
Reputation: 657
As Daniel Roseman pointed out, I needed to
Listen 5000
to my /etc/apache2/apache.conf
to make the server listen on port 5000Upvotes: 1