Spamd options

/usr/bin/spamd -d -u spamassassin -c -i -A 192.168. -H --max-children=5 --max-conn-per-child=128 -s /var/log/spamd.log --virtual-config-dir=/vhome/%u/spamassassin -r /var/run/spamassassin/spamd.pid -r /var/run/spamassassin/spamd.pid
 
-d daemonized
-u spamassassin
 
-c Create user preferences files if they don't exist
 
-i the interface to allow
 
-H
--max-children=5  no of children to spawn ( default 5 )
--max-conn-per-child=128 Maximum connections accepted by child before it is respawned
 
-s /var/log/spamd.log logs location
 
--virtual-config-dir=/vhome/%u/spamassassin 
 
--virtual-config-dir=pattern
This option specifies where per-user preferences can be found for virtual users, for the -x switch. The pattern is used as a base pattern for the directory name. Any of the following escapes can be used:
%u -- replaced with the full name of the current user, as sent by spamc.
%l -- replaced with the 'local part' of the current username. In other words, if the username is an email address, this is the part before the @ sign.
%d -- replaced with the 'domain' of the current username. In other words, if the username is an email address, this is the part after the @ sign.
%% -- replaced with a single percent sign (%).

So for example, if /vhome/users/%u/spamassassin is specified, and spamc sends a virtual username of jm@example.com, the directory /vhome/users/jm@example.com/spamassassin will be used.

The set of characters allowed in the virtual username for this path are restricted to:

        A-Z a-z 0-9 - + _ . , @ =

All others will be replaced by underscores (_).

This path must be a writable directory. It will be created if it does not already exist. If a file called user_prefs exists in this directory (note: not in a .spamassassin subdirectory!), it will be loaded as the user's preferences. The auto-whitelist and/or Bayes databases for that user will be stored in this directory.

Note that this requires that -x is used, and cannot be combined with SQL- or LDAP-based configuration.

The pattern must expand to an absolute directory when spamd is running daemonized (-d).

 
-r /var/run/spamassassin/spamd.pid
 
 
--

apache - (13)Permission denied: access to

(13)Permission denied: access to / failed because search permissions are missing on a component of the path
 
would always be a permission issue !!

--

How to connect from a remote mail server to a dedicated spamassissin server

install spamassissin
perl -MCPAN -e 'install Mail::SpamAssassin'

vi /etc/mail/spamassassin/local.cf

rewrite_header Subject *****SPAM*****
trusted_networks 216.185.xx


now to start spamd so that remote mail server can connect through
spamc ( client )

spamd -u spamd -d -i -s /var/log/spamd.log --allowed-ips 216.xx.xx.xx

-d is saemonize spamd
-i is interface
-s sys logging

see if the the interfaces and ipaddress are allowed.

[root@vps1 ~]# netstat -nap |grep tcp
tcp 0 0 0.0.0.0:783 0.0.0.0:*
LISTEN 8181/spamd.log --al
tcp 0 0 0.0.0.0:80 0.0.0.0:*
LISTEN 23902/httpd
tcp 0 0 0.0.0.0:22 0.0.0.0:*
LISTEN 23849/sshd
tcp 0 0 216.185.xx.xx:783 216.xx.xx.55:4317
CLOSE_WAIT 8183/spamd child

chk the ps

ps -aux |grep spam


--

how to install drupal on debian etch

1. create a directory  /var/www/drupal/
cd  /var/www/drupal/
 
 
tar -xzvf drupal-6.0-beta1.tar.gz
2. set the permissions for  /var/www/drupal/sites/default and  /var/www/drupal/sites/default/setting.php
chmod o+w  /var/www/drupal/sites/default
chmod o+w  /var/www/drupal/sites/default/setting.php
 
3. create a database drupal  and assign/creat a user for it
 
mysqladmin -u root -pagnello create drupal 
 
log into mysql and use drupal db
 
GRANT ALL ON drupal.* to 'agnello'@'localhost' IDENTIFIED BY 'agnello';
quit;
 
4. edit the following vi /etc/apache2/sites-available/default ( using name based virtual hosting )
 

<VirtualHost *>
        # Basic setup
        ServerAdmin webmaster@test-server.com
        ServerName drupal.test-server.com
        ServerAlias drupal.test-server.com
        DocumentRoot /var/www/drupal/


# HTML documents, with indexing.
        <Directory />
        Options +Includes
        </Directory>

# CGI Handling
#  ScriptAlias /cgi-bin/ /home/www/www.foo.com/cgi-bin/
# <Location /cgi-bin>
#  Options +ExecCGI
# </Location>

#Logfiles
         ErrorLog  /var/log/test-server.com/drupla/error.log
         CustomLog /var/log/test-server.com/drupal/access.log combined
 </VirtualHost>

restart apache 2
 
5. run the following link on ur browser http://drupal.test-server.com
 
 
now configure the setting use the  the same user name and password for db wen asked  !!!!!!!


--

how to install ajaxim on debian etch - web chat client

1. create a directory  /var/www/ajaxim/
cd  /var/www/ajaxim/
 
 
unzip 3.22
2. edit the /var/www/ajaxim/config.php
// MySQL Database Configuration
$sql_user   = 'agnello';
$sql_pass   = 'agnello';
$sql_host   = 'localhost';
$sql_db     = 'ajaxim';
 
 
3. create a database ajaxim  and assign/creat a user for it
 
mysqladmin -u root -pagnello create ajaxim
 
log into mysql and use ajaxim db
 
GRANT ALL ON ajaxim.* to 'ajaxim'@'localhost' IDENTIFIED BY 'password';
quit;
 
4. edit the following vi /etc/apache2/sites-available/default ( using name based virtual hosting )
 

<VirtualHost *>
        # Basic setup
        ServerAdmin webmaster@test-server.com
        ServerName www.messenger.test-server.com
        ServerAlias messenger.test-server.com
        DocumentRoot /var/www/ajaxim/


# HTML documents, with indexing.
        <Directory />
        Options +Includes
        </Directory>

# CGI Handling
#  ScriptAlias /cgi-bin/ /home/www/www.foo.com/cgi-bin/
# <Location /cgi-bin>
#  Options +ExecCGI
# </Location>

#Logfiles
         ErrorLog  /var/log/test-server.com/ajaxim/error.log
         CustomLog /var/log/test-server.com/ajaxim/access.log combined
 </VirtualHost>

restart apache 2
 
5. run the following link on ur browser http://messenger.test-server.com/install.php
 
 
now register a user and start chatting !!!!!!!!!
 
 
 
--

MySQL database tips

 
how to create database
mysqladmin -u root -p create joomla

how to delete user assigned for a particular database*
DELETE FROM user WHERE User='Dude3' AND Host='localhost';

how to delete permisission for particular db
DELETE FROM user WHERE User='Dude3' AND Host='localhost';

how to grant all ( permission)  to a certain database for a particular user to use this DB
 GRANT ALL ON joomla.* to 'joomla'@'localhost' IDENTIFIED BY '';

delete databse
DROP DATABASE dbname



--

How to install joomla on debian etch


1. install a LAMP server ... make sure to install php4-myql package..... make sure you areaq able to connect mysql through php withe following script ... add this test.php in /var/www/apache2-default/

<?php
include("config.php");
mysql_connect("$dbhost", "$dbuname", "$dbpass");
mysql_select_db("$dbname");
echo mysql_error();
phpinfo();
?>

 
2.download the joomla tar files in /var/www/joomal
 
3 .chmod all the directories in /var/www/joomal to 777
 
create database joomla
mysqladmin -u root -pthepassword create joomla

mysql -u root -p
Enter Password:
mysql> GRANT ALL ON joomla.* to 'joomla'@'localhost' IDENTIFIED BY '';
quit; 
 
mv /var/www/joomla/configuration.php-dist to /var/www/joomla/configuration.php
 
edit /var/www/joomla/configuration.php
 
$mosConfig_lang = 'english';                            // Site language
$mosConfig_absolute_path = '/var/www/joomla';   // No trailing slash
$mosConfig_live_site = 'http://test-server.com';        // No trailing slash
$mosConfig_sitename = 'Joomla';                         // Name of Joomla site
$mosConfig_shownoauth = '0';                            // Display links & categories users don't have access to
$mosConfig_useractivation = '1';                        // Send new registration passwords via e-mail
$mosConfig_uniquemail = '1';                            // Require unique email adress for each user
$mosConfig_offline_message = 'This site is down for maintenance.<br /> Please check back again soon.';
$mosConfig_lifetime = '900';                            // Frontend Session time
$mosConfig_session_life_admin = '1800';         // Admin Session Time
$mosConfig_MetaDesc = 'Joomla - the dynamic portal engine and content management system';
$mosConfig_MetaKeys = 'joomla';
$mosConfig_MetaTitle = '1';
$mosConfig_MetaAuthor = '1';
$mosConfig_debug = '0';
$mosConfig_locale = 'en_GB';
$mosConfig_offset = '0';                                // Server Local Time
$mosConfig_offset_user = '0';                   // User Local Time
$mosConfig_hideAuthor = '0';
$mosConfig_hideCreateDate = '0';
$mosConfig_hideModifyDate = '0';
$mosConfig_hidePdf = '0';
$mosConfig_hidePrint = '0';
$mosConfig_hideEmail = '0';
$mosConfig_enable_log_items = '0';
$mosConfig_enable_log_searches = '0';
$mosConfig_enable_stats = '0';
$mosConfig_sef = '0';
$mosConfig_vote = '0';
$mosConfig_gzip = '0';
$mosConfig_multipage_toc = '0';
$mosConfig_allowUserRegistration = '1';
$mosConfig_error_reporting = -1;
$mosConfig_error_message = 'This site is temporarily unavailable.<br />Please contact your System Administrator.';
$mosConfig_link_titles = '0';
$mosConfig_list_limit = '30';
$mosConfig_caching = '0';
$mosConfig_cachepath = '/var/www/joomla/install/cache';
$mosConfig_cachetime = '900';
$mosConfig_mailer = 'mail';
$mosConfig_mailfrom = '';
$mosConfig_fromname = '';
$mosConfig_sendmail = '/usr/sbin/sendmail';
$mosConfig_smtpauth = '0';
$mosConfig_smtpuser = '';
$mosConfig_smtppass = '';
$mosConfig_smtphost = 'localhost';
$mosConfig_back_button = '1';
$mosConfig_item_navigation = '1';
$mosConfig_secret = 'FBVtggIk5lAzEU9H'; //Change this to something more secure
$mosConfig_pagetitles = '1';
$mosConfig_readmore = '1';
$mosConfig_hits = '1';
$mosConfig_icons = '1';
$mosConfig_favicon = 'favicon.ico';
$mosConfig_fileperms = '';
$mosConfig_dirperms = '';
$mosConfig_helpurl = 'http://help.joomla.org';
$mosConfig_mbf_content='0';
$mosConfig_editor = 'tinymce';
$mosConfig_admin_expired = '1';
$mosConfig_frontend_login = '1';
$mosConfig_frontend_userparams = '1';
$mosConfig_itemid_compat = '0';
setlocale (LC_ALL, $mosConfig_locale);                  // Country locale
 
chmod 777 /var/www/joomla/configuration.php
 
 
4. mkdir -p /var/log/test-server.com/
mkdir -p /var/log/test-server.com/joomla/
 
 edit the /etc/apache2/sites-available/default and add the following
<VirtualHost *>
        # Basic setup
        ServerAdmin webmaster@test-server.com
        ServerName test.debain.com
        DocumentRoot /var/www/joomla/


# HTML documents, with indexing.
        <Directory />
        Options +Includes
        </Directory>

# CGI Handling
#  ScriptAlias /cgi-bin/ /home/www/www.foo.com/cgi-bin/
# <Location /cgi-bin>
#  Options +ExecCGI
# </Location>

#Logfiles
         ErrorLog  /var/log/test-server.com/joomla/error.log
         CustomLog /var/log/test-server.com/joomla/access.log combined
 </VirtualHost>

restart apache 2

now try http://www.test-server.com/administrator/ -----> admin login

http://www.test-server.com -----> your site

all holds true if DNS settinga are changed ( i have used a internal DNS server )


--

How To Set Up A Ubuntu/Debian LAMP Server

1. Installing Apache + PHP

apt-get install apache2 php5 libapache2-mod-php5

2. Installing MySQL Database Server

apt-get install mysql-server mysql-client php5-mysql

--

bzip2. who to extract

bunzip2 fiile_name.bzip2

this will extract the file

--

script to test php.info

<?php
include("config.php");
mysql_connect("$dbhost", "$dbuname", "$dbpass");
mysql_select_db("$dbname");
echo mysql_error();
phpinfo();
?>


--

shell scripting tip

suppose you want to write a script to install postfix-mysql package ( example ) and youdonot want intruption while the scripts executes you add the -y switch to the apt-get command.

#!/bin/sh

echo "this is a script tp install postfix fro virtual domains "

apt-get install -y postfix-mysql

or you can also try

#!/bin/sh echo "this is a script tp install postfix fro virtual domains " #apt-get install -y postfix-mysqlapt-get install postfix-mysql <<>

y

END

if you wan to install many packages ( put in loop )

#!/bin/sh

echo "this is a script tp install postfix fro virtual domains "

for package in package1 package2 package3

do apt-get install $package <<>

y

END

done

hope this helps you!!!!

Installing a DNS server on debian etch

apt-get install bind9
 
vi /etc/bind/named.conf.local
 
add the following
 
zone "test-server.com" IN {
        type master;
        file "/etc/bind/test-server.db";
        };
 
 
 vi /etc/bind/test-server.db
 
add the following

$TTL 86400
$ORIGIN test-server.com.
@       IN      SOA     ns1.test-server.com. admin.test-server.com. (
                                                2004042601      ; serial
                                                21600           ; refresh
                                                3600            ; retry
                                                604800          ; expires
                                                86400 )         ; minimum

        IN      NS              ns1.test-server.com.

        IN      MX      10      mail.test-server.com.

        IN      A               192.168.0.242

ns1     IN      A       192.168.0.242
www     IN      A       192.168.0.247
ftp     IN      A       192.168.0.247
mail    IN      A       192.168.0.244
aggi    IN      A       192.168.0.247


vi /etc/resolv.conf
nameserver 127.0.0.1
 
/etc/init.d/bind reload
 
on other clients
vi /etc/resolv.conf
nameserver 192.168.0.242
 
now do a

--

manipulating commands using keyboard maps

The inputrc file handles keyboard mapping for specific situations. This file is the startup file used by Readline — the input-related library — used by Bash and most other shells.

suppose you want to run a command witha specific keystroke eg : ctl+e to give the out put ls -la
 
you will need to append the following to the /etc/inputrc file
 
Control-e: "ls -la\n"
 
save the file
 
bind -f /etc/inputrc ------------> to the the changes may be relflected

now try to do a control +e and theout put on the screen will be a ls -la
 
--

good linux resource LFS

http://lfs-matrix.net/clfs/view/clfs-2.0/arm/index.html

--

Good linux resources

http://www.jpsdomain.org/linux/linux.html

--

Making Your Prompt More Informative

Setting a particular parameter is as simple as typing VARIABLE=value . This would set a parameter by the name VARIABLE with the value that you provide.

To see a list of the environment variables that are already set on your machine, type the following

$ env

Many prompts do not include the return code of the last command. Although such information is not completely necessary, it might help you see whether a previous command succeeded or failed. So, a simple, informative prompt that is easy to read can be set as follows (in the bash shell):

export PS1="-$?-(\u@\h) \w --> "

$? : this willgive you the return code wheather the previous command executed successfully

\w: This special sequence expands to your full current working directory. \n : can add this to the PS1 vairable ..... this takes you to the next line .

[ note: the export command sets a enviroment virable ]

you can also check inthe home dir of root ( ~ ) .bashrc file and make changes to the PS1 vairables there

--

steps to create password-less login

On the host machines create a private and a public key pair
 
ssh-keygen -t rsa 2048
 
[this will create a ~/.ssh/id_rsa and ~/.ssh/id_rsa.pub for the private and public keys, respectively ]
 
now copy the ~/.ssh/id_rsa.pub to the remoate system where you want passwordless login
 
scp ~/.ssh/id_rsa.pub root@192.168.0.247:/tmp

Now on the remote machine

mkdir ~/.ssh
chmod 700 ~/.ssh
cp /tmp/id_rsa.pub ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys

now on the host machine try to login iin , it shold log you in woith outh a password
You can append as many public keys  usig the >> sign

--

ssh for system admainistrators

ssh root@ipaddress command ---------> will display the command to you of the remote pC

secured copy

scp local_file root@192.168.0.244:/tmp/remote_file ----> copies the file ( local_file)  to remote location

scp root@192.168.0.244:/tmp/remote_file loca_files ---> copies remote files to local machine

scp root@192.168.0.234:file1 name root@192.168.0.244: ----- will copy file1 frm the home dir of 192.168.0.234 to the home dir of 192.168.0.244



--

Other Articles

Enter your email address: