Dan Sissors's picture

I've installed the TurnkeyLamp appliance in a virtual machine (VirtualBox) and then installed a fresh wordpress (using wget http://wordpress.org/latest.zip). This runs fine. I can log in from a windows machine using winscp (sftp client) and puTTy (console) as well as the Shell in a box, etc.

However, the wordpress autmatic update feature does not work. It gets hung up with a "Failed to connect FTP Server ..." message after asking for hostname, ftp username and ftp password. I entered the server username (root) and password but this would not run for either FTP or FTPS (the two wordpress autoupdate options).

I also tried installing the Wordpress appliance. It too ran and this did auto updates without problem. But after installing a second instance of wordpress in a subfolder from the document root the 2nd wordpress had the same problem as above. That is, it ran wordpress fine, but plugins, themes, etc could not be updated using the wordpress built-in auto update feature.

How do I configure these appliances to use the server FTP for auto updates within wordpress - FTPS obviously preferred - but this isn't a production environment. I'd settle for anything that worked.

Forum: 
Jeremy Davis's picture

But I have no idea what FTP client is used or how it is configured. I do recall reading about someone having this issue ages ago. Obviously the devs fixed it but AFAIK the fix wasn't actually documented.

I'd assume that there is some sort of commandline FTP client installed on the WordPress appliance to facilitate the update mechanism. I suspect that it isn't even installed on LAMP (or at least not configured at all) and on the WP appliance is configured to only allow (the default) WP install to use it.

That is all pure speculation and doesn't actually get you any closer to getting it to work so I'm not actually much help... Sorry.

[update] Just having a look online and perhaps its a permission issue? Have a read here. Make sure the files are owned by 'www-data'.

Dan Sissors's picture

Although I was aware that www-data was the owner of apache web files on Ubuntu, somehow I presumed Turnkey had configured appache differently - but did not check until your suggestion. That was it. Once the web page owners was changed the auto update in Wordpress worked on both the Wordpress appliance and on the LAMP vm. Thanks.

Jeremy Davis's picture

Glad you got it sorted.

Kevin Cann's picture

I did the exact same thing to resolve it.. also noticed that my file permissions were a littly woncked up.

I found this link on wordpress useful:

 

http://codex.wordpress.org/Hardening_WordPress

 

In particular this was awesome:

 

Changing file permissions

If you have shell access to your server, you can change file permissions recursively with the following command:

For Directories:

find /path/to/your/wordpress/install/ -type d -exec chmod 755 {} \;

For Files:

find /path/to/your/wordpress/install/ -type f -exec chmod 644 {} \;

You sure can't do something that smooth in windows! 20 years of windows admin, and now I
can't stand it any more.

 

 

Regarding Automatic Updates

When you tell WordPress to perform an automatic update, all file operations are performed as the user that owns the files, not as the web server's user. All files are set to 0644 and all directories are set to 0755, and writable by only the user and readable by everyone else, including the web server.

Kevin Cann

Add new comment