<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Tips and Tricks about Servers and Applications</title>
	<atom:link href="http://www.serveridol.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.serveridol.com</link>
	<description>Just a bookmark of All my Solved problems</description>
	<lastBuildDate>Fri, 17 Feb 2012 19:43:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.4</generator>
		<item>
		<title>OpenDKIM : Configuring DKIM keys on Postfix</title>
		<link>http://www.serveridol.com/2012/02/17/opendkim-configuring-dkim-keys-on-postfix/</link>
		<comments>http://www.serveridol.com/2012/02/17/opendkim-configuring-dkim-keys-on-postfix/#comments</comments>
		<pubDate>Fri, 17 Feb 2012 19:22:59 +0000</pubDate>
		<dc:creator>lijum</dc:creator>
				<category><![CDATA[admins]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Email servers]]></category>
		<category><![CDATA[Godaddy]]></category>
		<category><![CDATA[Posftfix]]></category>
		<category><![CDATA[OpenDKIM]]></category>

		<guid isPermaLink="false">http://www.serveridol.com/?p=1535</guid>
		<description><![CDATA[<p>This is a email technology which signs each of your emails send through your SMTP. This signing process would help to identify genuinity of your emails since it was easy to verify by your receiver SMTP to have a valid DKIM check before classifying your mail either spam,phishing or impersonated one etc.</p> <p>How DKIM key [...]]]></description>
			<content:encoded><![CDATA[<p>This is a email technology which signs each of your emails send through your SMTP. This signing process would help to identify  genuinity of your emails since it was easy to verify by your receiver SMTP to have a valid DKIM check before classifying your mail either spam,phishing or impersonated one etc.</p>
<p><strong>How DKIM key works</strong></p>
<p>You SMTP server  will attach a special header each of your email which is encrypted by a private key stored on the server and send it along with email. Once the email is reached at the other trusted/secured smtp server, they will</p>
<p>a. <strong>Identify the signing in the mail header.</strong><br />
b.<strong> Reading the domain key, domain name mentioned in the mail header</strong></p>
<p> ie <strong>(DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mydomain.com;s=default; t=1329441832;)</strong> You will see the above entry in original source of  DKIM singed emails.</p>
<p>c. <strong>Then the receiver SMTP server looking for the DNS entry associated with the signed email ( here mydomain.com) </strong><br />
d. <strong>Once the nslookup can found the DNS txt entry ( here default, ie default._domainkey ), they fetch the public key which can able to decrypt the keys in email header.</strong>  </p>
<blockquote><p>ie Those emails are correctly originated from the actual sender. So it&#8217;s a trusted mail and all of your domains emails get&#8217;s white listed in other&#8217;s third party SMTP servers and hence drop it in your INBOX finally <img src='http://www.serveridol.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p></blockquote>
<p><strong>How do I install openDKIM</strong> </p>
<p>stevejenkins.com website has an excellent tutorials and I adopted his guild lines. But got stuck at few attempts initially and has got it worked at the end.</p>
<p>Here we go,</p>
<p>1. <strong>Install openDKIM rpm package from EPEL repositories</strong> (http://fedoraproject.org/wiki/EPEL). </p>
<p>   choose the correct build for your OS architecture.</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">#wget http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm<br />
&nbsp;# rpm -ivh epel-release-5-4.noarch.rpm<br />
&nbsp;#yum clean all<br />
&nbsp;#yum install opendkim</div></div>
<p><strong>2. Generate Singing Keys</strong><br />
    create a folder storing keys for my domain</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">#mkdir /etc/opendkim/keys/mydomain.com<br />
&nbsp; &nbsp;#/usr/bin/opendkim-genkey -D /etc/opendkim/keys/mydomain.com/ -d mydomain.com -s default</div></div>
<p>Above command wil create  two files under our domain folder as <strong>default.private</strong> and <strong>default.txt</strong></p>
<p>Renaming default.private to default,</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">#chown -R opendkim:opendkim /etc/opendkim/keys/mydomain.com<br />
#mv /etc/opendkim/keys/mydomain.com/default.private /etc/opendkim/keys/mydomain.com/default</div></div>
<p><strong>3. Configuration files of OpenDKIM </strong></p>
<p>1. <strong>/etc/opendkim.conf </strong>– OpenDKIM’s main configuration file<br />
2. <strong>/etc/opendkim/KeyTable </strong>– a list of keys available for signing<br />
3. <strong>/etc/opendkim/SigningTable</strong> &#8211; a list of domains and accounts allowed to sign<br />
4. <strong>/etc/init.d/opendkim</strong>  &#8212; Service start up file.</p>
<p><strong>4. Update the etc/opendkim.conf file</strong><br />
Now you need to edit the main config. file (etc/opendkim.conf) and update/un comment the few lines.</p>
<p>my file should look like this. You may need to edit the &#8220;KeyFile&#8221;  to set correct path</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">PidFile /var/run/opendkim/opendkim.pid<br />
Mode &nbsp; &nbsp;sv<br />
Syslog &nbsp;yes<br />
SyslogSuccess &nbsp; yes<br />
LogWhy &nbsp;yes<br />
UserID &nbsp;opendkim:opendkim<br />
Socket &nbsp;inet:8891@localhost<br />
Umask &nbsp; 002<br />
Canonicalization &nbsp; &nbsp; &nbsp; &nbsp;relaxed/simple<br />
Selector &nbsp; &nbsp; &nbsp; &nbsp;default<br />
KeyFile /etc/opendkim/keys/mydomain.com/default<br />
KeyTable &nbsp; &nbsp; &nbsp; &nbsp;/etc/opendkim/KeyTable<br />
SigningTable &nbsp; &nbsp;/etc/opendkim/SigningTable</div></div>
<p><strong><br />
5. update the /etc/opendkim/KeyTable file</strong></p>
<p>You may need to add you domain key name and private key file path of the domain in this file. My file looks like as shown below,</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">-sh-3.2# cat /etc/opendkim/KeyTable<br />
# To use this file, uncomment the #KeyTable option in /etc/opendkim.conf,<br />
# then uncomment the following line and replace example.com with your domain<br />
# name, then restart OpenDKIM. Additional keys may be added on separate lines.<br />
#default._domainkey.example.com example.com:default:/etc/opendkim/keys/default.private<br />
default._domainkey.mydomain.com mydomain.com:default:/etc/opendkim/keys/nanowebtech.com/default<br />
-sh-3.2#</div></div>
<p>you may use the same private key for multiple domain. It&#8217;s just like a domain- key mapping. </p>
<p><strong>default._domainkey.mydomain1.com mydomain1.com:default:/etc/opendkim/keys/mydomain.com/default<br />
default._domainkey.mydomain2.com mydomain2.com:default:/etc/opendkim/keys/mydomain.com/default</strong></p>
<p><strong>6. Update  /etc/opendkim/SigningTable </strong><br />
   This  file is actually mapping domain names to a key file. On my setup my server is hosting 4 email domains and I want to use same signing certificate for all domains. File entry should look like this,</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp;#cat /etc/opendkim/SigningTable<br />
domain1.com default._domainkey.mydomain.com<br />
domain3.com default._domainkey.mydomain.com<br />
domain2.com &nbsp;default._domainkey.mydomain.com</div></div>
<p>Pls not I uses same domain key for all other domain. So that you will get an entry in email source &#8220;signed by mydomain.com&#8221;  </p>
<p>See  the mail below,</p>
<p><a href="http://www.serveridol.com/wp-content/uploads/2012/02/Clipboard01.jpg"><img src="http://www.serveridol.com/wp-content/uploads/2012/02/Clipboard01-300x97.jpg" alt="" title="Clipboard01" width="300" height="111"  class="alignleft size-medium wp-image-1537" /></a></p>
<p><strong>7.Check the &#8221; /etc/opendkim/TrustedHosts&#8221; has loopback IP </strong></p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">-sh-3.2# cat &nbsp;/etc/opendkim/TrustedHosts<br />
# To use this file, uncomment the #ExternalIgnoreList and/or the #InternalHosts<br />
# option in /etc/opendkim.conf then restart OpenDKIM. Additional hosts<br />
# may be added on separate lines (IP addresses, hostnames, or CIDR ranges).<br />
# The localhost IP (127.0.0.1) should be the first entry in this file.<br />
127.0.0.1<br />
localhost</div></div>
<p><strong>8. Edit postfix main configuration file</strong><br />
  You  need to open the postfix config file (/etc/postfix/main.cf) and add the following lines at the bottom of the file.</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">smtpd_milters &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = inet:127.0.0.1:8891<br />
non_smtpd_milters &nbsp; &nbsp; &nbsp; = $smtpd_milters<br />
milter_default_action &nbsp; = accept<br />
milter_protocol &nbsp; = 2</div></div>
<p><strong>9. Restart the  opendkim and postfix service. </strong></p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp;-sh-3.2# service opendkim restart<br />
Stopping OpenDKIM Milter: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[ &nbsp;OK &nbsp;]<br />
Starting OpenDKIM Milter: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[ &nbsp;OK &nbsp;]<br />
-sh-3.2# service postfix restart<br />
stopping the Postfix mail system &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [ &nbsp;OK &nbsp;]<br />
starting the Postfix mail system &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[ &nbsp;OK &nbsp;]<br />
#chkconfig postfix on</div></div>
<p>Ensure that OpenDKIM logs has written on mail log file. This is the only file where you ca see any issue with the opendkim errors.</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># tail -f /var/log/maillog<br />
Feb 17 13:39:47 host opendkim[970]: OpenDKIM Filter v2.4.2 starting (args: -x /etc/opendkim.conf -P /var/run/opendkim/opendkim.pid)</div></div>
<p><strong>10. Update the DNS records</strong></p>
<p> This is the final part. You need to add a text entry &#8220;default._domainkey&#8221;.  You will get the text value from the file &#8220;/etc/opendkim/keys/mydomain.com/default.txt&#8221;</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">-sh-3.2# cat /etc/opendkim/keys/mydomain.com/default.txt<br />
default._domainkey IN TXT &quot;v=DKIM1; r=postmaster; g=*; k=rsa; p=MIGfMA0GCSqGSIb3 EBAQUAA4GNADWw1fqTtobJHsQsJ/49XRJ7eK49MUAkhLB9zcwusSfvrWutvqWT4iWM979 &nbsp; &nbsp;YOAt/d4ZVtFn7Dio6rUiLp103TfJh3g0694jJAOQU0sb4VM/NHgCIknQ/cvLG/snGL/aI7YIkSH1bI0YTYayewIDAQAB&quot; ; ----- DKIM default for mydomain.com</div></div>
<p>Copy all the value in between double quotes (starts from after TXT&#8221;). My Godaddy  domain manager look likes as below after adding,</p>
<p>You should also add another TXT Record to your zone file<br />
<strong>_adsp._domainkey.mydomain.com    IN    TXT    &#8220;dkim=unknown&#8221;</strong></p>
<p>There is not standardization to use the name &#8220;default&#8221; domain key. We can change it whatever we wish to use.<br />
<strong>Don&#8217;t forget to add SPF record for your domain </strong></p>
<p><a href="http://www.serveridol.com/wp-content/uploads/2012/02/Clipboard011.jpg"><img src="http://www.serveridol.com/wp-content/uploads/2012/02/Clipboard011-300x111.jpg" alt="" title="Clipboard01" width="300" height="111" class="alignleft size-medium wp-image-1539" /></a></p>
<p>imp : Don&#8217;t forget to set SPF record that may boost the email delivery. </p>
<p><strong>Verifying whether Postfix sending signed emails,</strong> </p>
<p> I uses a test mail  send from command line.</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">#echo &quot; This is a test mail &quot; | mail -s &quot;OpenDKIM test mail&quot; liju@serveridol.com</div></div>
<p>If everything goes well you see a messages &#8220;DKIM-Singnature header added&#8221; in mail log.</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">#tail -f /var/log/messages <br />
Feb 17 14:12:52 host postfix/pickup[32549]: A5B56F717AC: uid=0 from=&lt;root&gt;<br />
Feb 17 14:12:52 host postfix/cleanup[4092]: A5B56F717AC: message-id=&lt;20120217191252.A5B56F717AC@mail.mydomain.com&gt;<br />
Feb 17 14:12:52 host opendkim[970]: A5B56F717AC: DKIM-Signature header added (s=default, d=mydomain.com)</div></div>
<p>It&#8217;s shows  you have a trusted smtp server in place which may helpful to send bulk mails  <img src='http://www.serveridol.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  .. </p>
<p>For better trouble shooting restart opendkim service first  then postfix and also check the mail server log to get detailed report.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.serveridol.com/2012/02/17/opendkim-configuring-dkim-keys-on-postfix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CodeIgniter – No input file specified error</title>
		<link>http://www.serveridol.com/2012/02/15/codeigniter-%e2%80%93-no-input-file-specified-error/</link>
		<comments>http://www.serveridol.com/2012/02/15/codeigniter-%e2%80%93-no-input-file-specified-error/#comments</comments>
		<pubDate>Wed, 15 Feb 2012 14:26:14 +0000</pubDate>
		<dc:creator>lijum</dc:creator>
				<category><![CDATA[admins]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.serveridol.com/?p=1533</guid>
		<description><![CDATA[<p>Sometimes you may get this error when you switch the web server API module to CGI/FastCGI. I got this error during the site migration time. </p> <p>Quick fix for this error is, add a &#8220;?&#8221; append to index.php which written in .htaccess file. </p> <p>The new .htaccess file part will looks like,</p> &#160;RewriteCond %{REQUEST_FILENAME} !-f [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes you may get this error when you switch the web server API module to <strong>CGI/FastCGI</strong>. I got this error during the site migration time. </p>
<p>Quick fix for this error is, add a &#8220;<strong>?</strong>&#8221; append to <strong>index.php</strong> which written in <strong>.htaccess</strong> file.  </p>
<p>The new .htaccess file part will looks like,</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp;RewriteCond %{REQUEST_FILENAME} !-f<br />
RewriteCond %{REQUEST_FILENAME} !-d<br />
RewriteRule ^(.*)$ index.php?/$1 [L]</div></div>
<p>A simple fix <img src='http://www.serveridol.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  </p>
]]></content:encoded>
			<wfw:commentRss>http://www.serveridol.com/2012/02/15/codeigniter-%e2%80%93-no-input-file-specified-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How do I install SSL on Glassfish server</title>
		<link>http://www.serveridol.com/2012/02/12/how-do-i-install-ssl-on-glassfish-server/</link>
		<comments>http://www.serveridol.com/2012/02/12/how-do-i-install-ssl-on-glassfish-server/#comments</comments>
		<pubDate>Sun, 12 Feb 2012 18:22:32 +0000</pubDate>
		<dc:creator>lijum</dc:creator>
				<category><![CDATA[admins]]></category>
		<category><![CDATA[GlassFish]]></category>
		<category><![CDATA[Godaddy]]></category>
		<category><![CDATA[Webserver]]></category>
		<category><![CDATA[glassfish ssl]]></category>

		<guid isPermaLink="false">http://www.serveridol.com/?p=1528</guid>
		<description><![CDATA[<p>The following steps will help you to install SSL certificate on Glassfish web server which is a free community edition web sever from Sun Microsystems.</p> <p>a. Generating private key using keytool</p> <p>This step will create a private key pair stored in a file named &#8220;keystore.jks&#8221; encrypted using a password. Private key associate with certain information [...]]]></description>
			<content:encoded><![CDATA[<p>The following steps will help you to install SSL certificate on Glassfish web server which is a free community edition web sever from Sun Microsystems.</p>
<p><strong>a. Generating private key using keytool</strong></p>
<p>This step will create a private key pair stored in a file named &#8220;keystore.jks&#8221; encrypted using a password. Private key associate with certain information about the ssl issued for.</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">#keytool -keysize 2048 -genkey -alias s1as -keyalg RSA -dname &quot;CN=*.mydomain.com,O=Myorganization,L=city,S=state,C=country&quot; -keypass changeit -storepass changeit -keystore keystore.jks</div></div>
<p>NB : Do not change the keystore passoword to anything other than <strong>&#8220;changeit&#8221;</strong>. Glassfish sever  won&#8217;t take it if it changed. <img src='http://www.serveridol.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  </p>
<p>-<strong>dname :</strong> Is the collection of data required to fill out.<br />
<strong>CN :</strong> Obeviously  it should be &#8220;www.mydomain.com&#8221; Here I uses a wild card ssl certiificate which require a prefix &#8220;*.&#8221; infont of domain name.<br />
O: You company name<br />
L : locality<br />
S : State<br />
C: Country<br />
<strong>keypass:</strong> password to de-crypt the private key file<br />
<strong>storepass :</strong> This password requires to make any operations inside the key stored in the private  key files<br />
 <strong>keystore </strong>: Path of keystore file to be saved.</p>
<p><strong>You may verify the private key contents </strong></p>
<p><strong>#keytool -list -v -alias s1as -keystore keystore.jks </strong></p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">[root@ ssl]# keytool -list -v -alias s1as -keystore keystore.jks -storepass changeit<br />
Alias name: s1as<br />
Creation date: Feb 12, 2012<br />
Entry type: keyEntry<br />
Certificate chain length: 4<br />
Certificate[1]:<br />
Owner: CN=*.mydomain.com, OU=Domain Control Validated, O=*.mydomain.com<br />
Issuer: SERIALNUMBER=07969287, CN=Go Daddy Secure Certification Authority, OU=http://certificates.godaddy.com/repository, O=&quot;GoDaddy.com, Inc.&quot;, L=Scottsdale, ST=Arizona, C=US<br />
Serial number: 4b7ced4e2689be<br />
Valid from: Sun Feb 12 03:24:00 EST 2012 until: Tue Mar 03 01:58:49 EST 2015<br />
Certificate fingerprints:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;MD5: &nbsp;A1:78:A0:17:E8:89:2E:3E:81:3A:25:EE<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;SHA1: B0:65:99:15:53:4A:D0:49:D4:F2:6B:93:D4:E3:DC:75:CA<br />
Certificate[2]:<br />
Owner: SERIALNUMBER=07969287, CN=Go Daddy Secure Certification Authority, OU=http://certificates.godaddy.com/repository, O=&quot;GoDaddy.com, Inc.&quot;, L=Scottsdale, ST=Arizona, C=US<br />
Issuer: OU=Go Daddy Class 2 Certification Authority, O=&quot;The Go Daddy Group, Inc.&quot;, C=US<br />
Serial number: 301</div></div>
<p>Now we have a private key and next we need to generate CSR (Certificate Signing Request) to be send to CA authority.</p>
<p><strong>Here is the step to create CSR</strong></p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">#keytool -certreq -alias s1as -keystore keystore.jks -storepass changeit -keypass changeit -file mydomain.com.csr</div></div>
<p>Now you have a new file &#8220;<strong>mydomain.com.csr</strong> and open it in vi, copy and  paste it in to Godaddy CSR fill out form. You will get new SSL issued once after the domain owner verification process has completed.</p>
<p>Then download the SSL certificate for Tomcat web server from the Godaddy cert download manager.</p>
<p>Download and extract it the same folder where CSR generated.  My file structure is as shown below.</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">[root@fc-web01LA ssl]# ls -lt<br />
total 72<br />
-rw-r--r-- 1 root root 8640 Feb 12 03:36 keystore.jks<br />
-rw-r--r-- 1 root root 1935 Feb 12 03:30 mydomain.com.crt<br />
-rw-r--r-- 1 root root 4604 Feb 12 03:30 gd_bundle.crt<br />
-rw-r--r-- 1 root root 1789 Feb 12 03:30 gd_cross_intermediate.crt<br />
-rw-r--r-- 1 root root 1749 Feb 12 03:30 gd_intermediate.crt<br />
drwxr-xr-x 2 root root 4096 Feb 12 03:27 mydomain.com<br />
-rw-r--r-- 1 root root 1011 Feb 12 03:21 mydomain.com.csr<br />
[root@fc-web01LA ssl]#</div></div>
<p>Now you have all files to install the SSL. I would recommend to copy your private key jks file before importing certificate in to it.</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp;#cp keystore.jks keystore.jks_backup</div></div>
<p>First you need to download &#8220;valicert_class2&#8243; root certificate from Godaddy repository </p>
<p>https://certs.godaddy.com/repository/</p>
<p><strong>a. Import the root certificate into the glassfish key</strong></p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">#keytool -import -alias root -keystore keystore.jks -trustcacerts -file valicert_class2_root.crt</div></div>
<p>If you getting error messages something say like &#8221; certificate is already exists in system wide CA&#8221; then you do not need to install this.</p>
<p><strong>b. Installing secondary CA certificates </strong></p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">#keytool -import -alias cross -keystore keystore.jks -trustcacerts -file gd_cross_intermediate.crt<br />
keytool -import -alias intermed -keystore keystore.jks -trustcacerts -file gd_intermediate.crt</div></div>
<p><strong>C. Installing domain certificate to keystore.</strong></p>
<p>Pls note that server certificate could be installed only after the support ssl installed to the keystore file.</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp;keytool -import -alias s1as &nbsp;-keystore keystore.jks -trustcacerts -file mydomain.com.crt</div></div>
<p>NB: keep the same alias <strong>s1as</strong> to install SSL since it is hard coded  glassfish in domain.xml file. It can be changed anyway if you wish to make another.</p>
<p><strong>How do I view all the certificate imported to the keystore</strong></p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp;#[root@fc-web01LA ssl]# keytool -list -v -keystore keystore.jks &nbsp;-storepass changeit</div></div>
<p>Check that domain certificate entry type is set as &#8220;keyEntry&#8221; on the above screen.</p>
<p><strong>Exporting private key from a keystore file</strong></p>
<p>I have a need of installing this SSL  on Apache server as well. So I need to get back the private key from the keystore file. I found there  is a third party site provides a tool to felicitate this requirement.</p>
<p>Download that tool from here <strong>http://coreygilmore.com/uploads/2009/06/exportprivatekey.zip </strong></p>
<p> <strong> Generate the private key from keystore</strong></p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">java -jar exportprivatekey.zip keystore.jks JKS changeit s1as mydomain.com.key</div></div>
<p>Wallah !! now you have all the files required for Basic SSL install. <img src='http://www.serveridol.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Copy this keystore.jks file under your &#8220;config&#8221; inside the  respective domains.Then restart the glassfish.  <img src='http://www.serveridol.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.serveridol.com/2012/02/12/how-do-i-install-ssl-on-glassfish-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mysqlcheck :   Quick guide to Sys-admins</title>
		<link>http://www.serveridol.com/2012/02/03/mysqldump-error-1194-table-jos_joomlawatch_uri-is-marked-as-crashed-and-should-be-repaired-when-dumping-table-db_table-at-row/</link>
		<comments>http://www.serveridol.com/2012/02/03/mysqldump-error-1194-table-jos_joomlawatch_uri-is-marked-as-crashed-and-should-be-repaired-when-dumping-table-db_table-at-row/#comments</comments>
		<pubDate>Fri, 03 Feb 2012 19:17:58 +0000</pubDate>
		<dc:creator>lijum</dc:creator>
				<category><![CDATA[admins]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[RedHat EL5]]></category>
		<category><![CDATA[mysqlcheck]]></category>

		<guid isPermaLink="false">http://www.serveridol.com/?p=1520</guid>
		<description><![CDATA[<p>mysqldump: Error 1194: Table &#8221; is marked as crashed and should be repaired when dumping table `db_table` at row : </p> <p>Most of us are getting this type of errors when we used &#8220;MyISM&#8221; storage engine for huge tables. Inodb tables also were affect sometimes. We can skip this errors, if we have uses high [...]]]></description>
			<content:encoded><![CDATA[<p><strong>mysqldump: Error 1194: Table &#8221; is marked as crashed and should be repaired when dumping table `db_table` at row : </strong></p>
<p>Most of us are getting this type of errors when we used &#8220;MyISM&#8221; storage engine for huge tables. Inodb tables also were affect sometimes. We can skip this errors,  if we have uses high I/O operation supported drives like RAID 10. Most of the disk related/write related issues can be solved by empowering more stable drive mechanism.</p>
<p><strong>Solution : </strong></p>
<p>Use <strong>&#8220;repair table  table name ;&#8221;</strong> This will repair the table automatically.</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp;mysql&gt; repair table adserver.jos_users;<br />
+--------------------+--------+----------+----------+<br />
| Table &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| Op &nbsp; &nbsp; | Msg_type | Msg_text |<br />
+--------------------+--------+----------+----------+<br />
| adserver.jos_users | repair | status &nbsp; | OK &nbsp; &nbsp; &nbsp; |<br />
+--------------------+--------+----------+----------+<br />
1 row in set (0.05 sec)<br />
mysql&gt;</div></div>
<p><strong>a. How to find corrupted tables for a database </strong><br />
   #<strong> mysqlcheck -uroot -p
<pass>  &#8211;databases  database name </strong></p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">[root@u15382543 ~]# mysqlcheck --databases adserver;<br />
adserver.jos_ad_agency_advertis &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;OK<br />
adserver.jos_ad_agency_banners &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; OK<br />
adserver.jos_ad_agency_campaign &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;OK<br />
adserver.jos_ad_agency_campaign_banner &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; OK<br />
adserver.jos_ad_agency_channel_set &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; OK</div></div>
<p><strong>b. Checking whole the database for any damage/corruption</strong><br />
            #mysqlcheck &#8211;all-databases</p>
<p><strong>c. Analyzing and repairing corrupted database/s</strong> Recommended</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp;[root@u15382543 ~]# mysqlcheck &nbsp;--auto-repair --check --optimize --all-databases --extended</div></div>
<p>For a particular table,</p>
<p># mysqlcheck  &#8211;auto-repair &#8211;check &#8211;optimize  database name  table name</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">[root@rc-025 vmachines-img]# &nbsp;mysqlcheck &nbsp;--auto-repair --check --optimize wetcenter jos_menu<br />
wetcenter.jos_menu &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; OK</div></div>
<p>If you want to see the verbose<br />
#mysqlcheck -uroot -p
<password> &#8211;databases  database_name &#8211;tables table_name &#8211;extended &#8211;verbose</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp;[root@rc-025 vmachines-img]# mysqlcheck &nbsp;--databases &nbsp;wetcenter &nbsp;--tables jos_messages &nbsp;--auto-repair --check --optimize --extended --verbose<br />
# Connecting to localhost...<br />
wetcenter.jos_messages &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; OK<br />
# Disconnecting from localhost...</div></div>
<p><strong>5. Repairing MyISM tables in offline mode for huge GB tables</strong></p>
<p><strong>myisamchk &#8211;key_buffer_size=512M &#8211;sort_buffer_size=512M &#8211;read_buffer_size=8M &#8211;write_buffer_size=8M path/to/table/file/.MYI</strong></p>
<p>-read_buffer_size/&#8211;write_buffer_size : Used to read and write data from the table and to the temporary file.<br />
&#8211;sort_buffer_size : When the keys are repaired by sorting keys and this option would useful when you use &#8220;&#8211;recover&#8221;<br />
&#8211;key_buffer_size : When you check the table with &#8211;extend-check option.</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp;[root@u15382543 ~]# myisamchk --key_buffer_size=512M --sort_buffer_size=512M --read_buffer_size=256M --write_buffer_size=256M /var/lib/mysql/lists/phplist_usermessage.MYI<br />
Checking MyISAM file: /var/lib/mysql/lists/phplist_usermessage.MYI<br />
Data records: 1872964 &nbsp; Deleted blocks: &nbsp; &nbsp; &nbsp; 0<br />
- check file-size<br />
- check record delete-chain<br />
- check key delete-chain<br />
- check index reference<br />
- check data record references index: 1<br />
- check data record references index: 2<br />
- check data record references index: 3<br />
- check data record references index: 4<br />
- check record links<br />
[root@u15382543 ~]#</div></div>
<p>6. How to optimize tables</p>
<p>   <strong> to all databases</strong><br />
  # mysqlcheck -o &#8211;all-databases;  </p>
<p><strong>For a particular table </strong></p>
<p>mysqlcheck -o database_name table-name</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp;[root@rc-025/]# mysqlcheck -o selfcare customers<br />
selfcare.customers &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; OK</div></div>
<p><strong>7. How to check all the maintenance operations at a time</strong></p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp;#mysqlcheck -uroot -p &nbsp;--auto-repair -c -o --all-databases</div></div>
<p><strong>Useful params in mysqlcheck</strong></p>
<p>1. <strong>-r</strong> : Repair the table<br />
2. <strong>-o</strong> : optimize the table<br />
3. <strong>–auto-repair</strong>  : Repair the table automatically<br />
4.  <strong>-c </strong> : Check table errors<br />
5. <strong>-C</strong> : Check only the table changed since from the last check.<br />
6. <strong>–fix-db-names/–fix-table-name</strong>s  : Check database name/table name if corrupted.<br />
7. <strong>-e</strong> : Extended operations even check or repairing.<br />
8. <strong>-q </strong>: Quick checking<br />
9. <strong>-o</strong> : optimize the table<br />
10. -B  : This option keeping a a file copy before repairing it.  </p>
<p>Sometime you got the following errors when try to repair a  myISAM table where index file is missing. So you need to use the extra parms &#8220;USE_FRM&#8221; to solve this. </p>
<p><strong>ERROR : Can&#8217;t find file: &#8216;table&#8217; (errno: 2) Corrupt</strong></p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp;mysql&gt; repair table userlogs;<br />
+-------------------+--------+----------+----------------------------------------+<br />
| Table &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | Op &nbsp; &nbsp; | Msg_type | Msg_text &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br />
+-------------------+--------+----------+----------------------------------------+<br />
| selfcare.userlogs | repair | Error &nbsp; &nbsp;| Can't find file: 'userlogs' (errno: 2) |<br />
| selfcare.userlogs | repair | error &nbsp; &nbsp;| Corrupt &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|<br />
+-------------------+--------+----------+----------------------------------------+<br />
2 rows in set (0.00 sec)<br />
mysql&gt; repair table userlogs USE_FRM ;<br />
+-------------------+--------+----------+------------------------------------+<br />
| Table &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | Op &nbsp; &nbsp; | Msg_type | Msg_text &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br />
+-------------------+--------+----------+------------------------------------+<br />
| selfcare.userlogs | repair | warning &nbsp;| Number of rows changed from 0 to 1 |<br />
| selfcare.userlogs | repair | status &nbsp; | OK &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br />
+-------------------+--------+----------+------------------------------------+<br />
2 rows in set (0.07 sec)</div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.serveridol.com/2012/02/03/mysqldump-error-1194-table-jos_joomlawatch_uri-is-marked-as-crashed-and-should-be-repaired-when-dumping-table-db_table-at-row/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java virtual hosting with multiple FTP users</title>
		<link>http://www.serveridol.com/2012/01/19/java-virtual-hosting-with-multiple-ftp-users/</link>
		<comments>http://www.serveridol.com/2012/01/19/java-virtual-hosting-with-multiple-ftp-users/#comments</comments>
		<pubDate>Thu, 19 Jan 2012 18:56:51 +0000</pubDate>
		<dc:creator>lijum</dc:creator>
				<category><![CDATA[admins]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tomcat]]></category>
		<category><![CDATA[tomcat ajp connector]]></category>

		<guid isPermaLink="false">http://www.serveridol.com/?p=1514</guid>
		<description><![CDATA[<p>As we all are familiar with virtual hosting in Apache and we can isolate each users to publish their sites to a folder under thier home directory. So there is no any issue with operating the files copied on the hosting root. </p> <p>Earlier I had started tomcat from the root account and created Virtual [...]]]></description>
			<content:encoded><![CDATA[<p>As  we all are familiar with virtual hosting in Apache and we can isolate each users to publish their sites to a folder under thier home directory. So there is no any issue with operating the files copied on the hosting root. </p>
<p>Earlier  I had started tomcat from the root account and  created Virtual hosting in tomcat and isolate the hosting root according to the users. The issue I had faced is none of the FTP users to modify/delete the files  in their hosting root since all the files are owned by the root account because of root user is operating tomcat service. </p>
<p>So I have to gave ssh access to the server and gave sudo command to deploy users newly uploaded files. So it&#8217;s a security threat to allow users to have ssh access and permit to operate sudo commands.</p>
<p>After few R&#038;D I decided to run the tomcat service from a normal user who does not have shell access </p>
<p><strong>Solution : </strong></p>
<p>1. create new user and group for tomcat user</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp;#group add tomcat <br />
&nbsp; #useradd -g tomcat tomcat</div></div>
<p>2. Permitting tomcat users to access the Tomcat installation files</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp;# chown -R tomcat.tomcat /usr/local/apache-tomcat-6.0.29/</div></div>
<p>3. Start the tomcat daemon within the user account.</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; [root@rc-040 public_html]# su - tomcat<br />
&nbsp; &nbsp; [tomcat@rc-040 ~]$ cd /usr/local/apache-tomcat-6.0.29/bin/<br />
&nbsp; &nbsp; [tomcat@rc-040 bin]$ sh startup.sh<br />
&nbsp; &nbsp; Using CATALINA_BASE: &nbsp; /usr/local/apache-tomcat-6.0.29<br />
&nbsp; &nbsp; Using CATALINA_HOME: &nbsp; /usr/local/apache-tomcat-6.0.29<br />
&nbsp; &nbsp; Using CATALINA_TMPDIR: /usr/local/apache-tomcat-6.0.29/temp<br />
&nbsp; &nbsp; Using JRE_HOME: &nbsp; &nbsp; &nbsp; &nbsp;/usr/java/jdk1.6.0_14<br />
&nbsp; &nbsp; Using CLASSPATH: &nbsp; &nbsp; &nbsp; /usr/local/apache-tomcat-6.0.29/bin/bootstrap.jar<br />
&nbsp; &nbsp; [tomcat@rc-040 bin]$ netstat -nlp | grep &quot;java&quot;<br />
(Not all processes could be identified, non-owned process info<br />
&nbsp;will not be shown, you would have to be root to see it all.)<br />
tcp &nbsp; &nbsp; &nbsp; &nbsp;0 &nbsp; &nbsp; &nbsp;0 :::8080 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; :::* &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;LISTEN &nbsp; &nbsp; &nbsp;1837/java<br />
[tomcat@rc-040 bin]$</div></div>
<p>You almost done !!! <img src='http://www.serveridol.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  </p>
<p><strong>Creating FTP users and Virtual hosting </strong></p>
<p><strong>a.</strong> A<strong>n example of Virtualhost entry</strong> is showing below,</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp;[root@rc-040 public_html]# vi /usr/local/apache-tomcat-6.0.29/conf/server.xml</div></div>
<p><a href="http://www.serveridol.com/wp-content/uploads/2012/01/tomcat-virtualhost.jpg"><img src="http://www.serveridol.com/wp-content/uploads/2012/01/tomcat-virtualhost-300x69.jpg" alt="" title="tomcat-virtualhost" width="300" height="69" class="aligncenter size-medium wp-image-1515" /></a></p>
<p><strong>b.  FTP user creation</strong><br />
    1. create new user and set their primary group as tomcat.</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp;#useradd -g tomcat ftpuser1<br />
&nbsp; &nbsp; &nbsp; &nbsp; [root@rc-040 public_html]# chown -R ftpuser.tomcat /home/ftpuser/public_html</div></div>
<p>Setting sticky bit on the web directory where both users would have the same access</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp;[root@rc-040 public_html]# chmod -R &nbsp;2777 &nbsp;/home/ftpuser/public_html</div></div>
<p>That&#8217;s it !!!!!   Everything set..</p>
<p>Now upload your war file named as &#8220;<strong>ROOT.war</strong>&#8221; under the <strong>public_html</strong> folder and see the application running &#8230;  <img src='http://www.serveridol.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  There is not need to restart the tomcat to deploy new application, Just like we do with Apache <img src='http://www.serveridol.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  </p>
<p>You will get the sample war file from  here &#8220;<strong>http://tomcat.apache.org/tomcat-5.5-doc/appdev/sample/sample.war</strong>&#8221; for the initial testing.</p>
<p>Here are the some useful file locations/path if you plan to run the Tomcat as a backend server over the AJP connector in Apache ( Recommended by me <img src='http://www.serveridol.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  ) </p>
<p>1. <strong>/etc/httpd/modules/mod_jk.so</strong><br />
2. <strong>/etc/httpd/conf.d/jk.conf</strong><br />
3. <strong>/etc/httpd/conf.d/workers.properties</strong><br />
4. <strong>/etc/httpd/conf.d/javasite1.conf</strong></p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp;[root@rc-040 public_html]# ls &nbsp;/etc/httpd/modules/mod_jk.so<br />
/etc/httpd/modules/mod_jk.so<br />
[root@rc-040 public_html]# cat &nbsp;/etc/httpd/conf.d/jk.conf<br />
LoadModule jk_module /usr/lib/httpd/modules/mod_jk.so<br />
JkWorkersFile /etc/httpd/conf.d/workers.properties<br />
JkShmFile &nbsp; &nbsp; /var/log/httpd/mod_jk.shm<br />
JkLogFile &nbsp; &nbsp; /var/log/httpd/mod_jk.log<br />
JkLogLevel &nbsp; &nbsp;info<br />
JkLogStampFormat &quot;[%a %b %d %H:%M:%S %Y] &quot;<br />
[root@rc-040 public_html]# cat &nbsp;/etc/httpd/conf.d/workers.properties<br />
# Define 1 real worker using ajp13<br />
worker.list=worker1<br />
# Set properties for worker1 (ajp13)<br />
worker.worker1.type=ajp13<br />
worker.worker1.host=localhost<br />
worker.worker1.port=8009<br />
[root@rc-040 public_html]#</div></div>
<p><strong>A sample Apache virtualhost entry</strong></p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">[root@rc-040 public_html]# cat /etc/httpd/conf.d/javasite1.conf<br />
&lt;VirtualHost *:80&gt;<br />
ServerName mydomain.com<br />
ServerAlias wwww.mydomain.com<br />
DocumentRoot /home/ftpuser/public_html<br />
DirectoryIndex index.html dplpool/<br />
Alias / &nbsp;/home/ftpuser/public_html<br />
ErrorLog logs/selfcare-javahost.log<br />
JkMount /*.jsp worker1<br />
#JkMount / &nbsp; worker1<br />
JkMount /* worker1<br />
&lt;/VirtualHost&gt;</div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.serveridol.com/2012/01/19/java-virtual-hosting-with-multiple-ftp-users/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Glasshfish  error : EMBEDDED Broker start failure:code</title>
		<link>http://www.serveridol.com/2012/01/02/glasshfish-error-embedded-broker-start-failurecode/</link>
		<comments>http://www.serveridol.com/2012/01/02/glasshfish-error-embedded-broker-start-failurecode/#comments</comments>
		<pubDate>Mon, 02 Jan 2012 16:25:56 +0000</pubDate>
		<dc:creator>lijum</dc:creator>
				<category><![CDATA[admins]]></category>
		<category><![CDATA[GlassFish]]></category>

		<guid isPermaLink="false">http://www.serveridol.com/?p=1511</guid>
		<description><![CDATA[<p>You may got the following errors when you start the glasshfish server where files are copied it from some other servers. The error exact look likes as follows.</p> [#&#124;2012-01-02T03:43:44.999-0500&#124;SEVERE&#124;sun-appserver9.1&#124;javax.resourceadapter.mqjmsra.lifecycle&#124;_ThreadID=10;_ThreadName=main;_RequestID=a405530f-501e-4486-a1d4-92d05f49976e;&#124;MQJMSRA_RA4001: start:Aborting:Exception starting EMBEDDED broker=EMBEDDED Broker start failure:code = 1&#124;#] <p>Solution </p> <p>Just delete the &#8220;lock&#8221; file from the glassfish directory. The location of this file is [...]]]></description>
			<content:encoded><![CDATA[<p>You may got the following errors when you start the glasshfish server where files are copied it from some other servers.  The error exact  look likes as follows.</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">[#|2012-01-02T03:43:44.999-0500|SEVERE|sun-appserver9.1|javax.resourceadapter.mqjmsra.lifecycle|_ThreadID=10;_ThreadName=main;_RequestID=a405530f-501e-4486-a1d4-92d05f49976e;|MQJMSRA_RA4001: start:Aborting:Exception starting EMBEDDED broker=EMBEDDED Broker start failure:code = 1|#]</div></div>
<p><strong>Solution </strong></p>
<p>Just delete the &#8220;lock&#8221; file from the glassfish directory. The location of this file is &#8220;<strong>imq/instances/imqbroker/lock</strong>&#8221; under glassfish.</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">[root@fc-web04 domain1]# rm imq/instances/imqbroker/lock<br />
rm: remove regular file `imq/instances/imqbroker/lock'? y<br />
[root@fc-web04 domain1]# /var/glassfish/bin/asadmin start-domain domain1</div></div>
<p>Then try to restart the web server.</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">[root@domain1]# /var/glassfish/bin/asadmin start-domain domain1<br />
Starting Domain domain1, please wait.<br />
Log redirected to /var/glassfish/domains/domain1/logs/server.log.<br />
Redirecting output to /var/glassfish/domains/domain1/logs/server.log<br />
Killed<br />
[root@ domain1]# /var/glassfish/bin/asadmin start-domain domain1<br />
Starting Domain domain1, please wait.<br />
Log redirected to /var/glassfish/domains/domain1/logs/server.log.<br />
Redirecting output to /var/glassfish/domains/domain1/logs/server.log<br />
Domain domain1 is ready to receive client requests. Additional services are being started in background.<br />
Domain [domain1] is running [Sun Java System Application Server 9.1_01 (build b09d-fcs)] with its configuration and logs at: [/var/glassfish/domains].<br />
Admin Console is available at [http://localhost:4848].<br />
Use the same port [4848] for &quot;asadmin&quot; commands.<br />
User web applications are available at these URLs:<br />
[https://localhost:80 https://localhost:443 ].<br />
Following web-contexts are available:<br />
[/web1 &nbsp;/__wstx-services myapp ].<br />
Standard JMX Clients (like JConsole) can connect to JMXServiceURL:<br />
[service:jmx:rmi:///jndi/rmi://web:8686/jmxrmi] for domain management purposes.<br />
Domain listens on at least following ports for connections:<br />
[80 443 4848 3700 3820 3920 8686 ].<br />
Domain does not support application server clusters and other standalone instances.</div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.serveridol.com/2012/01/02/glasshfish-error-embedded-broker-start-failurecode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automating sFTP download and email alert upon file changes</title>
		<link>http://www.serveridol.com/2011/12/26/automating-sftp-download-and-email-alert-on-file-changes/</link>
		<comments>http://www.serveridol.com/2011/12/26/automating-sftp-download-and-email-alert-on-file-changes/#comments</comments>
		<pubDate>Mon, 26 Dec 2011 01:03:04 +0000</pubDate>
		<dc:creator>lijum</dc:creator>
				<category><![CDATA[admins]]></category>
		<category><![CDATA[FTP]]></category>
		<category><![CDATA[Hacks]]></category>

		<guid isPermaLink="false">http://www.serveridol.com/?p=1506</guid>
		<description><![CDATA[<p>Here I got a requirement to automate the download which using sftp account with custom ports. This account doesn&#8217;t not have any ssh access enabled. </p> <p>This script can have the following features,</p> <p>1. Synchronize the remote sftp location to local path 2. Can configure sftp custom port 3. An email alert will send to [...]]]></description>
			<content:encoded><![CDATA[<p>Here I got a requirement to automate the download which using sftp account with custom ports. This account doesn&#8217;t not have any ssh access enabled. </p>
<p>This script can have the following features,</p>
<p><strong>1. Synchronize the remote sftp location to  local path</strong><br />
<strong>2. Can configure  sftp custom port</strong><br />
<strong>3. An email alert will send to the specified users when a new file placed in the ftp location.</strong></p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">#!/bin/bash<br />
lftp -e &quot;mirror --delete --only-newer --verbose /FROM/ &nbsp;/var/RKFeeds/;quit&quot; -u username,mypass sftp://secureftp.domain.com:10022<br />
<br />
cat /dev/null &gt; /tmp/maildata.log<br />
MAIL_BODY=/tmp/maildata.log<br />
FILES=/var/RKFeeds/FROM/*<br />
for f in $FILES<br />
do<br />
<br />
### Searching new file presence<br />
if grep -Fxq &quot;$f&quot; file_list.log<br />
then<br />
&nbsp;touch /tmp/asd.log<br />
else<br />
&nbsp; echo &quot;New file&quot; $f &quot; has arrived &quot; &gt;&gt; $MAIL_BODY<br />
fi<br />
done<br />
<br />
## Rebuilding file list<br />
FILES=/var/RKFeeds/FROM/*<br />
cat /dev/null &gt; file_list.log<br />
for f in $FILES<br />
do<br />
&nbsp;# take action on each file. $f store current file name<br />
echo $f &nbsp;&gt;&gt; file_list.log<br />
done<br />
<br />
##### sending mail if mail data file having content<br />
if [[ -s $MAIL_BODY ]] ; then<br />
echo &quot;$MAIL_BODY has data.and mail sending&quot;<br />
sendEmail -f bkp-admins@mydomain.com &nbsp;-t user2@mydomain.com,lijumathewliju@gmail.com -cc support@mydomain.com, user@mydomain.com &nbsp;-u &quot;New Feeds has arrived on&quot; $(date +%d-%m-%Y) &nbsp;-l /var/log/sendEmail &nbsp;-o message-content-type=auto &nbsp;message-file=$MAIL_BODY &nbsp; -s smtpout.mydomain.net:25 -xu info@mydomain.com -xp mysmtppass<br />
else<br />
touch /tmp/asd.log<br />
fi ;</div></div>
<p>Pls note that the location <strong>&#8220;/var/RKFeeds/FROM&#8221;</strong> is the local path where lftp sync the remote folder &#8221; FROM&#8221; folder.<br />
<strong>sendEmail :</strong> Is another  smtp email sending program that help you to send email from the command line which using smtp account. So that these emails are not been marked as spam anywhere.  </p>
]]></content:encoded>
			<wfw:commentRss>http://www.serveridol.com/2011/12/26/automating-sftp-download-and-email-alert-on-file-changes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mysql on Windows : Can’t get hostname for your address</title>
		<link>http://www.serveridol.com/2011/12/05/mysql-on-windows-can%e2%80%99t-get-hostname-for-your-address/</link>
		<comments>http://www.serveridol.com/2011/12/05/mysql-on-windows-can%e2%80%99t-get-hostname-for-your-address/#comments</comments>
		<pubDate>Mon, 05 Dec 2011 14:58:59 +0000</pubDate>
		<dc:creator>lijum</dc:creator>
				<category><![CDATA[admins]]></category>
		<category><![CDATA[Hacks]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[wamp]]></category>

		<guid isPermaLink="false">http://www.serveridol.com/?p=1497</guid>
		<description><![CDATA[<p>I&#8217;m getting this error message while I&#8217;m accessing remote mysql database which was running on WAMP.</p> <p>Simple fix is to add &#8220;skip-name-resolve&#8221; in my.cnf file which will be shown in MySQL installation directory.</p> <p>Since the MySQL server is using WAMP environment, You need to put the same line inside [wampmysqld].</p> <p>The my.cnf file location will [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m getting this error message while I&#8217;m accessing remote mysql database which was running on WAMP.</p>
<p>Simple fix is to add &#8220;<strong>skip-name-resolve</strong>&#8221; in my.cnf file which will be shown in MySQL installation directory.</p>
<p>Since the MySQL server is using WAMP environment, You need to put the same line inside <strong>[wampmysqld]</strong>.</p>
<p>The <strong>my.cnf </strong> file location will be the &#8220;<strong>C:\wamp\bin\mysql\mysql5.5.8\my.cnf</strong>&#8221;</p>
<p>Eg:</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">[wampmysqld]<br />
port&nbsp; &nbsp; &nbsp; &nbsp; = 3306<br />
socket&nbsp; &nbsp; &nbsp; = /tmp/mysql.sock<br />
key_buffer = 16M<br />
max_allowed_packet = 1M<br />
table_cache = 64<br />
sort_buffer_size = 512K<br />
net_buffer_length = 8K<br />
read_buffer_size = 256K<br />
read_rnd_buffer_size = 512K<br />
myisam_sort_buffer_size = 8M<br />
basedir=c:/wamp/bin/mysql/mysql5.5.8<br />
log-error=c:/wamp/logs/mysql.log<br />
datadir=c:/wamp/bin/mysql/mysql5.5.8/data<br />
skip-name-resolve</div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.serveridol.com/2011/12/05/mysql-on-windows-can%e2%80%99t-get-hostname-for-your-address/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IIS: Renewing SSL certificate from .crt and private key file</title>
		<link>http://www.serveridol.com/2011/11/25/iis-renewing-ssl-certificate-from-crt-and-private-key-file/</link>
		<comments>http://www.serveridol.com/2011/11/25/iis-renewing-ssl-certificate-from-crt-and-private-key-file/#comments</comments>
		<pubDate>Fri, 25 Nov 2011 14:57:02 +0000</pubDate>
		<dc:creator>lijum</dc:creator>
				<category><![CDATA[admins]]></category>
		<category><![CDATA[IIS]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[ssl]]></category>
		<category><![CDATA[Windows server]]></category>

		<guid isPermaLink="false">http://www.serveridol.com/?p=1481</guid>
		<description><![CDATA[<p>One of the client migrated a domain to Windows server to Linux which was using a Godaddy UCC certificate.This certificate expired and i have renewed the SSL as most the other domains listed in it hosting on Linux server without using new CSR request. I have download the certificate suitable for IIS from Godaddy account. [...]]]></description>
			<content:encoded><![CDATA[<p>One of the client migrated a domain to Windows server to Linux which was using a Godaddy UCC certificate.This certificate  expired and i have renewed the SSL as most the other domains listed in it hosting on Linux server without using new CSR request. I have download the certificate suitable for IIS from Godaddy account.  The download containing &#8220;<strong>gd_iis_intermediates.p7b</strong>&#8221; Godaddy intermediate certificate suit for IIS and  a &#8220;domain.cert&#8221; file. </p>
<p>I read the Godaddy support documentation and did everything as it is described. Also getting  same error  <strong>&#8220;CertEnroll::CX509Enrollment::p_Install Response: ASN1 bad tag value met. 0x8009310b (ASN: 267)&#8221;</strong> So that I can&#8217;t install the certificate over the IIS MMC console. It&#8217;s still showing  older expiry date.</p>
<p>See the pasted image here <a href="http://www.serveridol.com/wp-content/uploads/2011/11/IIS-renewal.jpg"><img src="http://www.serveridol.com/wp-content/uploads/2011/11/IIS-renewal-300x167.jpg" alt="" title="IIS-renewal" width="300" height="167" class="aligncenter size-medium wp-image-1482" /></a> </p>
<p>Then I confirmed that it was not something related to IIS but with the certificate format which Godaddy had provided.After few hours of Googling, it&#8217;s found that we can create .pfx file by converting existing certificate provided by the Godaddy. Openssl have very good tool for doing that.</p>
<p><strong>a. How convert a PEM certificate file and a private key to PKCS#12, Format of IIS .pfx</strong><br />
Download both Cert (<strong>mydomain.crt</strong>) file, CA bundle file (<strong>gd_iis_intermediates.p7b</strong>) and private key in a linux box. Then execute it from the terminal.</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">#openssl pkcs12 -export -out mydomain.pfx -inkey privateKey.key -in mydomain.crt -certfile gd_iis_intermediates.p7b</div></div>
<p>This will generate  the a new file (<strong>mydomain.pfx</strong>) on the same location which could be understandable to IIS. Now you need it to copy to the IIS server and choose the import option</p>
<p><a href="http://www.serveridol.com/wp-content/uploads/2011/11/IIS-renewal2.jpg"><img src="http://www.serveridol.com/wp-content/uploads/2011/11/IIS-renewal2-300x108.jpg" alt="" title="IIS-renewal2" width="300" height="108" class="aligncenter size-medium wp-image-1483" /></a></p>
<p><strong>Choose the import certificate option</strong></p>
<p><a href="http://www.serveridol.com/wp-content/uploads/2011/11/IIS-renewal21.jpg"><img src="http://www.serveridol.com/wp-content/uploads/2011/11/IIS-renewal21-300x108.jpg" alt="" title="IIS-renewal2" width="300" height="108" class="aligncenter size-medium wp-image-1489" /></a></p>
<p><strong>Browse the .pfx  SSL renewal certificate</strong></p>
<p><a href="http://www.serveridol.com/wp-content/uploads/2011/11/IIS-renewal31.jpg"><img src="http://www.serveridol.com/wp-content/uploads/2011/11/IIS-renewal31-300x215.jpg" alt="" title="IIS-renewal3" width="300" height="215" class="aligncenter size-medium wp-image-1488" /></a></p>
<p><strong>Bind the new certificate with respective website</strong></p>
<p><a href="http://www.serveridol.com/wp-content/uploads/2011/11/IIS-renewal41.jpg"><img src="http://www.serveridol.com/wp-content/uploads/2011/11/IIS-renewal41-300x145.jpg" alt="" title="IIS-renewal4" width="300" height="145" class="aligncenter size-medium wp-image-1490" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.serveridol.com/2011/11/25/iis-renewing-ssl-certificate-from-crt-and-private-key-file/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Exim :-    Useful administrative commands</title>
		<link>http://www.serveridol.com/2011/11/21/exim-useful-administrative-commands/</link>
		<comments>http://www.serveridol.com/2011/11/21/exim-useful-administrative-commands/#comments</comments>
		<pubDate>Mon, 21 Nov 2011 17:43:26 +0000</pubDate>
		<dc:creator>lijum</dc:creator>
				<category><![CDATA[Email servers]]></category>
		<category><![CDATA[Exim]]></category>

		<guid isPermaLink="false">http://www.serveridol.com/?p=1477</guid>
		<description><![CDATA[<p>Most of the Whm/Cpanel based servers are using exim as MTA which has flexible spam filter and support virtual domain and users.</p> <p>1. Print a count of the messages in the queue: #exim -bpc</p> &#160; root@web-012 [~]# exim -bpc &#160; &#160;1 <p>2. Print a listing of the messages in the queue #exim -bp</p> &#160; root@web-012 [...]]]></description>
			<content:encoded><![CDATA[<p>Most of the Whm/Cpanel based servers are using exim as MTA which has flexible spam filter and support virtual domain and users.</p>
<p><strong>1. Print a count of the messages in the queue:</strong><br />
   #exim -bpc</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; root@web-012 [~]# exim -bpc<br />
&nbsp; &nbsp;1</div></div>
<p><strong>2. Print a listing of the messages in the queue</strong><br />
   #exim -bp</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; root@web-012 [~]# exim -bp<br />
&nbsp; &nbsp;carlineshirly@power.alstom.com<br />
&nbsp;9h &nbsp;2.0K 1RSHdk-0003zj-07 &lt;&gt; *** frozen ***<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; alyssa.campbell@lightwave.com</div></div>
<p><strong>3. Print a summary of messages in the queue</strong><br />
   #exim -bp | exiqsumm</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp;root@web-012 [~]# exim -bp | exiqsumm<br />
Count &nbsp;Volume &nbsp;Oldest &nbsp;Newest &nbsp;Domain<br />
----- &nbsp;------ &nbsp;------ &nbsp;------ &nbsp;------<br />
&nbsp; &nbsp; 1 &nbsp; &nbsp;2048 &nbsp; &nbsp; 29h &nbsp; &nbsp; 29h &nbsp;interstaterelocation.net<br />
&nbsp; &nbsp; 1 &nbsp; &nbsp;2048 &nbsp; &nbsp; &nbsp;9h &nbsp; &nbsp; &nbsp;9h &nbsp;lightwave.com<br />
&nbsp; &nbsp; 1 &nbsp; &nbsp;2457 &nbsp; &nbsp; 42h &nbsp; &nbsp; 42h &nbsp;news.cqi.com<br />
&nbsp; &nbsp; 1 &nbsp; &nbsp;1945 &nbsp; &nbsp; 22h &nbsp; &nbsp; 22h &nbsp;power.alstom.com<br />
---------------------------------------------------------------<br />
&nbsp; &nbsp; 4 &nbsp; &nbsp;8499 &nbsp; &nbsp; 42h &nbsp; &nbsp; &nbsp;9h &nbsp;TOTAL</div></div>
<p>4. Print what Exim is doing right now:<br />
    #exiwhat</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp;root@web-012 [~]# &nbsp;exiwhat<br />
&nbsp; &nbsp;4123 daemon: -q1h, listening for SMTP on port 25 (IPv6 and IPv4) and for SMTPS on port 465 (IPv6 and IPv4)</div></div>
<p>5. Display all of Exim&#8217;s configuration settings:<br />
  # exim -bP<br />
6. Use -f to search the queue for messages from a specific sender:<br />
   #exiqgrep -f user@domain.com<br />
7. Use -r to search the queue for messages for a specific recipient/domain:<br />
   #exiqgrep -r user@domain.com<br />
8. Start a queue run:<br />
   #exim -q -v<br />
9. Start a queue run for just local deliveries:<br />
   exim -ql -v<br />
<strong>10. Remove a message from the queue:</strong><br />
   #exim -Mrm <message-id></p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp;root@web-012 [~]# exim -Mrm 1RSHdk-0003zj-07<br />
Message 1RSHdk-0003zj-07 has been removed</div></div>
<p>11. Deliver a message, whether it&#8217;s frozen or not, whether the retry time has been reached or not<br />
     #exim -M <message-id><br />
<strong>12. Remove all frozen messages:</strong><br />
     #exiqgrep -z -i | xargs exim -Mrm</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">root@web-012 [~]# exiqgrep -z -i | xargs exim -Mrm<br />
Message 1RRyxQ-0003FJ-Aq has been removed<br />
Message 1RS60i-00079d-NF has been removed</div></div>
<p><strong>13. Remove all messages older than 1 days (86400 * 1 = 86400 seconds):</strong><br />
     #exiqgrep -o 432000 -i | xargs exim -Mrm<br />
<strong>14. Freeze all queued mail from a given sender:</strong><br />
     #exiqgrep -i -f luser@example.tld | xargs exim -Mf<br />
<strong>15. View a message&#8217;s headers</strong><br />
     #exim -Mvh <message-id><br />
<strong>16. View a message&#8217;s body:</strong><br />
     #exim -Mvb <message-id><br />
17. View a message&#8217;s logs:<br />
     #exim -Mvl <message-id></p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">root@server-012[~]# exim -Mvl 1RRn0a-0006pW-LV<br />
2011-11-19 15:39:12 Received from &lt;&gt; R=1RRn0V-0006pI-Vl U=mailnull P=local S=2447<br />
2011-11-19 15:42:21 wdncom.uslec.read.readnews.com [198.186.192.186] Connection timed out<br />
2011-11-19 15:42:21 elian.dancey@wdn.com.client.newsread.com &lt;elian.dancey@news.cqi.com&gt; R=dk_lookuphost T=dk_remote_smtp defer (110): Connection timed out<br />
2011-11-19 16:05:26 wdncom.uslec.read.readnews.com [198.186.192.186] Connection timed out</div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.serveridol.com/2011/11/21/exim-useful-administrative-commands/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

