apache/wsgi

Discussion in 'PHP' started by XikarO, 3 Mar 2013.

  1. XikarO

    XikarO Member

    Joined:
    20 May 2009
    Messages:
    16
    Likes Received:
    24
    Reputations:
    18
    возникли проблемы при запуске wsgi под убунтой:
    что я делаю:
    создаю myapp.wsgi (/usr/local/www/wsgi-scripts/myapp.wsgi):
    Code:
     def application(environ, start_response):
        status = '200 OK'
        output = 'Hello World!'
     
        response_headers = [    ('Content-type', 'text/plain'),
                    ('Content-Length', str(len(output)))]
        start_response(status, response_headers)
     
        return [output]
    
    создаю конфиг(/etc/apache2/sites-available/example.com):
    Code:
    <VirtualHost *:8080>
     
        ServerName www.example.com
        ServerAlias example.com
        ServerAdmin webmaster@example.com
     
        DocumentRoot /usr/local/www/documents
     
        <Directory /usr/local/www/documents>
          Order allow,deny
          Allow from all
        </Directory>
     
        WSGIScriptAlias /myapp /usr/local/www/wsgi-scripts/myapp.wsgi
     
        <Directory /usr/local/www/wsgi-scripts>
          Order allow,deny
          Allow from all
        </Directory>
     
    </VirtualHost>
    
    перезагружаем апач, заходим через браузер и ничего.
    Подскажите, что делаю не так?
     
Loading...