Permission denied error while creating files from a python script using mod_wsgi on apache

I’m running a python script under mod_wsgi on apache. The script attempts to create some files under a directory. The path of that directory is defined by this variable named tmpdir in the script. My script resides in /var/www/webpy-app/scriptname.py When the value for tmpdir is : /home/myname/test then I get the following error in ssl_error_log: … Read more

virtualhost not working properly, site only displays with www prefix

I’m configuring my first Apache server with mod_wsgi and it isn’t working properly. The script runs fine if the browser navigates to : www.sitename.com, but navigating to sitename.com only displays the document root. <VirtualHost *:80> DocumentRoot /var/www ServerName sitename.com ServerAlias www.sitename.com WSGIScriptAlias / /var/www/sitename.com/site/site.wsgi </VirtualHost> Any help much appreciated! Answer This is not an exact … Read more

Apache Error (AH01276), Cannot serve directory /var/www/project/:

I am trying to deploy a Django web app on a newly installed centos7 server. for this i am using apache2.4 with mod_wsgi. i am stuck at serving the static files and because i am new to this, this is so confusing to me. here is my configuration files if you can help me with … Read more

Can I optimize this mod_wsgi / apache file better?

I am new to Django/Python/ mod_wsgi, and I was wondering if I could optimize this file to reduce memory usage: ServerRoot “/home/<foo>/webapps/django_wsgi/apache2” LoadModule dir_module modules/mod_dir.so LoadModule env_module modules/mod_env.so LoadModule log_config_module modules/mod_log_config.so LoadModule mime_module modules/mod_mime.so LoadModule rewrite_module modules/mod_rewrite.so LoadModule setenvif_module modules/mod_setenvif.so LoadModule wsgi_module modules/mod_wsgi.so LogFormat “%{X-Forwarded-For}i %l %u %t \”%r\” %>s %b \”%{Referer}i\” \”%{User-Agent}i\”” combined CustomLog … Read more

trouble deploying django under apache on centos with mod_wsgi

EDIT 2: I got this running mostly! It was indeed a SELinux issue. So most things work, I get a cannot write to a read only database error. And some of my things that seem like static are not found, primarily the /admin isn’t seen on anything. I am not sure if it is mysite.settings … Read more

Reference the matched directory inside an Apache DirectoryMatch directive

I am attempting to configure Apache to host multiple django sites via mod_wsgi. The mod_wsgi setup tutorial gives an example configuration for this scenario where each app is in the same directory: WSGIScriptAliasMatch ^/([^/]+) /usr/local/django/$1/apache/django.wsgi <DirectoryMatch ^/usr/local/django/([^/]+)/apache> Order deny,allow Allow from all </DirectoryMatch> I’m trying to extend this example to add a password file created … Read more

Django not running on CentOS but simple wsgi example works

my django.wsgi import os import sys sys.path.append(‘/var/www/django’) os.environ[‘DJANGO_SETTINGS_MODULE’] = ‘myapp.settings’ os.environ[‘PYTHON_EGG_CACHE’] = ‘/var/www/django/myapp/.python-eggs’ import django.core.handlers.wsgi application = django.core.handlers.wsgi.WSGIHandler() http.conf <VirtualHost 127.0.0.1:80> DocumentRoot /var/www/default ServerName localhost WSGIScriptAlias /myapp /var/www/django/myapp/apache/django.wsgi ErrorLog /var/www/django/myapp/logs/error_log </VirtualHost> The Apache error says the following When i go to localhost/myapp then it gives some server error [Fri Jun 25 12:42:42 2010] [error] [client … Read more