Articles in this section

How to track which file is being most downloaded on a website on a Plesk server?

kb: how-to

Applicable to:

  • Plesk for Linux

Question

How to track which file is being most downloaded on a website on a Plesk server?

Answer

Although this feature is not currently available on Plesk, please take part in our product improvement by going to our UserVoice portal and voting for the feature request.

 

Alternatively, you can use one of the suggested approaches below:

Use a simple script

An alternative is to create and run the following script:

  1. Log into the server via SSH

  2. Create a file mostdownload.sh with your favorite text editor with the following content:

    #!/bin/bash
    #
    # Reads access logs and prints a list of the most accessed files that have been downloaded using the GET parameter..
    #
    echo "Type the domain that you wish to check and press [ENTER]:"
    read domain

    cat /var/www/vhosts/$domain/logs/access_* | awk '{print $7}' | sort | uniq -c | sort -n | tail

  3. Give permission to run this command:

    # chmod +x mostdownload.sh

  4. Run the command:

    # mostdownload.sh

Use GoAccess

While this wasn't tested by the Plesk team, GoAccess can be used to analyze logs and will provide further information on usage of files and bandwidth used:

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.