Monday, September 04, 2006

Access denied with SELinux plus apache

There were no explanation. I was going crazy. I put an image via ftp in the same directory where I put more images, but when I try to open those image I received an

access denied

So I checked once and once again the file permisssions and the rest ...

When there's no exit I use to let things rest for a few -it depends, few minutes, few days- and come back again on it later

After a search I found this note about how SELinux denies access to some application to do something on a file and how restore context to that file.

In fact, by followinf those steps I get this, first a file with their right context in SELinux policy:
[root@porta ~]$ ls -alZ /var/www/html/beta/images/random1.jpg
-rw-r--r-- pere pere user_u:object_r:httpd_sys_content_t /var/www/html/ beta/images/random1.jpg

Now a file that doesn't have their conext properly setted [root@porta ~]$ ls -alZ /var/www/html/beta/images/ayvbg45.jpg
-rw-r--r-- pere pere root:object_r:file_t /var/www/html/bet a/images/ayvbg45.jpg

And finally how to set context properly to that file (you have to be root): restorecon -v /var/www/html/beta/images/ayvbg45.jpg

Textpatterm, it's my fault

I was trying a Textpatter installation on my notebook, uncompress files, install all the stuff, ... evrything runs pretty smooth. But when I point my browser to installation pages I allways get the same error page.

Fatal error: Call to undefined function ...

Ok, my forst though was what the hell! they all are right. Sure that wordpress it's easier but to honour the truth it was my fault. Just a simple search takes me to article about Fatal error: Call to undefined variable in Textpattern.

This article plus a depper read inside Textpattern support forums makes me return on my own steps... son I'm gonna try it again ... carefully