Tag Archives: ubuntu

Ubuntu MagicSpam Plesk can’t install needs libmilter package

Getting some error like:

magicspam-plesk depends on libmilter1.0.1;

Trying to install MagicSpam on Unbuntu 12.04 and Plesk 11?

apt-get install libmilter-dev

 

root@blue:/tmp# sudo dpkg -i magicspam-plesk-1.0.5-3-precise64-postfix10.amd64.deb
(Reading database … 188972 files and directories currently installed.)
Preparing to replace magicspam-plesk 1.0.5-3 (using magicspam-plesk-1.0.5-3-precise64-postfix10.amd64.deb) …
Unpacking replacement magicspam-plesk …
dpkg: dependency problems prevent configuration of magicspam-plesk:
 magicspam-plesk depends on libmilter1.0.1; however:
Package libmilter1.0.1 is not installed.
dpkg: error processing magicspam-plesk (–install):
dependency problems – leaving unconfigured
Processing triggers for ureadahead …
Errors were encountered while processing:
magicspam-plesk

Apache2 HTTPS / SSL directory AND Password Protect

just a note. if you need to password protect a directory and add SSL / HTTPS support you need to put the protection code FIRST in your .htaccess file. when i had it after the https force it wouldn’t work.

AuthType Basic
AuthName “RESTRICTED AREA”
AuthUserFile /var/www/vhosts/YourDomain.com/httpdocs/YourDirectory/.htpasswd
require valid-user

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteCond %{REQUEST_URI} YourDirectory
RewriteRule ^(.*)$ https://YourDomain.com/YourDirectory/$1 [R,L]


UBUNTU check free memory and free mem empty cache

check memory usage:

cat /proc/meminfo

or

free

free command displays amount of total, free and used physical memory (RAM) in the system, as well as shoing information on shared memory, buffers, cached memory and swap space used by the Linux kernel.

Syntax of free

free -[options]

Example usage of free

free -m

The command will display information about physical memory in MB.

free -m -s 5

The command will activate continuous polling delay at 5 seconds apart, and then display memory status in megabytes on terminal. Any floating point number for delay can be specified.

free -t -m

Same with “free -m”, but -t switch will display a line containing the totals of physical memory and swap space.

vmstat

vmstat reports report virtual memory statistics, which has information about processes, swap, free, buffer and cache memory, paging space, disk IO activity, traps, interrupts, context switches and CPU activity. With vmstat command, administrators can has instantaneous reports on memory usage.

Syntax of vmstat

vmstat -[options] [delay count]

Example usage of vmstat

vmstat

The command will display report based on averages since last reboot.

vmstat 5

The command will pool average system resources usage level for a sampling period of 5 seconds at interval of 5 seconds, except the first result that is averages since the last reboot.

empty / free up memory caches

To free pagecache:
echo 1 > /proc/sys/vm/drop_caches

To free dentries and inodes:

echo 2 > /proc/sys/vm/drop_caches

To free pagecache, dentries and inodes:

echo 3 > /proc/sys/vm/drop_caches

As this is a non-destructive operation and dirty objects are not freeable, the user should run “sync” first!

This was originally found @ http://www.linuxinsight.com/proc_sys_vm_drop_caches.html

UBUNTU dpkg–configure-a E: dpkg was interrupted error

somehow my apt-get got torqued and wouldn’t work anymore. i tried running:

sudo dpkg –configure -a

i couldn’t do this command because the last install download was still in place.

dpkg: parse error, in file ‘/var/lib/dpkg/updates/some_file’ near line 0:

you can take care of this error by removing (rm) the file and rruning dpkg again

sudo rm /var/lib/dpkg/updates/some_file

let’s get back to dpkg configure. i read somewhere else you should add “apt-get -f install” to the end. so you’ll end up with something like this:

sudo dpkg --configure -a && sudo apt-get -f install

anyhow, it saved my butt! after running the above, i recommend using

sudo aptitude update

Ubuntu 10.x completely remove and clean MySQL installation

In my attempt to move the MySQL datadir I have a messed up MySQL installation. Here’s how I’ve completely removed MySQL 5.1 from Ubuntu 10.x. i have a messed up installation and need to completely remove MySQL and re-install it. Warning, this will delete *everything* associated with MySQL on ubuntu! It does give you a fresh install!

using apt:
apt-get –purge remove mysql-server
apt-get –purge remove mysql-client
apt-get –purge remove mysql-common

apt-get autoremove
apt-get autoclean

using aptitude (some people claim aptitude does a better job of removing dependencies):
aptitude remove mysql-client
aptitude remove mysql-server
aptitude remove mysql-common

see if anything depends on the installed packages
apt-cache rdepends mysql-server
apt-cache rdepends mysql-client

if you’ve changed apparmor settings change them back inside here:
pico /etc/apparmor.d/usr.sbin.mysqld

delete preferences(the next find command will delete everything):
rm -rf /etc/mysql

find all files with “mysql” on / and delete them:
find / -iname ‘mysql*’ -exec rm -rf {} \;

after all of the above do a clean install
aptitude install mysql-server mysql-client

check to see if mysql is running:
service mysql status

and you should get the response running

mysql start/running, process 3296

check with mysqladmin:

mysqladmin -u root -p status

MCrypt PHP5 Ubuntu Install

Ubuntu: PHP mCrypt Installation

mCrypt is an encryption program used on Linux systems.

To install mCrypt for PHP5 on your Ubuntu Linux system:

sudo apt-get install php5-mcrypt

Then restart Apache with:

sudo /etc/init.d/apache2 restart

I needed to do this so that  phpMyAdmin would have mcrypt available.

For more info about mcrypt, visit:

Official site
http://mcrypt.hellug.gr

PHP usage of mCrypt
http://www.php.net/manual/en/book.mcrypt.php

Plesk Ubuntu Remove DrWeb!

the MAGIC apt command to remove all of DrWeb:

apt-get remove drweb-base drweb-bases drweb-common drweb-daemon drweb-updater psa-drweb-configurator

root@blue:/home/primax# apt-get remove drweb-base drweb-bases drweb-common drweb-daemon drweb-updater psa-drweb-configurator
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following packages were automatically installed and are no longer required:
xulrunner-1.9-gnome-support
Use ‘apt-get autoremove’ to remove them.
The following packages will be REMOVED:
drweb-base drweb-bases drweb-common drweb-daemon drweb-updater psa-drweb-configurator
0 upgraded, 0 newly installed, 6 to remove and 0 not upgraded.
After this operation, 983kB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database … 356100 files and directories currently installed.)
Removing drweb-base …
Removing psa-drweb-configurator …
Trying to Reconfigure watchdog… Removing drweb-daemon …
Shutting down Dr. Web daemon…
Removing drweb-bases …
Removing drweb-updater …
Removing drweb-common …
root@blue:/home/primax#

After removing DrWeb I’m now getting the following cron job error emailed to me:
/bin/sh: /opt/drweb/update.pl: not found

restore QMail prefs with mchk util:

./mchk -without-spam

root@blue:/usr/local/psa/admin/sbin# ./mchk -without-spam

didn’t remove cron job error. but this seemed to deliver all Qmail queu…

found the DrWeb cron job in /var/spool/cron/crontabs

root@blue:/var/spool/cron/crontabs# ls -l
total 52
-rw——- 1 daemon    crontab  230 2010-10-12 16:30 daemon
-rw——- 1 drweb     crontab  224 2010-11-10 01:20 drweb
-rw——- 1 fcc       crontab  198 2009-11-11 22:05 fcc
-rw——- 1 flight    crontab  287 2010-04-30 00:55 flight
-rw——- 1 house     crontab  493 2010-03-30 18:29 house
-rw——- 1 james     crontab  229 2010-08-25 10:57 james
-rw——- 1 kluser    crontab  343 2009-06-04 12:01 kluser
-rw——- 1 mail      crontab  228 2010-10-12 16:30 mail
-rw——- 1 mvc_admin crontab  349 2010-10-20 10:19 mvc_admin
-rw——- 1 patriots  crontab  198 2010-10-04 13:59 patriots
-rw——- 1 qmaild    crontab  230 2010-10-15 12:43 qmaild
-rw——- 1 qmaill    crontab  230 2010-10-15 12:43 qmaill
-rw——- 1 root      crontab 1039 2010-11-10 09:59 root

removed the cron job – i’ll see if this stops the emails. I’m afraid that the QMail cron or something is calling drweb. we’ll see if this works.

root@blue:/home/primax# crontab -r -u drweb

this will remove the cron job for drweb…

finally *might have* figured out how to get rid of the annoying drweb cron emails, “/bin/sh: /opt/drweb/update.pl: not found”

solution found here

Log in as root (or you can use sudo) and open /etc/drweb/drweb32.ini:

Look for:
CronSummary = Yes

And change it to:
CronSummary = No

o.k. location of the stoopid DrWeb cron job, /etc/cron.d

root@blue:/etc/cron.d# ls -l
total 36
-rw-r--r-- 1 root root  244 2008-08-01 09:44 anacron
-rw-r--r-- 1 root root  200 2008-12-03 15:13 awstats
-rw-r--r-- 1 root root   40 2009-07-03 02:36 drweb-update
-rw-r--r-- 1 root root  161 2009-10-13 16:41 magicspam-update
-rw-r--r-- 1 root root 1393 2010-11-15 16:14 mailman
-rw-r--r-- 1 root root  580 2008-11-07 12:49 mdadm
-rw-r--r-- 1 root root  492 2008-11-25 17:15 php5
-rw-r--r-- 1 root root 1323 2008-03-31 09:16 postgresql-common
-rw-r--r-- 1 root root   75 2010-11-18 16:37 sbackup
root@blue:/etc/cron.d# 

from this site I found you can stop the annoying emails.

but for me, i’m deleting the annoying thing!

rm drweb-update


bye — bye –