-1

I'm trying to deploy a Django project on a linode server that has apache, some other django projects and a php project on it. Also my project is in a virualenv and the other django projects aren't.

My Django project apache file is

WSGIPythonPath /home/nccylli/www/ylli_transactions:/root/Envs/ylli-transactions/lib/python2.6/site-packages
WSGISocketPrefix /var/run/apache2/wsgi
WSGIScriptAlias / /home/nccylli/www/ylli_transactions/ylli_transactions/wsgi.py
DocumentRoot /home/nccylli/www/ylli_transactions/static


<Directory /home/nccylli/www/ylli_transactions>
<Files wsgi.py>
  Order allow,deny
  Allow from all
</Files>
</Directory>

Alias  /static /home/nccylli/www/ylli_transactions/static
Alias  /media /home/nccylli/www/ylli_transactions/media

ErrorLog /home/nccylli/www/ylli_transactions/logs/error.log
CustomLog /home/nccylli/www/ylli_transactions/logs/access.log combined

<VirtualHost *:80>
   ServerName my-domain.com
   ServerAlias www.my-domain.com
   ServerAdmin my-email


</VirtualHost>

The PHP project apache file

<VirtualHost *:80>
        ServerName php-prject-domain
    ServerAlias www.php-prject-domain
        DocumentRoot /home/nccylli/www/php-prject/

    CustomLog     /var/log/apache2/php-prject-access.log combined
    ErrorLog      /var/log/apache2/php-prject-error.log

        <IfModule mpm_itk_module>
                AssignUserId nccylli nccylli
        </IfModule>
</VirtualHost>

Now I'm running into two errors
in the django project error log

(13)Permission denied: access to / denied
(13)Permission denied: mod_wsgi (pid=9780, process='', application='my-domain.com|'): Call to fopen() failed for '/home/nccylli/www/ylli_transactions/ylli_transactions/wsgi.py'.

and in the php project error log

mod_wsgi (pid=26782): Target WSGI script '/home/nccylli/www/ylli_transactions/ylli_transactions/wsgi.py' cannot be loaded as Python module.
mod_wsgi (pid=26782): Exception occurred processing WSGI script '/home/nccylli/www/ylli_transactions/ylli_transactions/wsgi.py'.
Traceback (most recent call last):
  File "/home/nccylli/www/ylli_transactions/ylli_transactions/wsgi.py", line 13, in <module>
    from django.core.wsgi import get_wsgi_application
ImportError: No module named wsgi

Any thoughts?

1 Answer 1

1

Try using following code:

<Directory /home/nccylli/www/ylli_transactions/ylli_transactions>
<Files wsgi.py>
  Order allow,deny
  Allow from all
</Files>
</Directory>
Sign up to request clarification or add additional context in comments.

3 Comments

@dado_eyad have you added WSGIPythonPath,WSGISocketPrefix and WSGIScriptAlias correctly?
Can you show me value of each of these: WSGIPythonPath, WSGISocketPrefix, WSGIScriptAlias and absolute path to wsgi.py?
They are up there in the first file in my post. It's okay though, we moved to another server and configured everything with ngix and virtualenvs.

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.