June 27th, 2013

Simplified FTP/SFTP Management of WordPress, Joomla, and other CMS-based web sites

Most modern content management systems (CMS) for web sites, like WordPress, Joomla, Drupal, etc., are PHP-based.  So, when these sites are run by the web server, they generally run with as the web server server for maximum speed/performance.*

This is all well and good, and LuxSci supports easily bulk assigning ownership of your site files to the “web server” so that these content management systems, running as the web server, can upload new files, modify files in your web site file space, etc.

It all works well and easily …. until you want to also manage these files via FTP or SFTP.  In general, when one uses FTP or SFTP to connect, your session is owned by the user that you are logging into FTP or SFTP with … and that is not the “web server”. This causes problems:

  1. Files and directories created by you via FTP/SFTP might not be readable by the web server unless you remember to assign very relaxed file permissions.
  2. You might not have permission to edit or delete or read files uploaded/managed by the web server if the permissions restrict such access to the web server user.
  3. You might find it hard to upload new versions of the software, plugins, or themes due to similar issues — and if you do upload them, you might forget to set file/directory permissions such that the web server can use them appropriately.

In short — mixed management of files by FTP/SFTP users and the web server PHP scripts can be done, but it is guaranteed to cause frustration.

A new breed of FTP/SFTP login

LuxSci has implemented a simple and clean solution that makes management of such web sites by FTP/SFTP a breeze — no permissions problems, no ownership problems, no extra work to “get things right”.

The solution is really quite simple, every FTP/SFTP user now has a new, alternate login username.  When you login with this user, you will be connected “as the web server”.  E.g. all file opterations like read, write, upload, delete, etc., are performed as the “web server” user.  This makes all of these operations automatically consistent with and compatible with all operations performed by your PHP-based CMS software.

How it works:

If your regular login username is, for example, “webmaster@doctor.com”, then using this as your login for FTP or SFTP will continue to work as it always has .. once connected, all operations will be done as the user “webmaster@doctor.com”.   Nothing has changed with the status quo.

However, you can now also login to FTP/SFTP as “webmaster@doctor.com/web” (see the “/web”suffix … just add that to your regular FTP/SFTP username to get your new alternate login username):

  1. Login as “webmaster@doctor.com/web” (use the “/web” username appropriate for your account
  2. Use the same password you normally use
  3. Once connected, you are accessing your file space with the as “the web server”

So — there is nothing to configure or set up; simply change the login username in your FTP or SFTP program.

Recommended Site Configuration

When using a PHP-based web site that will access the file system (e.g. any modern CMS), we recommend:

  1. Upload the site software per its instructions
  2. Use the LuxSci File Manager to change the ownership of your “www” directory (the site root) to “Web Server”.
    1. Go to the File Manager
    2. Click on the directory for your web site (to navigate into it)
    3. Check the ckeckbox next to “www” (and “www-ssl” if you use that)
    4. Click on the “Ownership” tab under the file list
    5. Check “Change ownership to the Web Server” and “Make changes recursively”.
    6. Press “Assign ownership”.
  3. The site should run fine and have full access to upload/download/edit/delete its own files in your local file space there.  These will be all owned by “web server” going forward
  4. If you need to manage your files using FTP or SFTP, login using your “/web”-suffixed username so that you manage these files in a way that is consistent with your web site.


* There are other ways to work around this ownership conflict

  1. Running PHP as a CGI script and having those run as your user will work, but will cause your site to be very much slower.  This does work with LuxSci, but is not recommended due to poor performance of PHP in CGI.
  2. You could do #1 but in a FastCGI context.  However, this is slower than “mod_php” (e.g. the standard PHP compiled into the web server).  Also, FastCGI is not currently supported at LuxSci.


Leave a Comment

You must be connected or logged in to post a comment. This is to reduce spam comments.

If you have not previously commented, you can connect using existing social media account, or register with a new username and password.