0

i was trying to run my django application using apache2 and i failed. Its giving me a 500 internal server error saying The server encountered an internal error or misconfiguration and was unable to complete your request. First i created a firstweb.wsgi file in my home directory. And put this codes

import os
import sys
sys.path = ['/var/www/firstweb'] + sys.path
os.environ['DJANGO_SETTINGS_MODELE'] = 'firstweb.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()

And in my /etc/apache2/sites-available i created a file named firstweb.conf In firstweb.conf i have this code

<VirtualHost *:80>
WSGIScriptAlias / /home/nihan/firstweb.wsgi

ServerName firstweb.com
Alias /static /var/www/firstweb/static

<Directory /var/www/firstweb/ >
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

And in my /var/www/ i created a django project by typing

sudo django-admin.py startproject firstweb

This is the first time i am trying apache , mod_wsgi and Django

Please help me to understand i have i missed

1 Answer 1

1

The user that Apache runs as generally doesn't have access to stuff in your home directory. That this is the case cannot be confirmed as you haven't supplied the error message from the Apache error log, only what was displayed in the browser. Suggest you watch:

That talk covers common errors like that.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.