• Resolved Lee

    (@junior)


    I just installed WordPress on a Ubuntu server and its running great! Unfortunately, it appears that my permissions are not setup correctly as I am having issues with plugins working properly.

    I have followed the guide here and it recommends I make the permissions a little less restrictive in order to update the WordPress install. It suggests I run the command:

    sudo chown -R www-data /var/www/html

    If I do that, everything works as it should but now I can’t browse my files through FTP as I am not longer the owner. If I run

    sudo chown -R MYUSERNAME /var/www/html

    then I can browser the files but now my plugins don’t work right (can’t install or delete them).

    My permissions were set based on the “Hardening Guide” by WordPress:

    folders
    find /path/to/your/wordpress/install/ -type d -exec chmod 750 {} \;
    and files
    find /path/to/your/wordpress/install/ -type f -exec chmod 640 {} \;

    How can I set permissions in order for everything to work while keeping a secure install?

Viewing 15 replies - 1 through 15 (of 19 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Try

    sudo chown -R www-data:myusername /var/www/html

    then

    sudo find /path/to/your/wordpress/install/ -type d -exec chmod 775 {} \;
    sudo find /path/to/your/wordpress/install/ -type f -exec chmod 664 {} \;
    Thread Starter Lee

    (@junior)

    @sterndata Is the path of my wordpress install of on the second command /var/www/html?

    • This reply was modified 6 years, 2 months ago by Lee.
    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Is that where you installed WordPress?

    Thread Starter Lee

    (@junior)

    @sterndata Unfortunately I am not too sure. Inside the /var/www/html folder, I see wp-content, wp-includes etc. Is this the installation folder?

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Yes,

    Thread Starter Lee

    (@junior)

    @sterndata I believe it has solved my issue. I can now install/delete plugins while being able to browse all folders in my FTP!

    If you don’t mind, I would like to ask you one more question. I was using a plugin that warned me about my schedule tasks not running properly. I installed the WP-Cron Events plugin and sure enough

    There was a problem spawning a call to the WP-Cron system on your site. This means WP-Cron events on your site may not work. The problem was: 
    cURL error 28: Connection timed out after 3000 milliseconds

    How can I remedy this on my Ubuntu server?

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Please install the health check plugin and report back its findings: https://www.ads-software.com/plugins/health-check/

    Thread Starter Lee

    (@junior)

    @sterndata

    WordPress Version	 4.9.8
    
    Plugin Versions	
     Your site has 11 active plugins, and they are all up to date.
    
    PHP Version	 7.0.30-0ubuntu0.16.04.1 - For best performance we recommend using PHP 7.2 or higher.
    
    Database Server version	 5.7.23-0ubuntu0.16.04.1
    
    JSON Extension	 Your PHP install supports JSON.
    
    MySQL utf8mb4 support	 Your MySQL version supports utf8mb4
    
    Communication with www.ads-software.com	 www.ads-software.com is reachable from your server.
    
    HTTPS status	 You are accessing this website using HTTPS.
    
    Secure communication	 Your WordPress install can communicate securely with other services.
    
    Scheduled events	 A scheduled event (wp_privacy_delete_old_export_files) has failed to run. Your site still works, but this may indicate that scheduling posts or automated updates may not work as intended.
    Background updates	
    
     The WP_AUTO_UPDATE_CORE constant is defined and enabled.
     A plugin has prevented updates by disabling wp_version_check().
     No version control systems were detected.
     Your installation of WordPress doesn't require FTP credentials to perform updates.
    
     All of your WordPress files are writable.
     WordPress security and maintenance releases are blocked by define( 'WP_AUTO_UPDATE_CORE', false );.
    Loopback request	 The loopback request to your site failed, this may prevent WP_Cron from working, along with theme and plugin editors.
    Error encountered: (0) cURL error 28: Connection timed out after 10001 milliseconds
    
     Result from testing without any plugins active and a default theme: The loopback request to your site failed, this may prevent WP_Cron from working, along with theme and plugin editors.
    Error encountered: (0) cURL error 28: Connection timed out after 10001 milliseconds

    Edit – Sorry about the formatting.

    • This reply was modified 6 years, 2 months ago by Lee.
    • This reply was modified 6 years, 2 months ago by Lee.
    • This reply was modified 6 years, 2 months ago by Lee.
    • This reply was modified 6 years, 2 months ago by Lee.
    • This reply was modified 6 years, 2 months ago by Steven Stern (sterndata).
    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    So the issue is why your loopback isn’t working.

    What do you get if you do

    curl -v https://example.com > /dev/null

    Why do you have a plugin disabling updates?

    Thread Starter Lee

    (@junior)

    @sterndata I assume to change example.com to my domain? If so, it just hangs there, nothing happens. If I use the command using example.com, it resolves just fine.

    By the way, all of my plugins (except health check) are disabled. I don’t understand why it says a plugin is disabling updates.

    • This reply was modified 6 years, 2 months ago by Lee.
    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Your domain.

    This sounds like an ubuntu setup issue, not a WP issue.

    How did you install WordPress?

    Thread Starter Lee

    (@junior)

    @sterndata I followed this guide https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-with-lamp-on-ubuntu-16-04

    • This reply was modified 6 years, 2 months ago by Lee.
    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    OK, that’s reasonable. Remove the update related define from wp-config.php

    Please provide a link to a page on your site. Thanks.

    Thread Starter Lee

    (@junior)

    @sterndata I did find a line added by my old host (Siteground):

    # Disables all core updates. Added by SiteGround Autoupdate:
    define( 'WP_AUTO_UPDATE_CORE', false );

    I removed it but I still get

    A plugin has prevented updates by disabling wp_version_check()

     The loopback request to your site failed, this may prevent WP_Cron from working, along with theme and plugin editors.
    Error encountered: (0) cURL error 28: Connection timed out after 10001 milliseconds

    My website.

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    leecosta.com points to 24.2.251.228 which points to a comcast address. I presume the server is in your house?*

    That it hangs on loopback points to either an error in your router configuration or a networking configuration on your server, happening outside of wordpress.

    *Not a good idea. If the server is hacked, then it’s sitting inside your firewall where you probably have lots of systems that trust anything going on on your network.

Viewing 15 replies - 1 through 15 (of 19 total)
  • The topic ‘Help with WordPress permissions on Ubuntu’ is closed to new replies.