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 9194569
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T21:26:43+00:00 2026-06-17T21:26:43+00:00

I am getting this error in my apache error log file when I try

  • 0

I am getting this error in my apache error log file when I try to run my web.py application using mod_wsgi. I have installed web.py successfully on my shared hosting and I can confirm that I am able to import it locally:

>>> import web
>>> web.application(('/', 'test'), globals())
<web.application.application instance at 0x1f8d3b0>

I am also able to run the built in server and serve pages to my site successfully.

I can confirm that the mod_wsgi module is working in apache as well since I am able to serve pages using manual coding of a wsgi app.

I tried the suggested method for the ImportError: No module named web error message on the web.py documentation http://webpy.org/install#apachemodwsgi , i.e., adding:

abspath = os.path.dirname(__file__)
sys.path.append(abspath)
os.chdir(abspath)

import web

I also added the Files tag suggested in the http.conf file which seems redundant since I have the htdocs dir set up already, but anyway. My httpd.conf file is below, I have restarted apache and am still getting the import error message.

ServerRoot "/home/usr1/webapps/test/apache2"

LoadModule dir_module        modules/mod_dir.so
LoadModule env_module        modules/mod_env.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module       modules/mod_mime.so
LoadModule rewrite_module    modules/mod_rewrite.so
LoadModule setenvif_module   modules/mod_setenvif.so
LoadModule wsgi_module       modules/mod_wsgi.so

LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
CustomLog /home/usr1/webapps/test/logs combined
DirectoryIndex index.py
DocumentRoot /home/usr1/webapps/test/htdocs
ErrorLog /home/usr1/webapps/test/apache2/logs/error_test.log
KeepAlive Off
Listen 21708
MaxSpareThreads 3
MinSpareThreads 1
ServerLimit 1
SetEnvIf X-Forwarded-SSL on HTTPS=1
ThreadsPerChild 5
WSGIDaemonProcess test processes=5 python-path=/home/usr1/webapps/test/lib/python3.1 threads=1
WSGIProcessGroup test
WSGIRestrictEmbedded On
WSGILazyInitialization On

<Directory /home/usr1/webapps/test/htdocs>
    AddHandler wsgi-script .py
</Directory>

<Files /home/usr1/webapps/test/htdocs/index.py>
   SetHandler wsgi-script
   Options ExecCgi FollowSymLinks
</Files>
  • 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-17T21:26:44+00:00Added an answer on June 17, 2026 at 9:26 pm

    First of all, your apache mod_wsgi seems to be compiled with python 3, that is not supported by web.py.

    Your apache conf seems a lot like the one I have on Webfaction, if there is an installer for mod_wsgi with python 2.7, you have to choose it instead of python 3.

    This is what my typical conf looks like:

    ServerRoot "/home/username/webapps/projectname/apache2"
    
    LoadModule log_config_module modules/mod_log_config.so
    LoadModule mime_module       modules/mod_mime.so
    LoadModule rewrite_module    modules/mod_rewrite.so
    LoadModule alias_module modules/mod_alias.so
    LoadModule wsgi_module       modules/mod_wsgi.so
    
    LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    CustomLog /home/username/logs/user/access_projectname.log combined
    ErrorLog /home/username/logs/user/error_projectname.log
    KeepAlive Off
    Listen 21708
    MaxSpareThreads 3
    MinSpareThreads 1
    ServerLimit 1
    WSGIPythonOptimize 2
    ThreadsPerChild 5
    WSGIDaemonProcess projectname processes=5 threads=1
    WSGIPythonHome /home/username/lib/python2.7 # your python home dir where libraries are installed
    WSGIProcessGroup projectname
    WSGIRestrictEmbedded On
    WSGILazyInitialization On
    WSGIScriptAlias / /home/username/webapps/projectname/htdocs/code.py/
    Alias /static /home/username/webapps/projectname/htdocs/static
    

    And this is example code.py

    #!/usr/bin/env python
    import os
    import sys
    sys.path.append(os.path.abspath(os.path.dirname(__file__)))
    from app import app
    
    if __name__ == "__main__":
        app.run()
    else:
        application = app.wsgifunc()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm getting this error message in my log file WARN hbase.HBaseConfiguration: instantiating HBaseConfiguration() is
I am getting this error when I try to start Apache in Ubuntu. (98)Address
I'm getting following error in log file while indexing data to solr.This error appears
I keep getting this error in Apache's error log: [client 127.0.0.1] Client sent malformed
I want to maintain two Log Files in my web-application using apache Log4j.jar: 1)
i want to import org.apache.commons.io but i'm getting this error: [info] Compiling 1 Java
Getting this error when try to add an item to my repositories/context: Collection has
I keep getting this error and have no idea why. I googled and scanned
I am using Apache Velocity template engine for my web application html email utility.
This error has been driving me nuts. We have a server running Apache and

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.