Archive for the 'Linux Support' Category

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.

SBDavid

The resize2fs program

# resize2fs -h
resize2fs 1.42 (29-Nov-2011)
Usage: resize2fs [-d debug_flags] [-f] [-F] [-M] [-P] [-p] device [new_size]

DESCRIPTION

The resize2fs program will resize ext2, ext3, or ext4 file systems. It can be used to enlarge or shrink an unmounted file system located on device. If the filesystem is mounted, it can be used to expand the size of the mounted filesystem, assuming the kernel supports on-line resizing. (As of this writing, the Linux 2.6 kernel supports on-line resize for filesystems mounted using ext3 and ext4.).

The resize2fs program does not manipulate the size of partitions. If you wish to enlarge a filesystem, you must make sure you can expand the size of the underlying partition first. This can be done using fdisk(8) by deleting the partition and recreating it with a larger size or using lvextend(8), if you’re using the logical volume manager lvm(8).

When recreating the partition, make sure you create it with the same starting disk cylinder as before! Otherwise, the resize operation will certainly not work, and you may lose your entire filesystem. After running fdisk(8), run resize2fs to resize the ext2 filesystem to use all of the space in the newly enlarged partition.

If you wish to shrink an ext2 partition, first use resize2fs to shrink the size of filesystem. Then you may use fdisk(8) to shrink the size of the partition. When shrinking the size of the partition, make sure you do not make it smaller than the new size of the ext2 filesystem!

SBDavid

Adding RPM Fusion Repository

Adding RPM Fusion Repository

Command Line Setup using rpm

To enable access to both the free and the nonfree repository use the following command:

Fedora 15, 16 and 17:

su -c ‘yum localinstall –nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm’

RHEL 6 or compatible like CentOS:

su -c ‘yum localinstall –nogpgcheck http://download1.rpmfusion.org/free/el/updates/6/i386/rpmfusion-free-release-6-1.noarch.rpm http://download1.rpmfusion.org/nonfree/el/updates/6/i386/rpmfusion-nonfree-release-6-1.noarch.rpm’

« Prev - Next »