Server Administration

Overview

Not all issues are related to Quality Unit products; some may originate from your server environment. This section provides a list of common problems and their corresponding solutions.

Linux - Find all files changed in the last 7 days recursively

As a system administrator, it is often necessary to identify files that have been recently modified. This can assist with troubleshooting, monitoring changes, or maintaining security compliance. Fortunately, Linux provides powerful command-line tools to help you quickly locate such files. The find command is particularly useful for this purpose. To search for files that have been modified within the last 7 days, you can use the following command: find /path/to/directory -type f -mtime -7 Here...

How to change permissions / attributes / CHMOD for files

Changing File and Directory Permissions Using FTP To change the permissions or attributes of files and directories, it is not necessary to open them directly. Accessing Files via FTP If you uploaded files to the server using an FTP manager, follow these steps: - Navigate to the installation directory of the affiliate software. - Select the files and directories whose permissions you wish to modify. Setting Permissions in Different FTP Clients The next steps depend on the FTP client you are...

Moving a running process to background on Linux

A common problem for server administrators is starting a command that takes hours to complete shortly before leaving the office and heading home. Here are a few commands that will help you leave your computer while allowing the running command to finish: 1. To stop the currently running command, press Ctrl+Z. 2. To move the stopped process to the background, execute the command: bg 3. To ensure the command continues running after you close the SSH session, execute the command: disown -h 4. ...

Varnish - identifying the account with highest traffic

If you are running multiple domains on your server and content is cached through Varnish, you may often need to identify in real time which accounts are generating the most traffic. Below are some Varnish 4.x commands that can be used to identify accounts with the highest traffic: 1. Sorted list of hostnames with the highest number of requests: varnishtop -C -I ReqHeader:Host The output may look like this: 2. Find the most frequently accessed URLs: varnishtop -i ReqURL Here is an example ...

How to Run a Command in an Endless Loop on Linux Servers

Sometimes it is necessary to execute a command in an endless loop on Linux servers. For example, in our case, we needed to execute the PHP script jobs.php continuously until we pressed Ctrl+C. Here is how we accomplished this with a single command. This method also works on Mac computers and in the Cygwin shell on Windows: while true; do php jobs.php; done Press Ctrl+C to stop the loop at any time. This approach can be used for any command that you need to keep running repeatedly, not just ...

Scanning Your Server for Viruses or Malware

There are many options for scanning your server for viruses or malware. One of them is the ClamAV software. 1. Installing ClamAV on CentOS To install ClamAV on CentOS, run the following command: yum install clamav clamd 2. Refreshing the Virus Database After installation, refresh the virus database with the following command: freshclam You can schedule this command as a cron task to update the virus database periodically. 3. Scanning the Entire Server for Viruses To scan the entire serv...

'Argument List Too Long' Error White Deleting a Large Number of Files

If you have more than 1,024 files in a directory and wish to delete them all at once, you may encounter the error message: Argument list too long. For example, if you run: rm -f *.log When using rm -f *.log in a directory with thousands of files, the command may fail because the shell cannot handle so many arguments at once. To resolve this issue, you can pipe the file names to the rm command one by one using the following approach: find . -name '*.log' | xargs rm -f This method is both si...

Troubleshooting SVN Authorization Failure

If SVN displays the following error: Authorization failed svn: OPTIONS of 'https://svn.qualityunit.com/svn/main/PostAffiliatePro/trunk/server/plugins/AutoResponsePlus': authorization failed: Could not authenticate to server: rejected Basic challenge (https://svn.qualityunit.com) It is possible that the SVN password file is inaccessible due to incorrect permissions. Log in to your host as root. cd /backup/home2/svnqual/etc ls -al total 20 drwxr-x--- 3 svnqual nobody 4096 Dec 13 08:11 . dr...

Identifying High-Load Accounts on a Server

Server administrators often encounter challenges when trying to identify which account is generating the highest load on a server. Below are some tips on how to pinpoint such accounts: Step 1: Use the top Command First, execute the top command. This will display the current server load and the processes consuming the most resources. If you notice that there are too many httpd processes running simultaneously, you can use the following commands to determine which account is generating excessi...

Error: File Size Limit Exceeded

Linux systems allow administrators to impose file size limits for users, which can help manage disk usage and prevent individual users from consuming excessive resources. These limits are often enforced using the ulimit command and can be configured in the /etc/security/limits.conf file. Checking the Current File Size Limit To view the current file size limit for your user session, open a terminal and run: ulimit -a This command displays all current resource limits. Look for the line that be...

How to whitelist IP from server firewall

How to Whitelist an IP Address and Remove It from the Deny List in APF Firewall To whitelist an IP address on other servers, run the following command: apf -a 72.52.198.161 If the IP address is currently being blocked, you will need to remove it from the deny list first. To remove the IP address from the deny list: - Open the deny hosts file with a text editor: nano /etc/apf/deny_hosts.rules - Press Ctrl + W to initiate a search, then enter the IP address 72.52.198.161. - Once you locate...
×