Setting permissions for wordpress

Everyone experiencing this issue should execute these commands:

sudo usermod -aG www-data $USER

Adds the currently logged in user to the www-data group.

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

Changes the ownership of the /var/www directory to www-data group.

sudo chmod -R 755 /var/www

If this doesn’t fix the issue you’re having, you’ve got something else wrong and bashing DO is not going to help anyone. If you want a managed server, look for hosting elsewhere. If you need help, ask someone or hire an admin that knows how to not only ‘set things up’ but knows how to secure your server as well. You’ll be glad you did. DO is not for novices, even if they have a lot of tutorials.

Upgrade the distribution

Apt is a monster of a tool. It can help you stay right on the cutting edge with little or no effort on your part.

Let’s say, for example, you’ve had an Ubuntu installation running for a while, but you want to install the latest version of the OS. You need to do a full backup, burn a new disc, sit through a reinstallation process and cross your fingers, right? Wrong.

Type

sudo apt-get distupgrade

to bring your installed distro in line with current standards automatically.

Perform package upgrades

The next step is to turn your installed packages into the shiny new versions, which you can do using a slightly different command in the terminal window:

sudo apt-get upgrade 

Insert it (remembering to prefix it with sudo, which tells Ubuntu to perform the action as a super user) and apt-get will hammer through the list, marking and installing any packages that have fallen behind the times.

Manually update packages

The auto-updater isn’t the only way to get your system up to speed. The package manager – which deals with downloading, installing and configuring new programs – might need a little kick, however.

Open a terminal window (select it from the menu, or hit [Alt]+[F2] and type gnome-terminal), then type

sudo apt-get update

to ensure that Ubuntu’s knowledge of packages is up to date.

How to Stop WordPress Asking for FTP details to Upgrade Plugins

There are a couple of ways to get rid of the FTP Connection Information form.

The first method will likely only work if you have your own dedicated or private server with root ssh access.

For 99.9% of shared hosting, you are unlikely to have the privileges required to muck around with the web server settings and that is what’s needed.  If this is you, jump to the quick fix.

For this first method, we’re going to find out which user owns the web server and give that user ownership of your WordPress installation.

We’re assuming you’ve got a Linux box running Apache as the web server as that’s the most popular hosting plan type.

Login to your server box using ssh.

Find out what user is running the web server by typing:

ps aux | grep ‘apache’

The command will return something similar to this:

root@ubuntu-box:/# ps aux | grep ‘apache’
root 1933 0.0 2.3 44900 12032 ? Ss Aug25 15:09 /usr/sbin/apache2 -k start
webuser 2572 0.0 6.2 66468 30246 ? S Mar10 0:04 /usr/sbin/apache2 -k start
webuser 6045 0.0 6.4 66884 31562 ? S Mar10 0:07 /usr/sbin/apache2 -k start
webuser 6786 0.0 5.6 64156 27632 ? S Mar10 0:10 /usr/sbin/apache2 -k start

This tells you that the web server is running under the user webuser.

You can now give that user recursive ownership (all subfolders) of your WordPress installation using the command:

chown -hR webuser:webuser /var/mydomain.com/public_html/wordpress/
sudo chown -R www-data:username /var/www

Replacing webuser with whatever user is running your Apache server and the last part with the direct path to your root WordPress installation folder.

Note: Some chown versions are different.  Type chown –help to get info on your version.

The Quick Fix

Ok, so you’re on a typical shared hosting plan and just want this damned FTP Connection Information form to go away.

Here’s what to do.

Edit your wp-config.php file (found in the root of the WordPress installation) and add the following lines somewhere in between the start :
[pre]/** Setup FTP Details **/
define(“FTP_HOST”, “localhost”);
define(“FTP_USER”, “your-ftp-username”);
define(“FTP_PASS”, “your-ftp-password”);[/pre]
Replacing the values with whatever you use on the FTP Connection Information form.

Once saved and uploaded if making the changed from a local copy, you should no longer be prompted for FTP Connection Information.