ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> python-list
python-list
Serious Privileges Problem: Please Help
by Victor Subervi other posts by this author
Nov 7 2009 6:15AM messages near this date
Re: Program to compute and print 1000th prime number | Re: Serious Privileges Problem: Please Help
I have a serious privileges problem that is making it impossible to serve
python pages on a CentOS server. It appears that nobody on the CentOS
discussion list has a solution to this problem. I'm desperate and hoping
someone on this list can help.

[Fri Nov 06 11:50:40 2009] [error] [client 66.248.168.98] (2)No such file or
directory: exec of '/var/www/html/angrynates.com/global_solutions/index.py'
failed, referer: http://angrynates.com/global_solutions/
[Fri Nov 06 11:50:40 2009] [error] [client 66.248.168.98] Premature end of
script headers: index.py, referer: http://angrynates.com/global_solutions/

Now, the file does exist:

[root@13gems global_solutions]# pwd
/var/www/html/angrynates.com/global_solutions
[root@13gems global_solutions]# ls
....
-rwxr-xr-x 1 victor victor 275 Nov 6 07:05 index.py
....
and it serves just fine on another server, so there is no "premature end of
script headers".


Here's where it gets really weird. If I copy the code for index.py and
template.py which the former calls, and create files test.py and test2.py
and paste the code from the former files in those new files changing only
the import statement from "template" to "test2", the tests will resolve!!
Now, the ownership and mode are identical on all of them!!


[root@13gems global_solutions]# ls -al | grep test.py
-rwxr-xr-x 1 root root 298 Nov 6 12:24 test.py
[root@13gems global_solutions]# ls -al | grep test2.py
-rwxr-xr-x 1 root root 5716 Nov 6 12:25 test2.py
[root@13gems global_solutions]# ls -al | grep index.py
-rwxr-xr-x 1 root root 316 Nov 6 07:05 index.py
[root@13gems global_solutions]# ls -al | grep template.py
-rwxr-xr-x 1 root root 5806 Nov 6 07:06 template.py
-rwxr-xr-x 1 root root 6093 Nov 6 07:06 template.pyc

where test.py is identical to index.py (other than the necessary import) and
template is identical to test2.py


fixfiles relabel /var/www/html
# might just work
It didn't

touch /.autorelabel
# and then reboot will relabel all copied files to the correct contexts for
the location
I rebooted apache with no luck

or you could turn off SELinux and reboot
I did that and the following two solutions with no luck:
echo 0 > /selinux/enforce

[root@13gems ~]# cd /etc/
[root@13gems etc]# mv selinux/ selinux.BAK
[root@13gems etc]# mkdir selinux
[root@13gems etc]# echo 0> /selinux/enforce

...and the problem continues:
[root@13gems etc]# tail /var/log/httpd/error_log
[Fri Nov 06 12:51:49 2009] [error] [client 66.248.168.98] Premature end of
script headers: index.py, referer: http://angrynates.com/global_solutions/
[Fri Nov 06 12:56:18 2009] [error] [client 66.248.168.98] (2)No such file or
directory: exec of '/var/www/html/angrynates.com/global_solutions/index.py'
failed, referer: http://angrynates.com/global_solutions/
[Fri Nov 06 12:56:18 2009] [error] [client 66.248.168.98] Premature end of
script headers: index.py, referer: http://angrynates.com/global_solutions/
[Fri Nov 06 12:56:20 2009] [error] [client 67.96.172.81] (2)No such file or
directory: exec of '/var/www/html/angrynates.com/global_solutions/index.py'
failed
[Fri Nov 06 12:56:20 2009] [error] [client 67.96.172.81] Premature end of
script headers: index.py
[Fri Nov 06 13:52:15 2009] [error] [client 66.249.67.153] File does not
exist: /var/www/html/angrynates.com/robots.txt
[Fri Nov 06 13:52:52 2009] [error] [client 208.84.198.58] (2)No such file or
directory: exec of '/var/www/html/angrynates.com/global_solutions/index.py'
failed, referer: http://angrynates.com/global_solutions/
[Fri Nov 06 13:52:52 2009] [error] [client 208.84.198.58] Premature end of
script headers: index.py, referer: http://angrynates.com/global_solutions/
[Fri Nov 06 13:52:52 2009] [error] [client 208.84.198.58] File does not
exist: /var/www/html/angrynates.com/favicon.ico
[Fri Nov 06 13:52:53 2009] [error] [client 208.84.198.58] File does not
exist: /var/www/html/angrynates.com/favicon.ico
[root@13gems etc]#

Please help.
Victor
Thread:
Victor Subervi
Rami Chowdhury
Scott David Daniels
Victor Subervi
Dave Angel
Victor Subervi
Rami Chowdhury
Victor Subervi
Victor Subervi
Rami Chowdhury
Victor Subervi
Rami Chowdhury
Victor Subervi
Rami Chowdhury
Simon Forman
Victor Subervi
Rami Chowdhury
Victor Subervi
Rami Chowdhury

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved