Same server, different domains, different Wordpress behavior

Hello, so I've recently setup this CentOS server for hosting most of my customers' websites.

Two of these sites use Wordpress and something really strange is happening: permissions work differently on the two sites.

On one site, the wp-content folder has permissions set to 755 and everything works fine, for instance media files upload just fine through the WP interface.

On the other site, if I set wp-content permissions to 755 I can't upload media. I have to set them to 775.

So, what else can I check to sort this out? All other files and folders on the two domains have exactly the same permissions, so I guess there's something else I should check out.

Thanks for your help.
Daniele BrunengoIT Consultant, Web DesignerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jan SpringerCommented:
What account is owner of the directory/subdirectories?  Is this a different owner than the account doing the uploading?
0
Daniele BrunengoIT Consultant, Web DesignerAuthor Commented:
The owner is root, in both websites.
0
Jan SpringerCommented:
Can you post the errors from the httpd access and error log?
0
Challenges in Government Cyber Security

Has cyber security been a challenge in your government organization? Are you looking to improve your government's network security? Learn more about how to improve your government organization's security by viewing our on-demand webinar!

Daniele BrunengoIT Consultant, Web DesignerAuthor Commented:
Here are some errors:

error.log
[Sun Apr 12 02:08:24 2015] [error] [client 79.6.192.143] PHP Warning:  require_once(/var/www/html/ilpassaparolaloano/wp-config.php): failed to open stream: Permission denied in /var/www/html/ilpassaparolaloano/wp-load.php on line 29, referer: http://www.ilpassaparolaloano.it/wp-admin/upload.php
[Sun Apr 12 02:08:24 2015] [error] [client 79.6.192.143] PHP Fatal error:  require_once(): Failed opening required '/var/www/html/ilpassaparolaloano/wp-config.php' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/html/ilpassaparolaloano/wp-load.php on line 29, referer: http://www.ilpassaparolaloano.it/wp-admin/upload.php
[Sun Apr 12 02:08:34 2015] [error] [client 79.6.192.143] PHP Warning:  require_once(/var/www/html/ilpassaparolaloano/wp-config.php): failed to open stream: Permission denied in /var/www/html/ilpassaparolaloano/wp-load.php on line 29, referer: http://www.ilpassaparolaloano.it/wp-admin/upload.php
[Sun Apr 12 02:08:34 2015] [error] [client 79.6.192.143] PHP Fatal error:  require_once(): Failed opening required '/var/www/html/ilpassaparolaloano/wp-config.php' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/html/ilpassaparolaloano/wp-load.php on line 29, referer: http://www.ilpassaparolaloano.it/wp-admin/upload.php
[Sun Apr 12 02:08:42 2015] [error] [client 79.6.192.143] PHP Warning:  require_once(/var/www/html/ilpassaparolaloano/wp-config.php): failed to open stream: Permission denied in /var/www/html/ilpassaparolaloano/wp-load.php on line 29, referer: http://www.ilpassaparolaloano.it/wp-admin/upload.php
[Sun Apr 12 02:08:42 2015] [error] [client 79.6.192.143] PHP Fatal error:  require_once(): Failed opening required '/var/www/html/ilpassaparolaloano/wp-config.php' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/html/ilpassaparolaloano/wp-load.php on line 29, referer: http://www.ilpassaparolaloano.it/wp-admin/upload.php
[Sun Apr 12 02:08:51 2015] [error] [client 79.6.192.143] PHP Warning:  require_once(/var/www/html/ilpassaparolaloano/wp-config.php): failed to open stream: Permission denied in /var/www/html/ilpassaparolaloano/wp-load.php on line 29
[Sun Apr 12 02:08:51 2015] [error] [client 79.6.192.143] PHP Fatal error:  require_once(): Failed opening required '/var/www/html/ilpassaparolaloano/wp-config.php' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/html/ilpassaparolaloano/wp-load.php on line 29
[Sun Apr 12 02:08:57 2015] [error] [client 79.6.192.143] PHP Warning:  require_once(/var/www/html/ilpassaparolaloano/wp-config.php): failed to open stream: Permission denied in /var/www/html/ilpassaparolaloano/wp-load.php on line 29
[Sun Apr 12 02:08:57 2015] [error] [client 79.6.192.143] PHP Fatal error:  require_once(): Failed opening required '/var/www/html/ilpassaparolaloano/wp-config.php' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/html/ilpassaparolaloano/wp-load.php on line 29
[Sun Apr 12 02:08:58 2015] [error] [client 79.6.192.143] PHP Warning:  require_once(/var/www/html/ilpassaparolaloano/wp-config.php): failed to open stream: Permission denied in /var/www/html/ilpassaparolaloano/wp-load.php on line 29
[Sun Apr 12 02:08:58 2015] [error] [client 79.6.192.143] PHP Fatal error:  require_once(): Failed opening required '/var/www/html/ilpassaparolaloano/wp-config.php' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/html/ilpassaparolaloano/wp-load.php on line 29
[Sun Apr 12 02:09:03 2015] [error] [client 79.6.192.143] PHP Warning:  require_once(/var/www/html/ilpassaparolaloano/wp-config.php): failed to open stream: Permission denied in /var/www/html/ilpassaparolaloano/wp-load.php on line 29
[Sun Apr 12 02:09:03 2015] [error] [client 79.6.192.143] PHP Fatal error:  require_once(): Failed opening required '/var/www/html/ilpassaparolaloano/wp-config.php' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/html/ilpassaparolaloano/wp-load.php on line 29

Open in new window

0
Jan SpringerCommented:
there is no upload information in these logs.  are you using sftp or ftp?
0
Daniele BrunengoIT Consultant, Web DesignerAuthor Commented:
When uploading media there's no request for sftp or ftp, only when installing plugins. Ftp is disabled on the server, I use ssh for installing plugins. But when I upload media on the first server there's no error. When I upload them on the second server I always get errors unless I give 775 permissions.
0
Jan SpringerCommented:
do you know how the upload is done?  there should be some log that contains the error identifying the problem.
0
Daniele BrunengoIT Consultant, Web DesignerAuthor Commented:
I think I've nailed it. I think I've found the correct settings:
Owner: root
Group: apache

If I set it like this I can then use 755 on the uploads folder and it works. I can also set more restrictive permissions on other files and folders, and it still seems to work. I'll test it out on my other WP sites and report back. If it's consistent I may write a tutorial about this, since what you find online about this matter is often contradictory or confusing.
0
Jan SpringerCommented:
755 means:

7 owner can read, write, execute
5 group can read, execute
5 world can read, execute

So if you've changed the group, then you have two data points:  the permission structure was not identical and apache does not have write permission even if it's set to be the group owner.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Daniele BrunengoIT Consultant, Web DesignerAuthor Commented:
Ok. I don't understand why it works with 755 now then. Before setting the group to Apache, it would only work with 775.
0
Jan SpringerCommented:
Yes, it is illogical that changing the group fixed the problem unless it corrected a subdirectory that only had 750 and needed that group changed.
0
Daniele BrunengoIT Consultant, Web DesignerAuthor Commented:
Setting the Group and User to Apache seems to be the solution. I have no more folders with permission higher than 755 now.
0
Daniele BrunengoIT Consultant, Web DesignerAuthor Commented:
The expert helped me and I came up with a solution.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
WordPress

From novice to tech pro — start learning today.