Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8943185
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:42:44+00:00 2026-06-15T11:42:44+00:00

I am trying to get a CherryPy app running under apache2/mod_wsgi on ubuntu. I

  • 0

I am trying to get a CherryPy app running under apache2/mod_wsgi on ubuntu. I am following the tutorial outlined here, and my config is almost identical. When visiting the root of the site, I receive a 500 Internal Server Error. The only error in the log is:

[Mon Dec 03 04:43:06 2012] [error] [client 64.189.251.239] Premature end of script headers: index.py

I have tried several variations to the tutorial, but I am not receiving any significant errors. Any ideas?

My Apache VirtualHost:

...
    WSGIScriptAlias / /var/www/example.com/uba/index.py
DocumentRoot /var/www/example.com/uba/
<Directory />
    Options +ExecCGI Indexes FollowSymLinks
    AllowOverride All
</Directory>

<Directory /var/www/example.com/uba/>
    Options +ExecCGI -Indexes -FollowSymLinks -MultiViews
    WSGIApplicationGroup %{GLOBAL}
    AllowOverride All
    Order allow,deny
    allow from all
</Directory>
...

My index.py script:

#!/usr/bin/python

import sys
sys.stdout = sys.stderr

import atexit
import threading
import cherrypy

cherrypy.config.update({'environment': 'embedded'})

if cherrypy.__version__.startswith('3.0') and cherrypy.engine.state == 0:
    cherrypy.engine.start(blocking=False)
    atexit.register(cherrypy.engine.stop)

class Root(object):
    def index(self):
        return 'Hello World!'
    index.exposed = True

application = cherrypy.Application(Root(), script_name=None, config=None)

UPDATE #1:

Running this very basic wsgi application produces the exact same error:

#!/usr/bin/python

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]
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T11:42:45+00:00Added an answer on June 15, 2026 at 11:42 am

    I suggest you test your apache configuration by replacing your cherrypy index.py script with a super simple wsgi app.

    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]
    

    Make sure that works before trying to use a cherrypy script.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying get my head around how you can run the following php:
I'm trying get values from a GridView using the following code: foreach (GridViewRow row
in my app i am trying to get an xml file from an URL.
I am trying get the following to valid to dd-MMM-yyyy. The calendar extender passes
I am trying get currently focused component id. For this I used following jQuery:
Trying to get MVC running on Mono 2.4 (which is possible, according to some
I'm trying to get this function working in Google App Engine using Python: def
I am trying get the Regex right for the following scenario but have some
So i am trying get 2 div-containers which both should contain centered text (Both
I'm trying get the visible portion of UIImage from an UIImageView . UIImageView takes

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.