468,293 Members | 1,897 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,293 developers. It's quick & easy.

Python/Apache Oddness On OSX

Hi,

I'm running Python 2.3.5/2.4.2 on OSX 10.4.2, and am trying to run CGI
scripts using the builtin Apache. For ease, I've symlinked my custom
modules into the /Library/Python/2.3/site-packages directory, and they
import OK via command line python. However, when I perform the import
from a cgi script, python fails to find the module. It is definately
something to do with the symlink, as the CGI works OK if I copy the
directory into site-packages. Is there some oddness with Python/Apache
and symlink imports?

Any pointers would be most useful.

Thanks

J
Oct 24 '05 #1
3 1653
John Abel wrote:
Hi,

I'm running Python 2.3.5/2.4.2 on OSX 10.4.2, and am trying to run CGI
scripts using the builtin Apache. For ease, I've symlinked my custom
modules into the /Library/Python/2.3/site-packages directory, and they
import OK via command line python. However, when I perform the import
from a cgi script, python fails to find the module. It is definately
something to do with the symlink, as the CGI works OK if I copy the
directory into site-packages. Is there some oddness with Python/Apache
and symlink imports?

Any pointers would be most useful.


Not sure if that is the case here, but I know that apache has some
directives that are named FollowSymlinks and the like - might be that
this affects your situation.

Regards,

Diez
Oct 24 '05 #2
John Abel wrote:
Hi,

I'm running Python 2.3.5/2.4.2 on OSX 10.4.2, and am trying to run CGI
scripts using the builtin Apache. For ease, I've symlinked my custom
modules into the /Library/Python/2.3/site-packages directory, and they
import OK via command line python. However, when I perform the import
from a cgi script, python fails to find the module. It is definately
something to do with the symlink, as the CGI works OK if I copy the
directory into site-packages. Is there some oddness with Python/Apache
and symlink imports?

Any pointers would be most useful.


If running OS supplied Apache, it runs as the user "www". Because this
isn't you or root, check that the directory your symlink points at is
accessible to others as well as any directories above it back up to the
root directory. If it isn't accessible, the user Apache runs as will
not
be able to find and use the files. When you are copying the directory
you are possibly giving it read access for others in the process and
that is why it works then.

Graham

Oct 24 '05 #3
gr*****@dscpl.com.au wrote:
John Abel wrote:

Hi,

I'm running Python 2.3.5/2.4.2 on OSX 10.4.2, and am trying to run CGI
scripts using the builtin Apache. For ease, I've symlinked my custom
modules into the /Library/Python/2.3/site-packages directory, and they
import OK via command line python. However, when I perform the import
from a cgi script, python fails to find the module. It is definately
something to do with the symlink, as the CGI works OK if I copy the
directory into site-packages. Is there some oddness with Python/Apache
and symlink imports?

Any pointers would be most useful.


If running OS supplied Apache, it runs as the user "www". Because this
isn't you or root, check that the directory your symlink points at is
accessible to others as well as any directories above it back up to the
root directory. If it isn't accessible, the user Apache runs as will
not
be able to find and use the files. When you are copying the directory
you are possibly giving it read access for others in the process and
that is why it works then.

Graham

Yup, that's the problem. Just got to figure out OSX's permissions, now.

Thank you!

J
Oct 25 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

28 posts views Thread by Erik Johnson | last post: by
7 posts views Thread by Ben Finney | last post: by
852 posts views Thread by Mark Tarver | last post: by
113 posts views Thread by John Nagle | last post: by
70 posts views Thread by TheFlyingDutchman | last post: by
29 posts views Thread by Carl Banks | last post: by
8 posts views Thread by Lie | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by Teichintx | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.