How to tell Apache to see my Djangoproject??

25 views
Skip to first unread message

doniyor

unread,
May 11, 2012, 5:48:43 AM5/11/12
to django...@googlegroups.com
hey guys, i am stuck here.. please help me :( i cannot serve my project on server, it says 403  You don't have permission to access / on this server. 
this is my httpd.conf file. 

<VirtualHost 85.114.145.142:80>
    ServerAdmin webmaster
    Servername afect.stahlbaron.de
    Serveralias www.afect.stahlbaron.de
    DocumentRoot /usr/local/httpd/vhtdocs/stahlbaron/
    SuexecUserGroup stahlbaron stahlbaron
    WSGIScriptAlias / /usr/local/httpd/vhtdocs/stahlbaron_dj/apache/lastsite.wsgi
   # DocumentRoot /usr/local/httpd/htdocs/
   # Servername afect.stahlbaron.de
</VirtualHost>

<VirtualHost 85.114.145.142:80>
    DocumentRoot /usr/local/httpd/htdocs/superuser/
</VirtualHost>

<VirtualHost 85.114.145.142:80>
    SuexecUserGroup httpd httpd
    DocumentRoot /usr/local/httpd/htdocs/mysql/
    Servername mysql.afect.stahlbaron.de
</VirtualHost>

<VirtualHost 85.114.145.142:80>
    SuexecUserGroup httpd httpd
    DocumentRoot /www/htdocs/webftp/
</VirtualHost>

<VirtualHost 85.114.145.142:80>
    SuexecUserGroup httpd httpd
    DocumentRoot /www/htdocs/webmail/
</VirtualHost>

<VirtualHost 85.114.145.142:80>
  DocumentRoot /usr/local/httpd/statistik/stahlbaron.de
</VirtualHost>

LoadModule wsgi_module modules/mod_wsgi.so
Include "/www/vhtdocs/stahlbaron_dj/apache/apache_django_wsgi.conf"

is there any mistake? i cannot figure out any more what to do. it is too much mass inside there in server. i have never done django deployment on server. what files are to change actually? 

thanks for help 

OS is Linux. Apache2.2 is running. mod_wsgi is installed. 

doniyor

unread,
May 11, 2012, 7:25:59 AM5/11/12
to django...@googlegroups.com
i solved this, but not all. now i see the folders and files downloadable in browser instead of a webpage. Why is this? 

Bolkin

unread,
May 11, 2012, 10:19:24 AM5/11/12
to django...@googlegroups.com
It looks close enough, but try commenting out other virtual hosts to reduce noise, and also comment out:

#DocumentRoot /usr/local/httpd/vhtdocs/stahlbaron/

You might need to add:

<Directory /usr/local/httpd/vhtdocs/stahlbaron_dj/apache/ > Order deny,allow Allow from all </Directory>

Bolkin

unread,
May 11, 2012, 10:21:10 AM5/11/12
to django...@googlegroups.com
Sorry, supposed to be on different lines:
<Directory /usr/local/httpd/vhtdocs/stahlbaron_dj/apache/ > 
   Order deny,allow 
   Allow from all 
</Directory>

doniyor

unread,
May 12, 2012, 1:12:26 AM5/12/12
to django...@googlegroups.com
hey thanks thanks, but now i have 500 Internal Server Error. What i now have is: 

a folder 'apache' next to my django project folder. Apache folder has: apache_django_wsgi.conf, myproject.wsgi, __init__.py, urls_production.py, settings_production.py

and in httpd.conf i have this (stahlhandel is my djangoproject): 

<VirtualHost 85.114.145.142:80>
    RewriteEngine On
    RewriteLog          /usr/local/httpd/logs/rewrite.log
    RewriteLogLevel     2
    RewriteMap          low     int:tolower
    RewriteMap          subdom  txt:/usr/local/httpd/conf/subdomains.lst
    RewriteCond         ${subdom:%{HTTP_HOST}}  ^(/.*)$
    RewriteRule         ^/(.*)$   %1/$1 [E=SUBDOM:${low:%{HTTP_HOST}}]
    DocumentRoot /usr/local/httpd/htdocs/admin
    Servername admin.afect.stahlbaron.de
</VirtualHost>

<VirtualHost 85.114.145.142:80>
    ServerAdmin webmaster
    Servername afect.stahlbaron.de
    Serveralias www.afect.stahlbaron.de
    DocumentRoot /usr/local/httpd/vhtdocs/stahlbaron/stahlhandel
    SuexecUserGroup stahlbaron stahlbaron
    ScriptAlias /cgi-bin/ /usr/local/httpd/vhtdocs/stahlbaron/cgi-bin/
    WSGIScriptAlias / /www/vhtdocs/stahlbaron/stahlhandel/apache/lastsite.wsgi
<Directory />
    Options SymLinksIfOwnerMatch Indexes
    AllowOverride AuthConfig
    Allow from all
</Directory>

<Directory /usr/local/httpd/vhtdocs/stahlbaron/stahlhandel/apache/>
Order deny,allow
Allow from all
</Directory>

  ScriptAlias /php/ /usr/local/httpd/conf/php/stahlbaron.de/
  AddHandler php-cgi .php
  Action php-cgi /php/php.cgi
# DocumentRoot /usr/local/httpd/htdocs/
   # Servername afect.stahlbaron.de
</VirtualHost>

can it be that i am missing <Location /> tag or is it here not relevant? 

thanks 
Reply all
Reply to author
Forward
0 new messages