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

  • SEARCH
  • Home
  • 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 8002999
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:32:09+00:00 2026-06-04T16:32:09+00:00

Is it possible to change the wsgi script used by an apache configuration based

  • 0

Is it possible to change the wsgi script used by an apache configuration based on the hostname of the request? I’d like to set up a system where various wsgi applications can be deployed and then run by simply using a subdomain to automatically map to the correct wsgi script. I’m mostly trying to avoid having to change the conf file every time another application is deployed.

<VirtualHost *:80>
    ServerName mysite.us
    ServerAlias *.mysite.us

    WSGIDaemonProcess mysite
    #can I use a different value here based on the domain?
    WSGIScriptAlias / /home/ubuntu/mysite/wsgi.py

    <Directory /home/ubuntu/mysite>
        WSGIProcessGroup mysite
        WSGIApplicationGroup %{GLOBAL}
        Order deny,allow
        Allow from all
    </Directory>
</VirtualHost>
  • 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-04T16:32:11+00:00Added an answer on June 4, 2026 at 4:32 pm

    Have you tried setting an environment variable captured from the request uri and assigning the WSGIScriptAlias path to that var?

    Something like:

    SetEnvIf HTTP_HOST "^(\w+).domain.tld" subdomain=$1
    

    You may have to finesse it a little for your purposes, and you need apache2 to capture regex values with SetEnvIf.

    http://httpd.apache.org/docs/2.2/mod/mod_setenvif.html#setenvif

    Then you should be able to use that:

    WSGIScriptAlias / /home/ubuntu/mysite/%{subdomain}.wsgi.py
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to change the assembly name based on the project configuration? I
Is it possible to change the way that Resharper formats properties? I don't like:
Is possible change background-color on same td in fullcalendar? for example: I like have
Possible Duplicate: Change an element's CSS class with JavaScript I'm trying to set div's
Is it possible to change appearance of 'fontselect', 'fontsizeselect' and 'formatselect' selectboxes something like
Is it possible to change ant property location attribute with .properties file like property
Possible Duplicate: Change language programatically in Android I would like to develop an Android
Is it possible to change the default collation based on a column? i want
Is it possible to change an items class or ID based on some type
Possible Duplicate: Change custom color for Rectangle.Fill or Grid.Background I'm trying to dynamically set

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.