restorecon didn't change ls -lZ output<div>Can you give me the exact command for chcon? It complains there are too few arguments, and I couldn't figure it out.</div><div>Does this really matter? I moved the selinux folder and its contents as well as sent an "echo 0>..." command to kill it. Furthermore, </div>
<div><div>[root@13gems global_solutions]# ps wax|grep selinux</div><div>17645 pts/0 S+ 0:00 grep selinux</div><div>Please advise.</div><div>V</div><br><div class="gmail_quote">On Sat, Nov 7, 2009 at 5:49 PM, Rami Chowdhury <span dir="ltr"><<a href="mailto:rami.chowdhury@gmail.com">rami.chowdhury@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im"><br>
On Saturday 07 November 2009 13:51:06 Victor Subervi wrote:<br>
> httpd.conf:<br>
><br>
> <VirtualHost *:80><br>
> ServerAdmin <a href="mailto:me@creative.vi">me@creative.vi</a><br>
> DocumentRoot /var/www/html/<a href="http://angrynates.com" target="_blank">angrynates.com</a><br>
> ServerName <a href="http://angrynates.com" target="_blank">angrynates.com</a><br>
> Options +ExecCGI -IncludesNoExec<br>
> <Directory /var/www/html/<a href="http://angrynates.com/global_solutions/*" target="_blank">angrynates.com/global_solutions/*</a>><br>
<br>
</div>You may want to change this to:<br>
<div class="im"> <Directory /var/www/html/<a href="http://angrynates.com/global_solutions" target="_blank">angrynates.com/global_solutions</a>><br>
<br>
</div>If you want regular expression syntax, I would advise using the syntax<br>
<Directory ~ EXPRESSION><br>
or<br>
<DirectoryMatch ~ EXPRESSION><br>
<div class="im"><br>
> #ls -lZ<br>
> drwxr-xr-x root root 1024<br>
> drwxr-xr-x root root 1132<br>
> drwxr-xr-x root root 1255<br>
</div>[snip]<br>
<br>
It looks like you don't have *any* SELinux context information; if SELinux is<br>
on, this will cause problems. Try using the 'restorecon' command to put the<br>
defaults in place, and consider using 'chcon' to change the security context<br>
to an appropriate one (I believe you want something like<br>
'unconfined_u:object_r:httpd_sys_content_t' for Apache content).<br>
<div><div></div><div class="h5"><br>
><br>
> On Sat, Nov 7, 2009 at 4:09 PM, Rami Chowdhury<br>
<<a href="mailto:rami.chowdhury@gmail.com">rami.chowdhury@gmail.com</a>>wrote:<br>
> > On Saturday 07 November 2009 06:13:11 Victor Subervi wrote:<br>
> > > I have a serious privileges problem that is making it impossible to<br>
> > > serve python pages on a CentOS server. It appears that nobody on the<br>
> > > CentOS discussion list has a solution to this problem. I'm desperate<br>
> > > and hoping someone on this list can help.<br>
> > ><br>
> > > [Fri Nov 06 11:50:40 2009] [error] [client 66.248.168.98] (2)No such<br>
> > > file or directory: exec of<br>
> > > '/var/www/html/<a href="http://angrynates.com/global_solutions/index.py" target="_blank">angrynates.com/global_solutions/index.py</a>' failed,<br>
> ><br>
> > referer:<br>
> > > <a href="http://angrynates.com/global_solutions/" target="_blank">http://angrynates.com/global_solutions/</a><br>
> > > [Fri Nov 06 11:50:40 2009] [error] [client 66.248.168.98] Premature end<br>
> ><br>
> > of<br>
> ><br>
> > > script headers: index.py, referer:<br>
> ><br>
> > <a href="http://angrynates.com/global_solutions/" target="_blank">http://angrynates.com/global_solutions/</a><br>
> ><br>
> > > Now, the file does exist:<br>
> > ><br>
> > > [root@13gems global_solutions]# pwd<br>
> > > /var/www/html/<a href="http://angrynates.com/global_solutions" target="_blank">angrynates.com/global_solutions</a><br>
> > > [root@13gems global_solutions]# ls<br>
> > > ....<br>
> > > -rwxr-xr-x 1 victor victor 275 Nov 6 07:05 index.py<br>
> > > ....<br>
> > > and it serves just fine on another server, so there is no "premature<br>
> > > end<br>
> ><br>
> > of<br>
> ><br>
> > > script headers".<br>
> > ><br>
> > ><br>
> > > Here's where it gets really weird. If I copy the code for index.py and<br>
> > > template.py which the former calls, and create files test.py and<br>
> > > test2.py and paste the code from the former files in those new files<br>
> > > changing only the import statement from "template" to "test2", the<br>
> > > tests will resolve!! Now, the ownership and mode are identical on all<br>
> > > of them!!<br>
> > ><br>
> > ><br>
> > > [root@13gems global_solutions]# ls -al | grep test.py<br>
> > > -rwxr-xr-x 1 root root 298 Nov 6 12:24 test.py<br>
> > > [root@13gems global_solutions]# ls -al | grep test2.py<br>
> > > -rwxr-xr-x 1 root root 5716 Nov 6 12:25 test2.py<br>
> > > [root@13gems global_solutions]# ls -al | grep index.py<br>
> > > -rwxr-xr-x 1 root root 316 Nov 6 07:05 index.py<br>
> > > [root@13gems global_solutions]# ls -al | grep template.py<br>
> > > -rwxr-xr-x 1 root root 5806 Nov 6 07:06 template.py<br>
> > > -rwxr-xr-x 1 root root 6093 Nov 6 07:06 template.pyc<br>
> > ><br>
> > > where test.py is identical to index.py (other than the necessary<br>
> > > import) and template is identical to test2.py<br>
> > ><br>
> > ><br>
> > > fixfiles relabel /var/www/html<br>
> > > # might just work<br>
> > > It didn't<br>
> > ><br>
> > > touch /.autorelabel<br>
> > > # and then reboot will relabel all copied files to the correct contexts<br>
> ><br>
> > for<br>
> ><br>
> > > the location<br>
> > > I rebooted apache with no luck<br>
> > ><br>
> > > or you could turn off SELinux and reboot<br>
> > > I did that and the following two solutions with no luck:<br>
> > > echo 0 >/selinux/enforce<br>
> > ><br>
> > > [root@13gems ~]# cd /etc/<br>
> > > [root@13gems etc]# mv selinux/ selinux.BAK<br>
> > > [root@13gems etc]# mkdir selinux<br>
> > > [root@13gems etc]# echo 0>/selinux/enforce<br>
> > ><br>
> > > ...and the problem continues:<br>
> > > [root@13gems etc]# tail /var/log/httpd/error_log<br>
> > > [Fri Nov 06 12:51:49 2009] [error] [client 66.248.168.98] Premature end<br>
> ><br>
> > of<br>
> ><br>
> > > script headers: index.py, referer:<br>
> ><br>
> > <a href="http://angrynates.com/global_solutions/" target="_blank">http://angrynates.com/global_solutions/</a><br>
> ><br>
> > > [Fri Nov 06 12:56:18 2009] [error] [client 66.248.168.98] (2)No such<br>
> > > file or directory: exec of<br>
> > > '/var/www/html/<a href="http://angrynates.com/global_solutions/index.py" target="_blank">angrynates.com/global_solutions/index.py</a>' failed,<br>
> ><br>
> > referer:<br>
> > > <a href="http://angrynates.com/global_solutions/" target="_blank">http://angrynates.com/global_solutions/</a><br>
> > > [Fri Nov 06 12:56:18 2009] [error] [client 66.248.168.98] Premature end<br>
> ><br>
> > of<br>
> ><br>
> > > script headers: index.py, referer:<br>
> ><br>
> > <a href="http://angrynates.com/global_solutions/" target="_blank">http://angrynates.com/global_solutions/</a><br>
> ><br>
> > > [Fri Nov 06 12:56:20 2009] [error] [client 67.96.172.81] (2)No such<br>
> > > file<br>
> ><br>
> > or<br>
> ><br>
> > > directory: exec of '/var/www/html/<br>
> ><br>
> > <a href="http://angrynates.com/global_solutions/index.py" target="_blank">angrynates.com/global_solutions/index.py</a>'<br>
> ><br>
> > > failed<br>
> > > [Fri Nov 06 12:56:20 2009] [error] [client 67.96.172.81] Premature end<br>
> > > of script headers: index.py<br>
> > > [Fri Nov 06 13:52:15 2009] [error] [client 66.249.67.153] File does not<br>
> > > exist: /var/www/html/<a href="http://angrynates.com/robots.txt" target="_blank">angrynates.com/robots.txt</a><br>
> > > [Fri Nov 06 13:52:52 2009] [error] [client 208.84.198.58] (2)No such<br>
> > > file or directory: exec of<br>
> > > '/var/www/html/<a href="http://angrynates.com/global_solutions/index.py" target="_blank">angrynates.com/global_solutions/index.py</a>' failed,<br>
> ><br>
> > referer:<br>
> > > <a href="http://angrynates.com/global_solutions/" target="_blank">http://angrynates.com/global_solutions/</a><br>
> > > [Fri Nov 06 13:52:52 2009] [error] [client 208.84.198.58] Premature end<br>
> ><br>
> > of<br>
> ><br>
> > > script headers: index.py, referer:<br>
> ><br>
> > <a href="http://angrynates.com/global_solutions/" target="_blank">http://angrynates.com/global_solutions/</a><br>
> ><br>
> > > [Fri Nov 06 13:52:52 2009] [error] [client 208.84.198.58] File does not<br>
> > > exist: /var/www/html/<a href="http://angrynates.com/favicon.ico" target="_blank">angrynates.com/favicon.ico</a><br>
> > > [Fri Nov 06 13:52:53 2009] [error] [client 208.84.198.58] File does not<br>
> > > exist: /var/www/html/<a href="http://angrynates.com/favicon.ico" target="_blank">angrynates.com/favicon.ico</a><br>
> > > [root@13gems etc]#<br>
> > ><br>
> > > Please help.<br>
> > > Victor<br>
> ><br>
> > Can we see the output of 'ls -lZ' and 'fixfiles check' on those<br>
> > directories,<br>
> > and see what the Apache (httpd.conf or .htaccess) configuration is for<br>
> > them?<br>
> ><br>
> > ----<br>
> > Rami Chowdhury<br>
> > "Passion is inversely proportional to the amount of real information<br>
> > available." -- Benford's Law of Controversy<br>
> > 408-597-7068 (US) / 07875-841-046 (UK) / 0189-245544 (BD)<br>
><br>
<br>
<br>
</div></div>----<br>
<font color="#888888">Rami Chowdhury<br>
"Strangers are just friends who haven't had enough gin." -- Howdle's Saying<br>
</font><div><div></div><div class="h5">408-597-7068 (US) / 07875-841-046 (UK) / 0189-245544 (BD)<br>
</div></div></blockquote></div><br></div>