Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.

#1 June 21, 2010 15:03:38

w.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

djapian not working with apach2


hi all,

im using djapian for my search , it seems to work fine when i run it
in django development server
but when i configure my sites to use apach2 im always getting this
error when i try to search :

"Caught OSError while rendering: Permission denied: '/
index'"
i am sure it is not a folder permission issue because when i run my
sites using ./manage.py runserver i get the results of my search.

im using mod_wsgi

my locasites.conf :


# -------------------------------------------

<VirtualHost myip:80>
ServerName mysite.name
ServerAlias mysitealias

WSGIScriptAlias / "/path/to/my/apache/file.wsgi"
<Directory "/path/to/my/apache">
Allow from all
</Directory>

Alias /site_media/ "/path/to/mysite/media/"
<Directory "/path/to/mysite/media/">
Order allow,deny
Options Indexes FollowSymLinks
Allow from all
IndexOptions FancyIndexing
</Directory>

Alias /media/ "/usr/local/lib/python2.6/dist-packages/django/
contrib/admin/media/"
<Directory "/usr/local/lib/python2.6/dist-packages/django/contrib/
admin/media/">
Order allow,deny
Options Indexes FollowSymLinks
Allow from all
IndexOptions FancyIndexing
</Directory>

</VirtualHost>

this is repeated for all the sites.

can anyone help with issue
regards

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#2 June 21, 2010 19:59:43

Skylar S.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

djapian not working with apach2


I would guess that you are trying to access /index with the webserver
user but that is owned by another user and the user that owns the web
process has not the sufficient permissions to do the attempted
operation. Set the permissions on the directory accordingly, perhaps
ownership as well. You could just nuke the permissions with a chmod
777 /index (or so) if security is not crucial. Otherwise you need to
give permissions to the dir to your webserver user in a less nukular
way.

You could also run the wsgi process(es) as the user of your choice
using perhapshttp://code.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGIDaemonProcesshope that helps.

On Jun 21, 10:03 am, watad <awa...@gmail.com> wrote:
> hi all,
>
> im using djapian for my search , it seems to work fine when i run it
> in django development server
> but when i configure my sites to use apach2 im always getting this
> error when i try to search :
>
> "Caught OSError while rendering: Permission denied: '/
> index'"
> i am sure it is not a folder permission issue because when i run my
> sites using ./manage.py runserver   i get the results of my search.
>
> im using mod_wsgi
>
> my locasites.conf :
>
> # -------------------------------------------
>
> <VirtualHost myip:80>
>     ServerName mysite.name
>     ServerAlias mysitealias
>
>     WSGIScriptAlias / "/path/to/my/apache/file.wsgi"
>     <Directory "/path/to/my/apache">
>         Allow from all
>     </Directory>
>
>     Alias /site_media/ "/path/to/mysite/media/"
>     <Directory "/path/to/mysite/media/">
>         Order allow,deny
>         Options Indexes FollowSymLinks
>         Allow from all
>         IndexOptions FancyIndexing
>     </Directory>
>
>     Alias /media/ "/usr/local/lib/python2.6/dist-packages/django/
> contrib/admin/media/"
>     <Directory "/usr/local/lib/python2.6/dist-packages/django/contrib/
> admin/media/">
>         Order allow,deny
>         Options Indexes FollowSymLinks
>         Allow from all
>         IndexOptions FancyIndexing
>     </Directory>
>
> </VirtualHost>
>
>  this is repeated for all the sites.
>
> can anyone help with issue
> regards

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#3 June 22, 2010 01:01:17

Graham D.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

djapian not working with apach2


On Jun 22, 12:03 am, watad <awa...@gmail.com> wrote:
> hi all,
>
> im using djapian for my search , it seems to work fine when i run it
> in django development server
> but when i configure my sites to use apach2 im always getting this
> error when i try to search :
>
> "Caught OSError while rendering: Permission denied: '/
> index'"
> i am sure it is not a folder permission issue because when i run my
> sites using ./manage.py runserver   i get the results of my search.
>
> im using mod_wsgi
>
> my locasites.conf :
>
> # -------------------------------------------
>
> <VirtualHost myip:80>
>     ServerName mysite.name
>     ServerAlias mysitealias
>
>     WSGIScriptAlias / "/path/to/my/apache/file.wsgi"
>     <Directory "/path/to/my/apache">
>         Allow from all
>     </Directory>
>
>     Alias /site_media/ "/path/to/mysite/media/"
>     <Directory "/path/to/mysite/media/">
>         Order allow,deny
>         Options Indexes FollowSymLinks
>         Allow from all
>         IndexOptions FancyIndexing
>     </Directory>
>
>     Alias /media/ "/usr/local/lib/python2.6/dist-packages/django/
> contrib/admin/media/"
>     <Directory "/usr/local/lib/python2.6/dist-packages/django/contrib/
> admin/media/">
>         Order allow,deny
>         Options Indexes FollowSymLinks
>         Allow from all
>         IndexOptions FancyIndexing
>     </Directory>
>
> </VirtualHost>
>
>  this is repeated for all the sites.
>
> can anyone help with issue

Don't use relative path names in your code, you must use absolute path
names.

As the current working directory under Apache is usually '/', relative
path names will resolve relative to that and not your site directory
as with runserver. Thus, if you have simple 'index' in your code as
relative path name, that will resolve to '/index' and because Apache
user cannot write to '/' directory you will get an OSError like you
are seeing.

Graham

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#4 June 22, 2010 09:14:11

w.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

djapian not working with apach2


thanks Skylar i have used chmod 777 -R for /index , but it didnt work
maybe because as u said the owner of the web process is different than
the user im using
anyway i used the absolute path as Graham suggested down and it is
working fine
thank you for your quick response

On Jun 21, 9:59 pm, Skylar Saveland <skylar.savel...@gmail.com> wrote:
> I would guess that you are trying to access /index with the webserver
> user but that is owned by another user and the user that owns the web
> process has not the sufficient permissions to do the attempted
> operation.  Set the permissions on the directory accordingly, perhaps
> ownership as well.  You could just nuke the permissions with a chmod
> 777 /index (or so) if security is not crucial.  Otherwise you need to
> give permissions to the dir to your webserver user in a less nukular
> way.
>
> You could also run the wsgi process(es) as the user of your choice
> using
> perhapshttp://code.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGIDae...
> hope that helps.
>
> On Jun 21, 10:03 am, watad <awa...@gmail.com> wrote:
>
>
>
> > hi all,
>
> > im using djapian for my search , it seems to work fine when i run it
> > in django development server
> > but when i configure my sites to use apach2 im always getting this
> > error when i try to search :
>
> > "Caught OSError while rendering: Permission denied: '/
> > index'"
> > i am sure it is not a folder permission issue because when i run my
> > sites using ./manage.py runserver   i get the results of my search.
>
> > im using mod_wsgi
>
> > my locasites.conf :
>
> > # -------------------------------------------
>
> > <VirtualHost myip:80>
> >     ServerName mysite.name
> >     ServerAlias mysitealias
>
> >     WSGIScriptAlias / "/path/to/my/apache/file.wsgi"
> >     <Directory "/path/to/my/apache">
> >         Allow from all
> >     </Directory>
>
> >     Alias /site_media/ "/path/to/mysite/media/"
> >     <Directory "/path/to/mysite/media/">
> >         Order allow,deny
> >         Options Indexes FollowSymLinks
> >         Allow from all
> >         IndexOptions FancyIndexing
> >     </Directory>
>
> >     Alias /media/ "/usr/local/lib/python2.6/dist-packages/django/
> > contrib/admin/media/"
> >     <Directory "/usr/local/lib/python2.6/dist-packages/django/contrib/
> > admin/media/">
> >         Order allow,deny
> >         Options Indexes FollowSymLinks
> >         Allow from all
> >         IndexOptions FancyIndexing
> >     </Directory>
>
> > </VirtualHost>
>
> >  this is repeated for all the sites.
>
> > can anyone help with issue
> > regards

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#5 June 22, 2010 09:15:45

w.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

djapian not working with apach2


thanks a lot Graham!!! :) i used absolute path and it is working fine

On Jun 22, 3:01 am, Graham Dumpleton <graham.dumple...@gmail.com>
wrote:
> On Jun 22, 12:03 am, watad <awa...@gmail.com> wrote:
>
>
>
>
>
> > hi all,
>
> > im using djapian for my search , it seems to work fine when i run it
> > in django development server
> > but when i configure my sites to use apach2 im always getting this
> > error when i try to search :
>
> > "Caught OSError while rendering: Permission denied: '/
> > index'"
> > i am sure it is not a folder permission issue because when i run my
> > sites using ./manage.py runserver   i get the results of my search.
>
> > im using mod_wsgi
>
> > my locasites.conf :
>
> > # -------------------------------------------
>
> > <VirtualHost myip:80>
> >     ServerName mysite.name
> >     ServerAlias mysitealias
>
> >     WSGIScriptAlias / "/path/to/my/apache/file.wsgi"
> >     <Directory "/path/to/my/apache">
> >         Allow from all
> >     </Directory>
>
> >     Alias /site_media/ "/path/to/mysite/media/"
> >     <Directory "/path/to/mysite/media/">
> >         Order allow,deny
> >         Options Indexes FollowSymLinks
> >         Allow from all
> >         IndexOptions FancyIndexing
> >     </Directory>
>
> >     Alias /media/ "/usr/local/lib/python2.6/dist-packages/django/
> > contrib/admin/media/"
> >     <Directory "/usr/local/lib/python2.6/dist-packages/django/contrib/
> > admin/media/">
> >         Order allow,deny
> >         Options Indexes FollowSymLinks
> >         Allow from all
> >         IndexOptions FancyIndexing
> >     </Directory>
>
> > </VirtualHost>
>
> >  this is repeated for all the sites.
>
> > can anyone help with issue
>
> Don't use relative path names in your code, you must use absolute path
> names.
>
> As the current working directory under Apache is usually '/', relative
> path names will resolve relative to that and not your site directory
> as with runserver. Thus, if you have simple 'index' in your code as
> relative path name, that will resolve to '/index' and because Apache
> user cannot write to '/' directory you will get an OSError like you
> are seeing.
>
> Graham

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

Board footer

Moderator control

Enjoy the 13th of December
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support