Log files on CentOS Plesk server

Plesk

Logs
Error log: /var/log/sw-cp-server/error_log and /var/log/sw-cp-server/sw-engine.log
Access log: /usr/local/psa/admin/logs/httpsd_access_log
Panel log: /usr/local/psa/admin/logs/panel.log

Services
Stop: /etc/init.d/psa stop
Start: /etc/init.d/psa start
Restart: /etc/init.d/psa restart

Configuration
PHP config: /usr/local/psa/admin/conf/php.ini
Panel config: /usr/local/psa/admin/conf/panel.ini
Web server config: /etc/sw-cp-server/conf.d/plesk.conf

Web Presence Builder

Logs

Error log: /usr/local/psa/admin/logs/sitebuilder.log
Install/upgrade logs: /usr/local/sb/tmp/
No service control (working via sw-cp-server service)

Configuration
/usr/local/sb/config
/etc/sw-cp-server/conf.d/plesk.conf
/usr/local/psa/admin/conf/php.ini

 

SSO

Logs
Error log: /var/log/sw-cp-server/error_log
SSO log: /var/log/sso/sso.log

Services
No service control (works via sw-cp-server service)
Manage settings: /usr/local/psa/bin/sso

Configuration
/etc/sso/sso_config.ini
/etc/sw-cp-server/conf.d/sso.inc

 

Backup Manager

Logs
Backup logs: /usr/local/psa/PMM/logs/backup-
Restore log: /usr/local/psa/PMM/logs/restore-
Functionality is controlled by the Plesk control panel service

Configuration
/etc/psa/psa.conf

 

Plesk Migrator

Configuration
/usr/local/psa/var/modules/panel-migrator/conf/

Logs
/usr/local/psa/var/modules/panel-migrator/logs/

 

Migration Manager

Logs
/usr/local/psa/PMM/logs/migration-
Functionality is controlled by the Plesk control panel service.

 

Health Monitor Manager

Logs
/usr/local/psa/admin/logs/health-alarm.log

Services
Stop: /etc/init.d/sw-collectd stop
Start: /etc/init.d/sw-collectd start
Restart: /etc/init.d/sw-collectd restart

Configuration
/usr/local/psa/admin/conf/health-config.xml
/usr/local/psa/var/custom-health-config.xml
/etc/sw-collectd/collectd.conf

 

Health Monitor Notification Daemon

Logs
/usr/local/psa/admin/logs/health-alarm.log

Services
Stop: /etc/init.d/psa-health-monitor-notificationd stop
Start: /etc/init.d/psa-health-monitor-notificationd start
Restart: /etc/init.d/psa-health-monitor-notificationd restart

Configuration
/usr/local/psa/admin/conf/health-config.xml
/usr/local/psa/var/custom-health-config.xml

 

MySQL

Logs
/var/log/mysqld.log

Services
Stop: /etc/init.d/mysqld stop
Start: /etc/init.d/mysqld start
Restart: /etc/init.d/mysqld restart

Configuration
/etc/my.cnf
/etc/mysql/my.cnf (Debian/Ubuntu)

 

PostgreSQL

Logs
/var/lib/pgsql/pgstartup.log

Services
Stop: /etc/init.d/postgresql stop
Start: /etc/init.d/postgresql start
Restart: /etc/init.d/postgresql restart

Configuration
/var/lib/pgsql/data/postgresql.conf

 

Apache

Logs
Global Access and Error logs: /var/log/httpd/
Domain logs: /var/www/vhosts//logs

Services
Stop: /etc/init.d/httpd stop
Start: /etc/init.d/httpd start
Restart: /etc/init.d/httpd restart

Configuration
/etc/httpd/conf/httpd.conf
/etc/httpd/conf.d/zz010_psa_httpd.conf (includes generated configuration files with the rest of the vhosts and server configuration)
NOTE: On SuSE, Debian, and Ubuntu, the service is called “apache2”. The path to its logs is /var/log/apache2 and the path to configs is /etc/apache2.

 

NGINX

Logs
Error log: /var/log/nginx/error.log
Access log: /var/log/nginx/access.log
Domain logs: /var/www/vhosts//logs/proxy_access*_log

Services
Stop: /etc/init.d/nginx stop
Start: /etc/init.d/nginx start
Restart: /etc/init.d/nginx restart
NOTE: To disable nginx, go to “Tools & Settings > Services Management” and stop nginx from there.

Configuration
/etc/nginx/nginx.conf
/etc/nginx/conf.d/zz010_psa_nginx.conf (includes generated configuration files with the rest of the vhosts’ and server configuration)

 

Tomcat

Logs
/var/log/tomcat5/*

Services
Stop: /etc/init.d/tomcat5 stop
Start: /etc/init.d/tomcat5 start
Restart: /etc/init.d/tomcat5 restart

Configuration
/etc/tomcat5/server.xml

 

FTP

Logs
/usr/local/psa/var/log/xferlog
/var/log/secure
No service control (works via xinetd service)

Configuration
/etc/xinetd.d/ftp_psa
/etc/proftpd.conf
/etc/proftpd.include

 

Xinetd

Logs
/var/log/messages

Services
Stop: /etc/init.d/xinetd stop
Start: /etc/init.d/xinetd start
Restart: /etc/init.d/xinetd restart

Configuration
/etc/xinetd.conf
/etc/xinetd.d/* (files with “.” in the name are ignored)

 

BIND

Logs
/var/log/messages

Services
Stop: /etc/init.d/named stop
Start: /etc/init.d/named start
Restart: /etc/init.d/named restart

Configuration
/etc/named.conf
NOTE: In Debian/Ubuntu, the service is called “bind9.”

 

Courier-IMAP

Logs
/usr/local/psa/var/log/maillog

Services
Stop: /etc/init.d/courier-imap stop
Start: /etc/init.d/courier-imap start
Restart: /etc/init.d/courier-imap restart

Configuration
/etc/courier-imap/imapd
/etc/courier-imap/imapd-ssl
/etc/courier-imap/pop3d
/etc/courier-imap/pop3d-ssl

 

Postfix

Logs
/usr/local/psa/var/log/maillog

Services
Stop: /etc/init.d/postfix stop
Start: /etc/init.d/postfix start
Restart: /etc/init.d/postfix restart

Configuration
/etc/postfix/master.cf
/etc/postfix/main.cf

 

Qmail

Logs
/usr/local/psa/var/log/maillog

Services
Stop: /etc/init.d/qmail stop
Start: /etc/init.d/qmail start
Restart: /etc/init.d/qmail restart

Configuration
Control files in /var/qmail/control/
/etc/xinetd.d/smtp_psa
/etc/xinetd.d/smtps_psa
/etc/xinetd.d/submission_psa

 

Horde

Logs
Error log: /var/log/psa-horde/psa-horde.log
No service control (works via Apache web-server)

Configuration
/etc/psa-webmail/horde/horde.conf
/etc/psa-webmail/horde/horde/conf.php

 

Roundcube

Logs
Error log: /var/log/plesk-roundcube/errors
No service control (works via Apache web-server)

Configuration
/etc/psa-webmail/roundcube/*

 

Mailman

Logs
/var/log/mailman/*

Services
Stop: /etc/init.d/mailman stop
Start: /etc/init.d/mailman start
Restart: /etc/init.d/mailman restart

Configuration
/etc/httpd/conf.d/mailman.conf
/usr/lib/mailman/Mailman/mm_cfg.py
/etc/mailman/sitelist.cfg

 

SpamAssassin

Logs
/usr/local/psa/var/log/maillog

Services
Stop: /etc/init.d/spamassassin stop
Start: /etc/init.d/spamassassin start
Restart: /etc/init.d/spamassassin restart

Configuration
/etc/mail/spamassassin/local.cf
/var/qmail/mailnames///.spamassassin/user_prefs

 

Parallels Premium Antivirus

Logs:
/usr/local/psa/var/log/maillog
/var/drweb/log/*

Service control:
Stop: /etc/init.d/drwebd stop
Start: /etc/init.d/drwebd start
Restart: /etc/init.d/drwebd restart

Configuration:
/etc/drweb/*

 

Kaspersky Antivirus

Logs:
/usr/local/psa/var/log/maillog

Service control:
Stop: /etc/init.d/kavehost stop
Start: /etc/init.d/kavehost start
Restart: /etc/init.d/kavehost restart

Configuration:
/opt/kav/sdk8l3/etc/kav-handler.cfg
/etc/kavehost.xml

 

phpMyAdmin

Logs:
Error log: /var/log/sw-cp-server/error_log
No service control (working via sw-cp-server service).

Configuration:
/usr/local/psa/admin/htdocs/domains/databases/phpMyAdmin/libraries/config.default.php

 

phpPgAdmin

Logs
Error log: /var/log/sw-cp-server/error_log
No service control (working via sw-cp-server service).

Configuration:
/usr/local/psa/admin/htdocs/domains/databases/phpPgAdmin/conf/config.inc.php

 

Logrotate

No service control. Executed by the daily maintenance task: /etc/cron.daily/50plesk-daily

Configuration
/usr/local/psa/etc/logrotate.conf
/usr/local/psa/etc/logrotate.d/*

 

Webalizer

No service control. Executed by the daily maintenance task: /etc/cron.daily/50plesk-daily

Configuration
/srv/www/vhosts/system//conf/webalizer.conf

 

AWstats

No service control. Executed by the daily maintenance task: /etc/cron.daily/50plesk-daily

Configuration
/usr/local/psa/etc/awstats/awstats.-*.conf

 

Watchdog (monit)

Logs:
/usr/local/psa/var/modules/watchdog/log/wdcollect.log
/usr/local/psa/var/modules/watchdog/log/monit.log

Service control:
Stop: /usr/local/psa/admin/bin/modules/watchdog/wd –stop
Start: /usr/local/psa/admin/bin/modules/watchdog/wd –start
Restart: /usr/local/psa/admin/bin/modules/watchdog/wd –restart

Configuration:
/usr/local/psa/etc/modules/watchdog/monitrc
/usr/local/psa/etc/modules/watchdog/wdcollect.inc.php

 

Watchdog (rkhunter)

Logs:
/var/log/rkhunter.log

Service control:
Start: /usr/local/psa/admin/bin/modules/watchdog/rkhunter

Configration:
/usr/local/psa/etc/modules/watchdog/rkhunter.conf

 

Plesk Firewall

Service control:
Stop: /etc/init.d/psa-firewall stop
Start: /etc/init.d/psa-firewall start
Restart: /etc/init.d/psa-firewall restart

Configuration:
/usr/local/psa/var/modules/firewall/firewall-active.sh
/usr/local/psa/var/modules/firewall/firewall-emergency.sh
/usr/local/psa/var/modules/firewall/firewall-new.sh

 

Plesk Firewall (IP forwarding)

Service control:
Stop: /etc/init.d/psa-firewall-forward stop
Start: /etc/init.d/psa-firewall-forward start
Restart: /etc/init.d/psa-firewall-forward restart

Configuration:
/usr/local/psa/var/modules/firewall/ip_forward.active
/usr/local/psa/var/modules/firewall/ip_forward.saved

 

IP Address Banning (Fail2Ban)

Service control:
Stop: /etc/init.d/fail2ban stop
Start: /etc/init.d/fail2ban start
Restart: /etc/init.d/fail2ban restart

Configuration: A set of IPTables rules. By default:-
iptables -N fail2ban-plesk-login
iptables -A fail2ban-plesk-login -j RETURN
iptables -A INPUT -p tcp -m multiport –dports 8880,8443 -j fail2ban-plesk-login

libarchive error after upgrade to plesk 12.5

Error:

Fatal error during packages installation: Test Transaction Errors: package libarchive-2.8.4-11082614.x86_64 (which is newer than libarchive-2.8.4-6.el5.i386) is already installed

YumTestTransactionError: Test Transaction Errors: package libarchive-2.8.4-11082614.x86_64 (which is newer than libarchive-2.8.4-6.el5.i386) is already installed

Error: Failed to run the Yum utility.
The Yum utility failed to install the required packages.
Attention! Your software might be inoperable.
Please, contact product technical support.

Fix:


rpm -e --nodeps libarchive
wget -q https://dl.fedoraproject.org/pub/epel/epel-release-latest-5.noarch.rpm
rpm -Uvh epel-release-latest-5.noarch.rpm
yum install libarchive
/usr/local/psa/admin/bin/autoinstaller

Enable Nginx support


/usr/local/psa/admin/bin/nginxmng -e

CT-4968585-bash-4.1# service nginx reload
Reloading nginx: [FAILED]
CT-4968585-bash-4.1# /usr/local/psa/admin/bin/nginxmng -d
CT-4968585-bash-4.1# /usr/local/psa/admin/bin/nginxmng -e
CT-4968585-bash-4.1# service nginx restart
Starting nginx: [ OK ]

http://kb.odin.com/en/119053

Some of the selected subscriptions were not suspended. MySQL query failed: Unknown column ‘fp’ in ‘field list’

Some of the selected subscriptions were not suspended.
MySQL query failed: Unknown column ‘fp’ in ‘field list’

Create backup of psa database:
# mysqldump -uadmin -p`cat /etc/psa/.psa.shadow` psa > psa.sql

Login to database:
# mysqldump -uadmin -p`cat /etc/psa/.psa.shadow ` psa > psa`date +%F_%H.%M`.sql

Add required fields to table, e.g.:
# mysql -uadmin -p`cat /etc/psa/.psa.shadow ` psa


ALTER TABLE psa.hosting ADD fp enum('false','true') NOT NULL default 'false';
ALTER TABLE psa.hosting ADD fp_ssl enum('false','true') NOT NULL default 'false';
ALTER TABLE psa.hosting ADD fp_enable enum('false','true') NOT NULL default 'false';
ALTER TABLE psa.hosting ADD fp_adm varchar(20) NOT NULL;
ALTER TABLE psa.hosting ADD fp_pass varchar(20) NOT NULL;

/var/lib/php/session cleanup failing

We found one of our servers had exceeded the inode limit of 400,000. Upon investigation, there were about 250,000 files in /var/lib/php/session

Cause
The script plesk-php-cleanuper contains a string ! -execdir fuser {} \, which opens every file in the /var/lib/php/session directory and checks that it is not used by a working process and can be deleted. However, the maximum number of open files is set to 1024 by default.

Resolution
Clear /var/lib/php/session using this script without the checker:
~# [ -x /usr/lib64/plesk-9.0/maxlifetime ] && [ -d /var/lib/php/session ] && find /var/lib/php/session -depth -mindepth 1 -maxdepth 1 -type f -cmin +$(/usr/lib64/plesk-9.0/maxlifetime) -delete
Increase the limit for open files to the required value.
To get the maximum number of open files, run:
~# ulimit -a
open files (-n) 1024
Add ulimit -n 30480 to /etc/cron.hourly/plesk-php-cleanuper:
~#vi /etc/cron.hourly/plesk-php-cleanuper
~#!/bin/sh
~ulimit -n 30480

Re-run the required Cron Job and check that it completes successfully .

http://kb.odin.com/en/119500

sqldumpscript

Here is a good script for backing up all mysql database on a Plesk server. Add a cron entry so that it runs everyday. Change the ‘-mtime +7’ value to determine how many days of backups you will keep.

vi /usr/local/sbin/sqldumpscript
chmod 755 /usr/local/sbin/sqldumpscript


#! /bin/bash

TIMESTAMP=$(date +"%F")
BACKUP_DIR="/var/www/vhosts/mysqldumps/$TIMESTAMP"
MYSQL=/usr/bin/mysql
MYSQLDUMP=/usr/bin/mysqldump
find /var/www/vhosts/mysqldumps/ -maxdepth 1 -type d -mtime +7 -exec rm -rf {} \;

mkdir -p "$BACKUP_DIR"

databases=`$MYSQL -uadmin -p\`cat /etc/psa/.psa.shadow\` -e "SHOW DATABASES;" | grep -Ev "(Database|information_schema)"`

for db in $databases; do
$MYSQLDUMP --force --opt --skip-events --skip-lock-tables -uadmin -p`cat /etc/psa/.psa.shadow` --databases $db | gzip > "$BACKUP_DIR/$db.gz"
done

create crontab entry
39 3 * * * /usr/local/sbin/sqldumpscript

HTML emails disabled in Horde

By default inline HTML is disabled in Horde.

Resolution

To enable inline HTML, set option “inline” to “true” in the following files:

/usr/share/psa-horde/imp/config/mime_drivers.php
/usr/share/psa-horde/config/mime_drivers.php

Example:
/* HTML driver settings */
‘html’ => array(
/* NOTE: Inline HTML display is turned OFF by default. */
‘inline’ => true,

sitemap.html (xml) problems with Youst SEO plugin

Dr. Adams at http://psychological.com had a problem getting rid of google sitemap errors. After resolving the problem he sent us this update:

If you use Youst as an SEO plug-in for WordPress, do NOT use Youst for creating a sitemap. If you fail to uncheck a box, it creates a sitemap.HTML, and Google becomes obsessed with it. Instead use the Google plug-in for Sitemap.

OK, so you now have Google believing you have sitemap.html…even though such a file does not exist.

So you see a list of errors in Google Webmaster Tools, and you will never get rid of it. Never, ever…for eternity. Trust me.

It occurred to me that every stiemap.xml (sitemap-authors.xml) that is now misidentified as .html.

So you take each of those misperceived *.xml files and test them in Webmaster Tools. They will return NO errors. You then submit them one at a time. Each has many sitemap files nested beneath.

So each one you test/verify has many files beneath it.

Then you submit each (which includes nested files) again. This time they will pass.

I had 66 sitemap errors, all listed as html even though they are not.

Once you verify and then submit again, they go away.

Train Spamassassin for all mail names on the server simultaneously

Store SPAM and HAM messages in two different folders, for example ‘train_spam’ and ‘train_ham’.

Train Spamassassin for one mailbox using the messages from that folders:

cd /var/qmail/mailnames/DOMAIN/spam/Maildir/

sa-learn –spam .train_spam/*
Output will look similar to this:
Learned tokens from 727 message(s) (13758 message(s) examined)

sa-learn –ham .train_ham/*
Output will look similar to this:
Learned tokens from 573 message(s) (11408 message(s) examined)

Copy the spam assassin files into every email account on the server. Keep in mind that if anyone was doing their own spam/ham sorting this will override it (whitelist/blacklist will be left alone).

find /var/qmail/mailnames/ -mindepth 2 -maxdepth 2 -type d -exec /bin/cp -f /var/qmail/mailnames/DOMAIN/spam/.spamassassin/bayes_* {}/.spamassassin/ \;