Archive for September, 2012

Disable Logwatch on Clients if a Logserver Exists

If your site have a central logserver which has been configured to report on logs received from all systems, then

# rm /etc/cron.daily/0logwatch

If no logserver exists, it will be necessary for each machine to run Logwatch individually.

Using a central logserver provides the security and reliability benefits discussed earlier, and also makes monitoring logs easier and less time-intensive for administrators.

Plesk - how do I enable remote access to MySQL database server?

Sometimes you need to provide the remote access.

Open /etc/my.cnf and make sure that the following lines exists/commented in [mysqld] section:

[mysqld]
port = 3306
bind-address = 10.10.0.1
# skip-networking

Restart MySQL. Now you should grant access to remote IP address, login to Mysql:

# mysql -uadmin -p`cat /etc/psa/.psa.shadow` mysql

For example if you want to allow access to database called ‘foo’ for user ‘bar’ and remote IP 192.168.0.1 then you need to type following commands at “mysql>” prompt:

mysql> GRANT ALL ON foo.* TO bar@’192.168.0.1′ IDENTIFIED BY ‘PASSWORD’;
mysql> REVOKE GRANT OPTION ON foo.* FROM bar@’192.168.0.1′;

Reference: http://kb.parallels.com/

SBDavid

Ensuring that all Logs are Rotated

Ensuring that all Logs are Rotated

Edit the file /etc/logrotate.d/syslog.

/var/log/messages /var/log/secure /var/log/maillog /var/log/spooler \
/var/log/boot.log /var/log/cron {

Edit this line so that it contains a one-space-separated listing of each log file referenced in /etc/syslog.conf.

All logs in use on a system must be rotated regularly, or the log files will consume disk space over time, eventually interfering with system operation. The file /etc/logrotate.d/syslog is the configuration file used by the logrotate program to maintain all log files written by syslog.

By default, it rotates logs weekly and stores four archival copies of each log. These settings can be modified by editing /etc/logrotate.conf, but the defaults are sufficient for purposes of this guide.

Note that logrotate is run nightly by the cron job /etc/cron.daily/logrotate. If particularly active logs need to be rotated more often than once a day, some other mechanism must be used.

« Prev