[mod_python] Permissions issue

Hagop Narsesian hagopnarsesian at yahoo.com
Tue Feb 19 05:43:22 EST 2008


Tom,
  You were absolutely right, this is an SELinux issue. I had played around with chmods but was under the impression SELinux was not enforced. I temporarily turned it off with
   
  echo 0 >/selinux/enforce
   
  and everything works. Do you know specifically what I need to alter in order to be able to keep SELinux on? I am a complete novice at SELinux so this is terra incognita for me. Is the below command just an example or is httpd_sys_content_t*  what I need to target? Many thanks, it's a great relief after many hours of experimenting, even though i should have thought of this myself.
  Hagop

Tom Stambaugh <tms at zeetix.com> wrote:
  You don't say whether or not you're running a linux with selinux. If so, you 
might make sure you've set your selinux permissions accordingly. I use 
"ls -lZ" to look and see, and the following to change them (from some 
interesting root)

#chcon -R -h -t httpd_sys_content_t *

I assume you've already done the usual chmod experiments with no success.

----- Original Message ----- 
From: "Hagop Narsesian" 
To: 
Sent: Monday, February 18, 2008 7:13 AM
Subject: [mod_python] Permissions issue


> Dear all,
> I have a problem I can't seem to get my head around, I'm hoping this is 
> common enough for someone to have a standard reply! I have a 
> Python-Pygresql-Postgresql-Apache-Mod_python setup and have aproblem 
> connecting to the postgresql database. I believe this is a mod_python 
> issue specifically because the same code works fine as pure Python code 
> accessing Postgresql through Pygresql.
>
> There is a shopping basket on a pure html page which sends form data to a 
> mod_python coded page and the following error message is received with 
> apache's debug feature on. This identical code worked on a windows system, 
> and the same connection code works fine as a pure Python module on the 
> said machine. In httpd.conf, the user is Apache and the group is Apache.
>
> I've tried every experiment I can think of. Can anyone help?
> Hagop
>
> MOD_PYTHON ERROR
>
> ProcessId: 891
> Interpreter: '127.0.0.1'
>
> ServerName: '127.0.0.1'
> DocumentRoot: '/var/www/html'
>
> URI: '/csp2/cart.py/p1'
> Location: None
> Directory: None
> Filename: '/var/www/html/csp2/cart.py'
> PathInfo: '/p1'
>
> Phase: 'PythonHandler'
> Handler: 'mod_python.publisher'
>
> Traceback (most recent call last):
>
> File "/usr/lib/python2.5/site-packages/mod_python/importer.py", line 
> 1537, in HandlerDispatch
> default=default_handler, arg=req, silent=hlist.silent)
>
> File "/usr/lib/python2.5/site-packages/mod_python/importer.py", line 
> 1229, in _process_target
> result = _execute_target(config, req, object, arg)
>
> File "/usr/lib/python2.5/site-packages/mod_python/importer.py", line 
> 1128, in _execute_target
> result = object(arg)
>
> File "/usr/lib/python2.5/site-packages/mod_python/publisher.py", line 
> 204, in handler
> module = page_cache[req]
>
> File "/usr/lib/python2.5/site-packages/mod_python/importer.py", line 
> 1059, in __getitem__
> return import_module(req.filename)
>
> File "/usr/lib/python2.5/site-packages/mod_python/importer.py", line 296, 
> in import_module
> log, import_path)
>
> File "/usr/lib/python2.5/site-packages/mod_python/importer.py", line 680, 
> in import_module
> execfile(file, module.__dict__)
>
> File "/var/www/html/csp2/cart.py", line 3, in 
> rs=rsw.rsc()
>
> File "/var/www/html/csp2/rsw.py", line 7, in __init__
> 
> self.db=pg.connect(dbname='postgres',user='a_super_user',passwd='a_password',host='localhost',port=5432)
>
> InternalError: could not connect to server: Permission denied
> Is the server running on host "localhost" and accepting
> TCP/IP connections on port 5432?
>
>
>
> MODULE CACHE DETAILS
>
> Accessed: Mon Feb 18 12:04:11 2008
> Generation: 0
>
> _mp_85c706a52797631fd526e880ea631520 {
> FileName: '/var/www/html/csp2/cart.py'
> Instance: 1 [IMPORT]
> Generation: 0 [ERROR]
> Modified: Sat Aug 4 18:34:30 2007
> Children: '/var/www/html/csp2/rsw.py',
> '/var/www/html/csp2/web_templates.py'
> }
>
> _mp_040d2e7b309cbc54463a95573b512c94 {
> FileName: '/var/www/html/csp2/rsw.py'
> Instance: 1 [IMPORT]
> Generation: 2
> Modified: Thu Feb 14 15:32:52 2008
> Imported: Mon Feb 18 12:04:11 2008
> }
>
> _mp_7893a0b888652c1d2565a1ac1016c7e4 {
> FileName: '/var/www/html/csp2/web_templates.py'
> Instance: 1 [IMPORT]
> Generation: 1
> Modified: Sat Aug 4 21:15:48 2007
> Imported: Mon Feb 18 12:04:11 2008
>
>
>
>
>
> ---------------------------------
> Looking for last minute shopping deals? Find them fast with Yahoo! 
> Search.


--------------------------------------------------------------------------------


> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python
> 





       
---------------------------------
Never miss a thing.   Make Yahoo your homepage.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20080219/b4edcc25/attachment.html


More information about the Mod_python mailing list