Re: Wordpress: How To Allow httpd to write to /usr/share/wordpress/wp-content/uploads

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Sep 09, 2009 at 10:53:58PM -0400, Robert L Cochran wrote:
>
> On 09/09/2009 10:37 PM, Robert L Cochran wrote:
>> I installed Wordpress 2.8.3 on Fedora 11 and attempted to upload a  
>> photo to the directory  
>> /usr/share/wordpress/wp-content/uploads/2009/09/, but failed even  
>> though my Wordpress "author" role permits file uploads. Wordpress uses  
>> php for scripting. I suspected that I had set file permissions  
>> incorrectly. Here are the permissions on /usr:

see if this works:

chcon -R -t httpd_sys_content_rw_t /usr/share/wordpress/wp-content/uploads/

>>
>> drwxrwxr-x.  16 root apache  4096 2009-04-12 19:05 usr
>>
>> I ran `setsebool`:
>>
>> [root@deafeng3 /]# setsebool -P allow_httpd_anon_write=1
>> [root@deafeng3 /]# service httpd restart
>> Stopping httpd:                                            [  OK  ]
>> Starting httpd:                                            [  OK  ]
>>
>>
>> I wrote a php script to see if it can move a single file just to  
>> /usr/. Here is the error message that appears in  
>> /var/log/httpd/error_log:
>>
>> [Wed Sep 09 22:25:30 2009] [error] [client 127.0.0.1] PHP Warning:   
>> move_uploaded_file(/usr/Cochran.jpg) [<a  
>> href='function.move-uploaded-file'>function.move-uploaded-file</a>]:  
>> failed to open stream: Permission denied in  
>> /var/www/html/testuploads.php on line 35, referer:  
>> http://localhost/testuploads.php
>> [Wed Sep 09 22:25:30 2009] [error] [client 127.0.0.1] PHP Warning:   
>> move_uploaded_file() [<a  
>> href='function.move-uploaded-file'>function.move-uploaded-file</a>]:  
>> Unable to move '/tmp/phpJFMNbS' to '/usr/Cochran.jpg' in  
>> /var/www/html/testuploads.php on line 35, referer:  
>> http://localhost/testuploads.php
>>
>>
>> But I still can't write to /usr. If I can't write to that, how can I  
>> continue down the file hierarchy to write to the true target directory  
>> of /usr/share/wordpress/wp-content/uploads/*? That is to say, the  
>> uploads directory and every subdirectory under it should be writable  
>> by httpd.
>>
>> Thanks
>>
>> Bob Cochran
>>
>
> I should have added: I am the one who made /usr group-owned by apache  
> and then set the group permissions to rwx. In fact I've done quite a lot  
> of fooling with file permissions in /usr/share/wordpress/*.
>
> Bob
>
> --
> fedora-selinux-list mailing list
> fedora-selinux-list@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/fedora-selinux-list

Attachment: pgpPWKpkDH9o6.pgp
Description: PGP signature

--
fedora-selinux-list mailing list
fedora-selinux-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-selinux-list

[Index of Archives]     [Fedora Users]     [Fedora Desktop]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux