Category: Plesk Toggle Comment Threads | Keyboard Shortcuts

I love Plesk – it’s a work of art that makes my life easier. Rather than a “programme” as such, it’s a web interface that takes control of several thousand services on a web server and makes administering domains and hosting a breeze.

Since 2012 I’ve been a certified Parallels Plesk Automation Technician.

  • Jay Versluis 10:16 am on September 19, 2014 Permalink | Reply  
    Categories: Plesk, Screencasts ( 40 )

    How to use the File Manager in Plesk 12 

    In this screencast I’ll show you how to use the File Manager in Plesk 12. It’s a very convenient tool that has largely replaced the need for an external FTP client.

    The File Manager allows you to change files directly on the server via your web browser. I’m explaining the following things:

    • how to upload and download files
    • how to edit them via the integrated text and HTML editors
    • how to make files accessible to others via URLs
    • how to create and extract ZIP files directly on the server
    • and how to change file permissions

    Enjoy!





     
  • Jay Versluis 7:23 pm on September 18, 2014 Permalink | Reply
    Tags: ,   

    Categories: Plesk ( 40 )

    How to create a Plesk Backup from the command line in CentOS 

    Plesk-LogoEven in Plesk 12 we can only schedule a single backup, and we must decide where said backup should be saved: either on the local server, or on an off-site FTP server. Sadly we can’t have it both ways.

    Many of us – me included – find this very limiting.

    Both local and remote backups have their advantages though, and greedy as I am I want the best of both worlds:

    • an FTP backup is stored off-site, which is great for disaster recovery.
    • but a local backup can be create and to restore much faster, which is great for development
    • a local server wide backup creates individual domain backups automatically, whereas an FTP backup does not – great for convenience

    The good news is that Plesk has a set of command line tools which we can use to create a backup manually. In this scenario you can schedule a local backup in the Plesk web interface, and create another one using a cron job.

    The tool I’m talking about is called pleskbackup and it lives in the Plesk utilities directory. On CentOS this is in /usr/local/psa/bin.

    If called without parameters you’ll see a long list of options you can pass to this command:

    Usage: pleskbackup  <command></command> [] 
    
    Commands:
    
      server         Backs up whole Plesk.
    
      resellers-name Backs up selected resellers. Reseller's logins are read from command line,
                     space-separated. If no resellers provided, backs up all resellers
                     on the host.
    
      resellers-id   Backs up selected resellers. Reseller's identificators are read from command line,
                     space-separated. If no resellers provided, backs up all resellers
                     on the host.
    
      clients-name   Backs up selected clients. Client's logins are read from command line,
                     space-separated. If no clients provided, backs up all clients
                     on the host.
    
      clients-id     Backs up selected clients. Client's identificators are read from command line,
                     space-separated. If no clients provided, backs up all clients
                     on the host.
    
      domains-name   Backs up selected domains. Domain's names are read from command line,
                     space-separated. If no domains provided, backs up all domains
                     on the host.
    
      domains-id     Backs up selected domains. Domain's identificators are read from command line,
                     space-separated. If no domains provided, backs up all domains
                     on the host.
    
                     Use Exclude options to exclude some resellers/clients/domains.
    
      help           Shows this help page
    
    ...
    
    Output file option:
      --output-file=
            /fullpath/filename      - regular file,
            -                       - use stdout for output,
    
            [ftp|ftps]://[[:]@]/fullpath/filename - storing the backup to ftp server.
                           FTP_PASSWORD environment variable can be used for setting password.
                           FTP option '--ftp-login' can be used for setting login.
                           FTP option '--ftp-password' (with '--ftp-login') can be used for setting password.
                           If your password contains slash, you have to use '--ftp-password' option or
                           FTP_PASSWORD environment variable.
                           'ftps' protocol can be specified to use FTP over SSL, instead of plain FTP.
                           With ftps specify 990 port to use implicit FTPS, otherwise explicit mode will be used.
    
            Used to import dump from repository into the single file.
    

    Usage Example: Local Backups

    To create a local server-wide backup, all we have to do is this:

    pleskbackup server
    

    This will create a backup just like the Backup Manager would in the Plesk web interface. Those are stored in a variety of files in /var/lib/psa/dumps and also in the respective domains/resellers/customers directories.

    To create a single domain backup, simply replace “server” with “domains-name yourdomain.com” like this:

    pleskbackup domains-name your yourdomain.com
    

    Add more domains on the same line, separated by spaces.

    Usage Example: FTP Backups

    FTP backups are slightly more complex to create. We must pass all our credentials as part of the –output-file parameter, which requires us to specify a file name. Since the tool will create a .tar file, make sure you add this as part of your file name. Let’s look at a full example.

    Imagine we’d like to create a server wide backup, and our FTP credentials are

    – server (FTP Host)
    – user (FTP User Name)
    – password (FTP Password)
    – filename.tar (our backup file name)

    then we can call the command like this:

    pleskbackup server --output-file=ftp://user:password@server/filename.tar
    

    If all goes well you’ll receive no feedback. This is a synchronous task which on larger installations can take several hours – but it should be done within seconds on systems with dummy domains.

    First the tool creates a local backup, then ZIPs up the tarball and sends it to the FTP server. Once finished, the tool comes back to the command line.

    Automatically deleting older backups from FTP

    I love how the Plesk Backup Manager takes care of older backups and deletes them automatically. The pleskbackup command line tool on the other hand isn’t so friendly and instead is a low-level command that only does one thing. If we’d like to see automatic deletions we’ll have to employ a script that will do this for us.

    I’ve written such a script in PHP and put it on GitHub – feel free to examine it, test it, use it, redistribute it:

    To use the script, take a look at the top of the file and amend your details accordingly:

    // add your FTP credentials here
    $ftp_server = "ftpserver";
    $ftp_user = "ftpuser";
    $ftp_password = "password";
    
    // maximum number of backup files to keep on FTP
    $maxbackups = 30;
    
    // add a prefix for your backup
    $prefix = 'BACKUP-'; 
    
    // PLESK utilities directory
    $pleskbin = "/usr/local/psa/bin/";
    

    Save your changes and make sure you add execute permissions to the file:

    chmod +x ./backup.php
    

    Now you can call the file from the command line or via a Cron Job (Scheduled Tasks in Plesk). Execute the script as root and make as many backups as you like – in addition to what Backup Manager is doing from the web interface.

    The one caveat I found is that the pleskbackup tool does not maintain the correct timestamp when it copies the tarball over to the FTP server. It’s an issue with pleskbackup rather than my script – I don’t understand how Backup Manager can do this fine in the web interface, which presumably relies on the same tool.

    As a workaround I’m saving the date as part of the filename, i.e. BACKUP-YYYYMMDD-HHMMSS.tar. For the auto-deletion to work, make sure to use a dedicated directory for your FTP backups with no other files – otherwise the latest backup may be deleted.

    To save your backups in a subfolder, amend the prefix like this:

    // add a prefix for your backup
    $prefix = 'subfolder/BACKUP-'; 
    

    And that’s how we can create Plesk backups from the command line!





     
  • Jay Versluis 4:21 pm on September 16, 2014 Permalink | Reply  
    Categories: Plesk, Screencasts ( 40 )

    How to use File Sharing in Plesk 12 

    In this screencast I’ll show you how to use the File Sharing features in Plesk 12. File Sharing allows you to upload files and give links to others, or let others upload files to the server. You can do this with or without password protection and you can even map folders from your server to your desktop computer – so file sharing can be as easy as drag and drop.

    I’ll show you how to share files via email, how to map folders from Plesk on Mac and on Windows, and how to setup additional users so that you can allow others to upload files and access protected content. I’ll also show you how to share files without protection so they can be embedded easily into newsletters, emails or websites.

    With the right setup you can transform your Plesk server into an unlimited cloud storage system (much like DropBox, Google Drive, One Drive and the plethora of other services out there).

    Plesk uses the WebDAV protocol for file sharing and you can use the principles I’m showing here on any device that supports WebDAV. If you’re interested to do this on iOS, look into Good Reader.

    Let me know if you have any questions.





     
  • Jay Versluis 8:46 am on September 8, 2014 Permalink | Reply  
    Categories: Plesk, Screencasts ( 40 )

    Installing legacy versions of WordPress in Plesk 12 

    In this screencast I will show you how to install an older version of WordPress in Plesk 12. This is useful if you’d like to test drive the WordPress Toolkit on a spare server before going live with its many new features. You can’t use the APS installer for this as it will always install the latest version of WordPress.

    I will explain where to download an older version of WordPress from and how to install it manually by creating a database first and then running the WordPress installer manually. In total I’m installing three WordPress instances in preparation for the WordPress Toolkit (I’ve explained how to use it in the previous video – you can check it out here:

     

    You can find all previous releases of WordPress in the Release Archive:

     





     
  • Jay Versluis 8:41 am on September 1, 2014 Permalink | Reply  
    Categories: Plesk, Screencasts, WordPress ( 40 )

    How to use the WordPress Toolkit in Plesk 12 

    In this screencast I’ll show you how to use the WordPress Toolkit in Plesk 12.

    I’ll demonstrate how to update WordPress Core, Plugins and Themes selectively and across the entire server directly from within Plesk.

    Among many other features I’ll also show you how to secure WordPress instances, install and remove themes, and how to exclude WordPress instances from mass management.

     





     
  • Jay Versluis 8:13 am on August 25, 2014 Permalink | Reply  
    Categories: Plesk, Screencasts ( 40 )

    Managing Email Accounts in Plesk 12 

    In this screencast I’ll explain how to setup Email Accounts in Plesk 12. I will show you how to setup mailboxes, use forwarding and create aliases. I’ll also show you the Spam Filter and Auto Responder.

    This all happens in Plesk, there’s another video which will show you how to check email from an external client and via webmail.





     
  • Jay Versluis 7:01 am on August 18, 2014 Permalink | Reply
    Tags: Health Monitor   

    Categories: Plesk, Screencasts ( 40 )

    How to adjust Health Monitor Alarms in Plesk 

    In this screencast I’ll show you how to adjust the Health Monitor thresholds. Those are the ones that tell Health Monitor when to send an email and when to display a “Needs Attention” or “Problem” message.

    Health Monitor works with XML configuration files which can easily be changed to suit your needs.

    In this example, one of my servers has seen an increase in Apache CPU usage and has been bombarding me with emails because the “Problem” threshold is set to trigger at 25%. After investigating the issue I’ve increased this value to 95% and now I can sleep a little easier.





     
  • Jay Versluis 7:32 am on August 11, 2014 Permalink | Reply
    Tags:   

    Categories: Plesk, Screencasts ( 40 )

    How to upgrade from Plesk 11.5 to Plesk 12 on CentOS 

    In this screencast I’m showing you how to upgrade from an older version to Plesk 12. Specifically, I’m showing this with a Plesk 11.5 installation, but the principles still apply from Plesk 10.x onwards.

    Plesk 12 comes in four flavours, and depending on the previous license you’ve held you’ll be upgraded to one of the new types – check them out here:





     
  • Jay Versluis 12:16 pm on April 16, 2014 Permalink | Reply  
    Categories: Plesk ( 40 )

    How to find out which user ID belongs to which domain in Plesk 

    Plesk-LogoThe other day I found that one of the domains on a busy server was sending unsolicited spam mail thousands of times a day. It happens: the nature of open source scripts is that they will get hacked if they’re not updated regularly.

    The clue was a full-up mail queue and Gmail no longer accepting mails from the IP in question.

    When I examined one of the spam mails I found a line like this:

    X-PHP-Originating-Script: 10040:listr3b.php

    Good to know the spam was sent from a PHP script… but from which domain? All we have here is the user ID of the domain in question (10040) but that doesn’t mean much to the average human administrator.

    Here’s how to translate that Plesk User ID into the domain it’s coming from:

    grep 10040 /etc/passwd
    
    evilusername:x:10040:505::/var/www/vhosts/evildomain.com:/bin/false

    Replace the user ID with your own, and the result is the user name, as well as the domain path in question.





     
  • Jay Versluis 5:56 am on April 9, 2014 Permalink | Reply  
    Categories: Plesk, Screencasts ( 40 )

    Moving WordPress with Plesk 11.5 

    Plesk-LogoIn this screencast I will show you how to move a WordPress website from one Plesk server to another without the Migration Manager.

    We’ll extract the files on the source server and export the database. Then we’ll create a new WordPress instance on the destination server and upload the files and import the database. All that remains is to point the domain to the new IP.

    I’m doing this without the Migration Manager because the source server is an Amazon EC2 instance and does not allow root access with a password (which the Migration Manager needs – and Plesk doesn’t yet have a feature that allows me to use a keyfile instead).

    The workflow is entirely web-based and you won’t need anything other than your favourite web browser.

    Enjoy!

     





     
c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
l
go to login
h
show/hide help
shift + esc
cancel