0

I have configured a linode server with apache2 and mod_wsgi..

  1. the server is running
  2. wsgi is running
  3. postgre is running and syncdb was successful

what I am having trouble finishing is actually serving the app..

my file structure:

.
├── logfile
└── srv
    ├── logfile
    └── www
        └── quickerhub.com
            ├── admin
            │   ├── css
            │   │   ├── base.css
            │   │   ├── changelists.css
            │   │   ├── dashboard.css
            │   │   ├── forms.css
            │   │   ├── ie.css
            │   │   ├── login.css
            │   │   ├── rtl.css
            │   │   └── widgets.css
            │   ├── img
            │   │   ├── changelist-bg.gif
            │   │   ├── changelist-bg_rtl.gif
            │   │   ├── chooser-bg.gif
            │   │   ├── chooser_stacked-bg.gif
            │   │   ├── default-bg.gif
            │   │   ├── default-bg-reverse.gif
            │   │   ├── deleted-overlay.gif
            │   │   ├── gis
            │   │   │   ├── move_vertex_off.png
            │   │   │   └── move_vertex_on.png
            │   │   ├── icon_addlink.gif
            │   │   ├── icon_alert.gif
            │   │   ├── icon_calendar.gif
            │   │   ├── icon_changelink.gif
            │   │   ├── icon_clock.gif
            │   │   ├── icon_deletelink.gif
            │   │   ├── icon_error.gif
            │   │   ├── icon-no.gif
            │   │   ├── icon_searchbox.png
            │   │   ├── icon_success.gif
            │   │   ├── icon-unknown.gif
            │   │   ├── icon-yes.gif
            │   │   ├── inline-delete-8bit.png
            │   │   ├── inline-delete.png
            │   │   ├── inline-restore-8bit.png
            │   │   ├── inline-restore.png
            │   │   ├── inline-splitter-bg.gif
            │   │   ├── nav-bg.gif
            │   │   ├── nav-bg-grabber.gif
            │   │   ├── nav-bg-reverse.gif
            │   │   ├── nav-bg-selected.gif
            │   │   ├── selector-icons.gif
            │   │   ├── selector-search.gif
            │   │   ├── sorting-icons.gif
            │   │   ├── tool-left.gif
            │   │   ├── tool-left_over.gif
            │   │   ├── tool-right.gif
            │   │   ├── tool-right_over.gif
            │   │   ├── tooltag-add.gif
            │   │   ├── tooltag-add_over.gif
            │   │   ├── tooltag-arrowright.gif
            │   │   └── tooltag-arrowright_over.gif
            │   └── js
            │       ├── actions.js
            │       ├── actions.min.js
            │       ├── admin
            │       │   ├── DateTimeShortcuts.js
            │       │   ├── ordering.js
            │       │   └── RelatedObjectLookups.js
            │       ├── calendar.js
            │       ├── collapse.js
            │       ├── collapse.min.js
            │       ├── core.js
            │       ├── getElementsBySelector.js
            │       ├── inlines.js
            │       ├── inlines.min.js
            │       ├── jquery.init.js
            │       ├── jquery.js
            │       ├── jquery.min.js
            │       ├── LICENSE-JQUERY.txt
            │       ├── prepopulate.js
            │       ├── prepopulate.min.js
            │       ├── SelectBox.js
            │       ├── SelectFilter2.js
            │       ├── timeparse.js
            │       └── urlify.js
            ├── interest
            │   ├── django.wsgi
            │   ├── __init__.py
            │   ├── __init__.pyc
            │   ├── settings.py
            │   ├── settings.pyc
            │   ├── urls.py
            │   └── wsgi.py
            ├── js
            │   └── jquery-1.10.1.min.js
            ├── logfile
            ├── manage.py
            ├── README
            ├── reoccurring
            │   ├── admin.py
            │   ├── forms.py
            │   ├── __init__.py
            │   ├── __init__.pyc
            │   ├── models.py
            │   ├── models.pyc
            │   ├── usagelib.py
            │   └── views.py
            ├── schedule
            │   ├── admin.py
            │   ├── __init__.py
            │   ├── __init__.pyc
            │   ├── models.py
            │   ├── models.pyc
            │   ├── tests.py
            │   ├── usagelib.py
            │   └── views.py
            ├── src
            │   ├── facebooksdk
            │   │   ├── examples
            │   │   │   ├── appengine
            │   │   │   │   ├── app.yaml
            │   │   │   │   ├── example.html
            │   │   │   │   └── example.py
            │   │   │   ├── newsfeed
            │   │   │   │   ├── app.yaml
            │   │   │   │   ├── facebookclient.py
            │   │   │   │   ├── static
            │   │   │   │   │   ├── base.css
            │   │   │   │   │   ├── favicon.ico
            │   │   │   │   │   └── robots.txt
            │   │   │   │   └── templates
            │   │   │   │       ├── base.html
            │   │   │   │       ├── home.html
            │   │   │   │       └── index.html
            │   │   │   ├── oauth
            │   │   │   │   ├── app.yaml
            │   │   │   │   ├── facebookoauth.py
            │   │   │   │   └── oauth.html
            │   │   │   └── tornado
            │   │   │       ├── example.html
            │   │   │       ├── example.py
            │   │   │       └── schema.sql
            │   │   ├── facebook.py
            │   │   ├── facebook_sdk.egg-info
            │   │   │   ├── dependency_links.txt
            │   │   │   ├── PKG-INFO
            │   │   │   ├── SOURCES.txt
            │   │   │   └── top_level.txt
            │   │   ├── MANIFEST.in
            │   │   ├── README.rst
            │   │   └── setup.py
            │   └── pip-delete-this-directory.txt
            ├── static
            │   └── js
            │       └── jquery-1.10.1.min.js
            ├── templates
            │   ├── 404.html
            │   ├── 500.html
            │   ├── Base.html
            │   ├── Home.html
            │   ├── Reoccurring.html
            │   └── Usersettings.html
            └── usersetting
                ├── admin.py
                ├── __init__.py
                ├── __init__.pyc
                ├── models.py
                ├── models.pyc
                └── views.py

my django.wsgi:

import os
import sys

sys.path.append('/srv/www/quickerhub.com/')

os.environ['PYTHON_EGG_CACHE'] = '/srv/www/quickerhub.com.python-egg'
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'

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

my httpd.conf:

WSGIScriptAlias / /www/quickerhub.com/interest/django.wsgi

<Directory /srv/www/quickerhub.com>
Order allow,deny
Allow from all
</Directory> 

my sites-enabled/quickerhub.com:

WSGIPythonPath /srv/www/quickerhub.com
<VirtualHost *:80>
    ServerName quickerhub.com
    ServerAlias testing.quickerhub.com

    Alias /static/ /srv/www/quickerhub.com/interest/static/
    # Alias /sitemap.xml /srv/www/quickerhub.com/interest/static/sitemap.xml
    WSGIScriptAlias / /srv/www/quickerhub.com/interest/django.wsgi

    <Directory />
        AllowOverride None
        Options -Indexes
    </Directory>

    <Directory /srv/www/quickerhub.com/.git/>
        Deny From All
    </Directory>

</VirtualHost>

Please help! Thanks!

2
  • Please don't radically change your question after it has been answered. Instead, ask a new question. Jul 4, 2013 at 3:14
  • my apologies, will do Jul 4, 2013 at 3:18

2 Answers 2

2

The directory /srv/www doesn't exist or is unreadable by Apache. Check for its existence and permissions (it should be world readable/executable).

sudo chmod a+rx /srv/www
6
  • loganhenson@kingdom:~$ sudo chmod a+rx /srv/www chmod: cannot access /srv/www: No such file or directory` is what I get, why is it looking there to begin with? in my wsgi alias it says to look further down in the interest app for the file.. Jul 4, 2013 at 2:42
  • OK, so you put the entire directory structure in the wrong location. Just move it. Jul 4, 2013 at 2:49
  • ah wow your right, that fixed it...I feel so very silly now..now I am getting a different error ImportError: Could not import settings 'settings' (Is it on sys.path?): No module named settings Jul 4, 2013 at 2:57
  • On to the next question, then! Jul 4, 2013 at 2:58
  • OP updated with full error log Jul 4, 2013 at 3:02
0

there are three things you have to recheck

  1. Check the mod_wsgi path in httpd.conf file. Use find command to get absolute path of django.wsgi

    WSGIScriptAlias / /path/to/mysite/apache/django.wsgi

  2. check the ownership and permission of /srv/www/quickerhub.com

  3. Add this below given syntax in httpd.conf and restart the apache

    <Directory /srv/www/quickerhub.com>
    Order allow,deny
    Allow from all
    </Directory>
    
2
  • ok, updated my httpd.conf file, posted contents in op and ownership/permission in op Jul 4, 2013 at 3:11
  • I did not understand op here, what is this op meaning? Are you still facing the issue? Jul 5, 2013 at 18:30

Not the answer you're looking for? Browse other questions tagged or ask your own question.