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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:26:20+00:00 2026-05-26T13:26:20+00:00

Disclaimer: I don’t really know what I’m doing, so I may have phrased things

  • 0

Disclaimer: I don’t really know what I’m doing, so I may have phrased things wrong. I’ve also never asked/answered a question on here before!

I have a Django app running on Apache that I deployed using mod_wsgi and virtualenv. I want some parts of the app to use SSL, however when I install the SSL certificate, the https URL goes to the index.html file from my public_html folder instead of the app (which is outside of public_html)

For example, visit https://tradekandi.com. That URL is just a basic HTML file: public_html/index.html
Then visit http://tradekandi.com. That’s my Django page (in maintenance mode).

I’ve searched stackoverflow and Google all day. I’ve tried removing the documentroot from the virtual hosts file but that did nothing. I tried adding a SetEnvIf X-Forwarded-Proto https HTTPS=1 line to it but that did nothing either.

My virtual hosts file has these lines in it:

SSLEngine on 
SSLCertificateFile /etc/ssl/certs/tradekandi.com.crt
SSLCertificateKeyFile /etc/ssl/private/tradekandi.com.key
SSLCACertificateFile /etc/ssl/certs/tradekandi.com.cabundle

Whenever I make any changes, I restart apache and “touch” the app’s wsgi file.

How can I make the https URL load the Django app? Any help would be much appreciated. Thank you.

More of httpd configuration:

<VirtualHost 69.65.42.153:80>
ServerName tradekandi.com
ServerAlias www.tradekandi.com
DocumentRoot /home/trade/public_html
ServerAdmin webmaster@tradekandi.com
UseCanonicalName Off
CustomLog /usr/local/apache/domlogs/tradekandi.com combined
CustomLog /usr/local/apache/domlogs/tradekandi.com-bytes_log "%{%s}t %I .\n%{%s}t %O ."
## User trade # Needed for Cpanel::ApacheConf
<IfModule mod_suphp.c>
    suPHP_UserGroup trade trade
</IfModule>
<IfModule !mod_disable_suexec.c>
    SuexecUserGroup trade trade
</IfModule>
ScriptAlias /cgi-bin/ /home/trade/public_html/cgi-bin/

Include "/usr/local/apache/conf/userdata/*.conf"  
Include "/usr/local/apache/conf/userdata/*.owner-root" 
Include "/usr/local/apache/conf/userdata/std/*.conf" 
Include "/usr/local/apache/conf/userdata/std/*.owner-root" 
Include "/usr/local/apache/conf/userdata/std/2/*.conf" 
Include "/usr/local/apache/conf/userdata/std/2/*.owner-root" 
Include "/usr/local/apache/conf/userdata/std/2/trade/*.conf"  
Include "/usr/local/apache/conf/userdata/std/2/trade/tradekandi.com/*.conf"

</VirtualHost>

<VirtualHost 69.65.42.153:443>
ServerName tradekandi.com
ServerAlias www.tradekandi.com
DocumentRoot /home/trade/public_html
ServerAdmin webmaster@tradekandi.com
UseCanonicalName Off
CustomLog /usr/local/apache/domlogs/tradekandi.com combined
CustomLog /usr/local/apache/domlogs/tradekandi.com-bytes_log "%{%s}t %I .\n%{%s}t %O ."
## User nobody # Needed for Cpanel::ApacheConf
<IfModule mod_suphp.c>
    suPHP_UserGroup nobody nobody
</IfModule>
ScriptAlias /cgi-bin/ /home/trade/public_html/cgi-bin/
SSLEngine on

SSLCertificateFile /etc/ssl/certs/tradekandi.com.crt
SSLCertificateKeyFile /etc/ssl/private/tradekandi.com.key
SSLCACertificateFile /etc/ssl/certs/tradekandi.com.cabundle
CustomLog /usr/local/apache/domlogs/tradekandi.com-ssl_log combined
SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
<Directory "/home/trade/public_html/cgi-bin">
    SSLOptions +StdEnvVars
</Directory>
Include "/usr/local/apache/conf/userdata/*.conf"
</VirtualHost>

If it’s relevant, this is a dedicated server running CentOS & I am also using it to host one PHP-based site.

Wsgi file:

import os
import sys
sys.stdout = sys.stderr

from os.path import abspath, dirname, join
from site import addsitedir
sys.path.append('/home/trade/sites/tradekandi.com.env/lib/python2.7/site-packages')
sys.path.insert(0, abspath(join(dirname(__file__), "../../")))

from django.conf import settings
os.environ["DJANGO_SETTINGS_MODULE"] = "trade.settings"

sys.path.insert(0, join(settings.PROJECT_ROOT, "apps"))

from django.core.handlers.wsgi import WSGIHandler
application = WSGIHandler()

extra.conf with mod_wsgi directives:

Alias /static/ /home/trade/public_html/static/

<Directory /home/trade/public_html/static>
Order deny,allow
Allow from all
</Directory>

WSGIDaemonProcess trade python-path=/home/trade/sites/tradekandi.com.env/lib/python2.7/site-packages
WSGIProcessGroup trade

WSGIScriptAlias / /home/trade/sites/tradekandi.com.env/site/trade/deploy/pinax.wsgi

<Directory /home/trade/sites/tradekandi.com.env/site/trade/deploy>
Order deny,allow
Allow from all
</Directory>
  • 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-05-26T13:26:21+00:00Added an answer on May 26, 2026 at 1:26 pm

    Answering my own question for the benefit of anyone who may come across this:

    I added the following lines:

    WSGIProcessGroup tradek
    
    WSGIScriptAlias / /home/trade/sites/tradekandi.com.env/site/trade/deploy/pinax.wsgi
    

    to a .conf file located in /usr/local/apache/conf/userdata/ssl/2/trade/tradekandi.com, then used the command /scripts/ensure_vhost_includes –user=trade

    (I also happened to change the ProcessGroup name)

    Seems to have done the trick, although now I need to get rid of the insecure elements on the page! Thanks to Graham, because it was one of your answers to someone else that helped me figure this out.

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

Sidebar

Related Questions

Disclaimer: I don't have a whole ton of experience with Java Generics, but my
Disclaimer: I don't actually know anything about nether Oracle nor Java. The issue is
Disclaimer Yes, I know: don't use PASSWORD(password) to encrypt passwords . I don't want
Disclaimer: I know this type of question has been asked here before, I just
(Disclaimer: I don't know what the C++ standard might say about this..I know, I'm
Disclaimer: I have no experience using YUI at all. I was wondering how the
Disclaimer: This question is meant to be purely theoretical, so please don't ask me
Disclaimer: I'm working in a project where exist an huge webapp that have an
Disclaimer, I'm from a Java background. I don't do much C#. There's a great
DISCLAIMER: Don't use ::feof() as your loop condition. For example, see the answer to:

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.