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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T15:45:17+00:00 2026-06-04T15:45:17+00:00

I’m trying to run Django 1.3.1 on apache 2.6.6, using mod_wsgi, CentOS 6. I

  • 0

I’m trying to run Django 1.3.1 on apache 2.6.6, using mod_wsgi, CentOS 6.

I have change httpd.conf file:

WSGIPythonPath /var/www/vhosts/domain.co.uk
<VirtualHost *:80>
  #ServerName domain.co.uk
  ServerName 46...233

  ##DocumentRoot /var/www/vhosts/domain.co.uk/httpdocs

  LogLevel debug
  ErrorLog /var/www/vhosts/domain.co.uk/logs/error.log
  CustomLog /var/www/vhosts/domain.co.uk/logs/access.log combinedio

  HostnameLookups Off

  UseCanonicalName On

  WSGIScriptAlias / /var/www/vhosts/domain.co.uk/sites/somod/apache/django.wsgi
  WSGIDaemonProcess somod:80 user=somod group=psaserv processes=1 threads=1
  WSGIProcessGroup somod:80
  #WSGIPythonPath /var/www/vhosts/domain.co.uk

  Alias /robots.txt /var/www/vhosts/domain.co.uk/sites/templates/robots.txt
  Alias /favicon.ico /var/www/vhosts/domain.co.uk/sites/media/favicon.ico

  <Directory "/var/www/vhosts/domain.co.uk/httpdocs">
    AllowOverride None
    Options -ExecCGI -Includes -FollowSymLinks -Indexes
    Order allow,deny
    Allow from all
    AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/x-javascript
  </Directory>

  <Directory "/var/www/vhosts/domain.co.uk/sites">
    AllowOverride None
    Options +ExecCGI -Includes +FollowSymLinks -Indexes
    Order allow,deny
    Allow from all
    AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/x-javascript
  </Directory>

  Alias /media "/var/www/vhosts/domain.co.uk/media"
  <Location "/media/">
    SetHandler None
  </Location>
</VirtualHost>

So I paste my apache config (only code which I add). This is in /etc/httpd/conf/httpd.conf.

I can restart apache now without any errors, but website isn’t visible yet. Unfortunately I couldn’t run sudo a2enmod wsgi, I’m using cenos 6 and a2enmod isn’t available. But I’m sure it has been install, because I order vps with it, just not sure it’s running. I will check it.

My question now is what url should be to view website? Is it value form ServerName, or ip address/ServerName value? Can I use ip address in? Because I want run website and make sure everything is ok before I switch domain, because right now under this domain is website which I’m moving to new server.

Many thanks for help

  • 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-04T15:45:18+00:00Added an answer on June 4, 2026 at 3:45 pm

    Don’t know what you’re doing, but here’s a sample config for you brother:

    WSGIPythonPath /var/www/yoursite
    <VirtualHost *:80>
        ServerName yoursite.com
        ServerAlias testing.yoursite.com
    
        Alias /static/ /var/www/yoursite/yourdjangoproject/static/
        # Alias /sitemap.xml /var/www/yoursite/yourdjangoproject/static/sitemap.xml
        WSGIScriptAlias / /var/www/yoursite/yourdjangoproject/wsgi.py
    
        <Directory />
            AllowOverride None
            Options -Indexes
        </Directory>
    
        <Directory /var/www/yoursite/.git/>
            Deny From All 
        </Directory>
    
        LogLevel info
        ErrorLog /var/log/apache2/yoursite-error.log
        CustomLog /var/log/apache2/yoursite-access.log combined
    </VirtualHost>
    

    Create this file and name it yoursite and put it under /etc/apache2/sites-available. Then run sudo a2ensite yoursite and it will be palced un sites-enabled, too.

    This depends on:

    • apache2
    • libapache2-mod-wsgi

    Make sure wsgi is enabled by running sudo a2enmod wsgi.

    I recommend having the file in your version control repo, and then symlinking it from /etc/apache2/sites-available.

    Also note that I’ve created an alias for /static/ and if you want to use that, make sure you run sudo ./manage.py collectstatic. This will place all static files in /var/www/yoursite/yourproject/static.

    Good luck.

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

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am trying to render a haml file in a javascript response like so:
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I have an MVC Razor view @{ ViewBag.Title = Index; var c = (char)146;
I have thousands of HTML files to process using Groovy/Java and I need to
I have a reasonable size flat file database of text documents mostly saved in
I am trying to loop through a bunch of documents I have to put
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has

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.