skip to Main Content

System:

  • Windows 10 x64 (enterprise computer with some restrictions)
  • Apache 2.4 64-bit
  • Python 3.7.1 64-bit
  • mod_wsgi (built today from github using python setup.py install)

I am working on getting an Apache server with Python on a Windows machine and I have the server configured correctly in order to get the Hello World! example from mod_wsig documentation working.

If I simply launch C:Apache24binhttpd.exe, this works and I see Hello World at http://localhost:5000/

Then I wanted to get it running as a service, so I call

httpd.exe -k install

In the ApacheMonitor I start the new Apache2.4 service but I get a failed to start error. In the Windows system event log it says Event ID: 7024 with a service specific error: Incorrect function.

When I run httpd.exe -k start -n "Apache2.4" -t it says Syntax OK

What I can’t find is any more information about the service error. Nothing populates in the error.log file and I don’t know where else to look, and I am asking for any further information on how to diagnose this.

Before I started configuring Apache to use mod_wsgi, launching the service was successful, so this happened after doing that, and I haven’t configured anything else at this point.

3

Answers


  1. Go to the Command Prompt move to the apache/bin folder and type

    >httpd -t
    

    This will give you more information about the error preventing Apache from start.

    Login or Signup to reply.
  2. I was getting this error after updating my httpd.conf file. The problem was that my final xml tag in httpd.conf was unclosed </directory without the closing >.

    Login or Signup to reply.
  3. This days I was facing the same situation, windows 10, apache24, django app, python3.8, failing to start as service, service events showing error 7024…

    So, after a lot of struggling and research, I would like to add my solution even this is an old question.

    The solution was to add two environment variables, no in httpd.conf, not in python code/conf but at SO level (windows > environment variables)

    PYTHONHOME = c:yourpathtoinstalledpython

    PYTHONPATH = c:yourpathtoinstalledvirtualenv

    And magic! apache now works as service and the django app is always available on localhost

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search