I'm running some Python code which uses urllib2.urlopen
which works fine when run as the user, root
(Linux).
However, it doesn't work when run as user apache
(we're running it through apache version 1) - I get this error:
Traceback (most recent call last):
File "/srv/www/vm/custom/ipn.py", line 118, in ?
a = confirm_paypal(f, f1)
File "/srv/www/vm/custom/ipn.py", line 47, in confirm_paypal
response = urllib2.urlopen(PP_URL, params)
File "/usr/lib64/python2.4/urllib2.py", line 130, in urlopen
return _opener.open(url, data)
File "/usr/lib64/python2.4/urllib2.py", line 358, in open
response = self._open(req, data)
File "/usr/lib64/python2.4/urllib2.py", line 376, in _open
'_open', req)
File "/usr/lib64/python2.4/urllib2.py", line 337, in _call_chain
result = func(*args)
File "/usr/lib64/python2.4/urllib2.py", line 1040, in https_open
return self.do_open(httplib.HTTPSConnection, req)
File "/usr/lib64/python2.4/urllib2.py", line 1006, in do_open
raise URLError(err)
URLError: <urlopen error (13, 'Permission denied')>
Is there a way to give the user, apache
, access to this function?
Update 1
Running Python 2.4.3 and Apache 2.2.3