Use of apache+mod in Windows environments

Source: Internet
Author: User

1, install Python and Apache.

2, install Mod_wsgi after get wsgi.so, and put wsgi.so in Apache modules folder.

3, install Webpy.

4. Open httpd.conf (under Apache's Conf folder)

At the end of the document, add:

LoadModule wsgi_module/modules/mod_wsgi.so

Wsgiscriptalias/webapp "d:/develop/webapp/index.py/" alias/webapp/static "d:/develop/webapp/static/" AddType text/ HTML. PY <directory "d:/develop/webapp/" >    allowoverride all    Options Indexes followsymlinks  execcgi    Order Allow,deny    SetHandler wsgi-script allow from    all</directory>

Visit Localhost/webapp to access d:/develop/webapp/index.py

index.py:

Import Web        urls = (    '/(. *) ', ' hello ') app = Web.application (URLs, Globals ()) class Hello:            def GET (self, name):        if not name:             name = ' World '        return ' Hello, ' + name + '! ' if __name__ = = "__main__":    App.run ()

If you do not have access, you can try to open the firewall:

Control Panel-"system security-" allows programs to run another program through Windows Firewall-"

Add Apache Bin folder Httpd.exe and put the two hooks on the back.

Use of apache+mod in Windows environments

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.