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:
- 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.
- 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.
- 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, “firstname.lastname@example.org”, 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 “email@example.com”. Nothing has changed with the status quo.
However, you can now also login to FTP/SFTP as “firstname.lastname@example.org/web” (see the “/web”suffix … just add that to your regular FTP/SFTP username to get your new alternate login username):
- Login as “email@example.com/web” (use the “/web” username appropriate for your account
- Use the same password you normally use
- 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:
- Upload the site software per its instructions
- Use the LuxSci File Manager to change the ownership of your “www” directory (the site root) to “Web Server”.
- Go to the File Manager
- Click on the directory for your web site (to navigate into it)
- Check the ckeckbox next to “www” (and “www-ssl” if you use that)
- Click on the “Ownership” tab under the file list
- Check “Change ownership to the Web Server” and “Make changes recursively”.
- Press “Assign ownership”.
- 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
- 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
- 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.
- 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.