<?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>Ask the German &#187; Web Technologies</title>
	<atom:link href="http://www.askthegerman.com/archives/category/webtech/feed" rel="self" type="application/rss+xml" />
	<link>http://www.askthegerman.com</link>
	<description>"the owl of Minerva spreads its wings only with the falling of the dusk"</description>
	<lastBuildDate>Thu, 30 Apr 2009 10:26:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Monitor your Tomcat Servlet on a regular basis</title>
		<link>http://www.askthegerman.com/archives/274</link>
		<comments>http://www.askthegerman.com/archives/274#comments</comments>
		<pubDate>Thu, 30 Apr 2009 08:30:55 +0000</pubDate>
		<dc:creator>Volker</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Operating System]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[TomCat]]></category>
		<category><![CDATA[UNIX]]></category>
		<category><![CDATA[Web Technologies]]></category>
		<category><![CDATA[Webserver]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[Excel]]></category>
		<category><![CDATA[Monitoring]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://www.askthegerman.com/?p=274</guid>
		<description><![CDATA[Lets assume you have enabled the monitoring capabilities of your tomcat. If you do not know how to achieve this see my earlier posting here about. Now it is cool to monitor your application on a regular basis. Because I&#8217;m used to shell scripting in LINUX I present you here a scripting solution within a [...]]]></description>
			<content:encoded><![CDATA[<p>Lets assume you have enabled the monitoring capabilities of your tomcat.<br />                   If you do not know how to achieve this see my earlier <a href="/archives/252" title="Enabling tomcat monitoring capabilities">posting</a> here about.</p>
<p>Now it is cool to monitor your application on a regular basis. <br />                   Because I&#8217;m used to shell scripting in LINUX I present you here a scripting solution within a bash shell. But I&#8217;m sure you can do the same in Windows. <br />                   The idea is to set up a cron job ( for windows use the scheduler) and get the statuspage from your tomcat every &#8211; lets say &#8211; five minutes.<br />                   Get some of the interesting values out of this page and save them in a csv &#8211; File.<br />                   Create a new file every day. Perhaps you want to use this files as input for a spreadsheet program to create some nice charts.</p>
<p>But to be honest &#8211; this is a very special script &#8211; you have to adopt it to your needs.<br />                   This are the basic prerequisites:</p>
<ul>
<li>you need linux to run it (this script is developed on a SUSE &#8211; Distribution)</li>
<li>eventually you need to install some tools (I think the w3m tool is not bundled with every linux distribution)</li>
<li>this script only! works correct with a tomcat 6.0 version</li>
</ul>
<p><font face="Courier" size="1"><span style="color: #006600">#!/bin/bash<br />                   # -configure below-</span><br />                   HTTPPORT=&quot;8080&quot; &nbsp;&nbsp; <span style="color: #0066ff"># The http Port of your tomcat</span><br />                   JKPORT=&quot;8709&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #0066ff"># The Modjk Port of your tomcat (if your tomcat should be reachable from a apache webserver)</span><br />                   SERVER=&quot;localhost:$HTTPPORT&quot; <span style="color: #0066ff"># you can even monitor a tomcat on another server!</span><br />                   USER=&quot;tomcat-oper&quot; <span style="color: #0066ff"># the account and</span><br />                   PW=&quot;IwantItAll&quot;&nbsp;&nbsp;&nbsp; <span style="color: #0066ff"># password you have defined in tomcat-users.xml</span><br />                   APPL=&quot;CoolAppl&quot; &nbsp;&nbsp; <span style="color: #0066ff"># The name of your application</span><br />     <span style="color: #006600"># -configure above-</span><br />                   TODAY=`date &#8216;+%m-%d-%y&#8217;`<br />                   TIME=`date &#8216;+%H:%M:%S&#8217;`<br />                   OUTFILE=&quot;tomcat-stats-${TODAY}.csv&quot;<br />     <span style="color: #006600">#</span><br />     <span style="color: #006600">#set -x</span>&nbsp;&nbsp; <span style="color: #0066ff"># uncomment if you want to improve the script or if you are searching for a bug</span><br />     <span style="color: #006600">#</span><br />     <span style="color: #006600">#</span> <span style="color: #0066ff"># If there is no csv-file create one and put a headerline in</span><br />                   if !(test -e $OUTFILE) then<br />          &nbsp; echo &quot;Time,FreeMemory,UsedMemory,MaxMemory,HttpThreadsMax,<br />      &nbsp; HttpThreadsBusy,ModJKThreads,ModJKThreadsBusy,Sessions&quot; &gt; $OUTFILE<br />                   fi<br />     <span style="color: #006600">#</span> <span style="color: #0066ff"># get the statuspage from tomcat &#8211; filter it for the wanted informations &#8211; and create a temporary file</span><br />                   &nbsp;  w3m -dump http://${USER}:${PW}@${SERVER}/manager/status/all| \<br />                   &nbsp;  egrep &quot;(memory|thread|Active sessions|<br />        &nbsp; ^JVM|$HTTPPORT|$JKPORT|${APPL})&quot; &gt;/tmp/tomcat-status<br />     <span style="color: #006600">#<br />                   #</span> <span style="color: #0066ff"># put the values in variables / uncomment to get a better understanding of the process</span><br />     <span style="color: #006600">#</span><br />                   while read line<br />                   &nbsp;&nbsp;    do<br />                   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;      case $line in<br />                   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;           JVM)   read line<br />                   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;                  JVM_VALUE=`echo $line | awk &#8216;{print($3 &quot;,&quot; $7 &quot;,&quot; $11)}&#8217;`<br />     <span style="color: #006600"></span></font><font face="Courier" size="1"><span style="color: #0066ff">#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; uncomment </span></font><font face="Courier" size="1"><span style="color: #0066ff">below </span></font><font face="Courier" size="1"><span style="color: #0066ff">if you want to debug</span></font><font face="Courier" size="1"><span style="color: #006600"><br />            #&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo &quot;JVM_VALUE: &lt;$JVM_VALUE&gt;&quot;</span><span style="color: #0066ff"></span><br />                   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;;<br />                   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;            *${HTTPPORT}) read line<br />                   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; HTTP_MAX_THREADS=`echo $line |awk &#8216;{print(&quot;,&quot; $3)}&#8217;`<br />     <span style="color: #006600"></span></font><font face="Courier" size="1"><span style="color: #006600"></span> <span style="color: #0066ff">#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; uncomment if you want to debug<br />     </span></font><font face="Courier" size="1"><span style="color: #006600">#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo &quot;HTTP_MAX_THREADS: &lt;$HTTP_MAX_THREADS&gt;&quot;</span><span style="color: #0066ff"></span><br />                   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;                  HTTP_BSY_THREADS=`echo $line |awk &#8216;{print(&quot;,&quot; $11)}&#8217;`<br />     <span style="color: #0066ff">#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; uncomment </span></font><font face="Courier" size="1"><span style="color: #0066ff">below </span></font><font face="Courier" size="1"><span style="color: #0066ff">if you want to debug</span><br />     <span style="color: #006600">#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;                echo &quot;HTTP_BSY_THREADS: &lt;$HTTP_BSY_THREADS&gt;&quot;</span><br />                   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;                  ;;<br />                   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;           *${JKPORT}) read line<br />                   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;                  MODJK_MAX_THREADS=`echo $line |awk &#8216;{print(&quot;,&quot; $3)}&#8217;`<br />     <span style="color: #006600"></span></font><font face="Courier" size="1"><span style="color: #0066ff">#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; uncomment </span></font><font face="Courier" size="1"><span style="color: #0066ff">below </span></font><font face="Courier" size="1"><span style="color: #0066ff">if you want to debug<br />     </span></font><font face="Courier" size="1"><span style="color: #006600">#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo &quot;MODJK_MAX_THREADS: &lt;$MODJK_MAX_THREADS&gt;&quot;</span><br />                   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;                  MODJK_BSY_THREADS=`echo $line |awk &#8216;{print(&quot;,&quot; $11)}&#8217;`<br />     <span style="color: #006600"></span></font><font face="Courier" size="1"><span style="color: #0066ff">#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; uncomment </span></font><font face="Courier" size="1"><span style="color: #0066ff">below </span></font><font face="Courier" size="1"><span style="color: #0066ff">if you want to debug<br />     </span></font><font face="Courier" size="1"><span style="color: #006600">#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;                echo &quot;MODJK_BSY_THREADS: &lt;$MODJK_BSY_THREADS&gt;&quot;</span><span style="color: #0066ff"></span><br />            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;;<br />                   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;           *${APPL}) read line<br />                   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;                  SESSION_CNT=`echo $line |awk &#8216;{print(&quot;,&quot; $3)}&#8217;`<br />     <span style="color: #006600"></span></font><font face="Courier" size="1"><span style="color: #0066ff">#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; uncomment below if you want to debug<br />     </span></font><font face="Courier" size="1"><span style="color: #006600"># &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;               echo &quot;SESSION_CNT: &lt;$SESSION_CNT&gt;&quot;</span><span style="color: #0066ff"></span><br />            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;                         ;;<br />                   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *) ;;<br />                   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;      esac<br />                   &nbsp;&nbsp;&nbsp;    done &lt; /tmp/tomcat-status<br />     <span style="color: #006600">#</span> <span style="color: #0066ff"># Now is the time to write the data to the csv-file</span><br />           &nbsp; echo &quot;${TIME},${JVM_VALUE}${HTTP_MAX_THREADS}${HTTP_BSY_THREADS}<br />      &nbsp; ${MODJK_MAX_THREADS}${MODJK_BSY_THREADS}${SESSION_CNT}&quot; &gt;&gt;$OUTFILE<br />                   exit</font></p>
<p><em>*) be aware that based on word wrapping this script might not work instantly</em> </p>
<p>Create a scriptfile (e.g. tomcat-check.sh) and apply the script to your tomcat. Then edit your crontab.                </p>
<p>There should be a line like:<br />     <strong>&quot;*/5 * * * * cd ~/statistics; ./tomcat-check.sh  1&gt;tomcat-check.log 2&gt;&amp;1&quot;</strong></p>
<p>And then the script should create the csv-files. I&#8217;m not used to excel &#8211; but even I managed to create a more or less interesting diagram from this data. Note how regular the memory behaves while there is no user session.</p>
<p><img alt="Tomcat Monitoring Graphic" title="Tomcat Monitoring Graphic" src="/wp-content/uploads/tomcat/tomcat-graphic-small.jpg" />&nbsp;</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.askthegerman.com%2Farchives%2F274';
  addthis_title  = 'Monitor+your+Tomcat+Servlet+on+a+regular+basis';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://www.askthegerman.com/archives/274/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tomcat Monitoring</title>
		<link>http://www.askthegerman.com/archives/252</link>
		<comments>http://www.askthegerman.com/archives/252#comments</comments>
		<pubDate>Mon, 02 Feb 2009 09:51:02 +0000</pubDate>
		<dc:creator>Volker</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[Web Technologies]]></category>
		<category><![CDATA[8080]]></category>
		<category><![CDATA[Apache Tomcat]]></category>
		<category><![CDATA[csv]]></category>
		<category><![CDATA[java-servlet]]></category>
		<category><![CDATA[java-X]]></category>
		<category><![CDATA[manager]]></category>
		<category><![CDATA[Monitoring]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[protocol]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[server.conf]]></category>
		<category><![CDATA[Status]]></category>
		<category><![CDATA[tomcat-users.xml]]></category>
		<category><![CDATA[userid]]></category>

		<guid isPermaLink="false">http://www.askthegerman.com/?p=252</guid>
		<description><![CDATA[So you have a wonderful java-servlet and you have a stable and reasonable fast application server like tomcat? But sometimes you have performance breakdowns. Sometimes the application seems to be frozen. Sometimes you just want to know what the hell is going on with your application. So the best way is to say: „Please my [...]]]></description>
			<content:encoded><![CDATA[<p>So you have a wonderful java-servlet and you have a stable and reasonable fast application server like tomcat? But sometimes you have performance breakdowns.</p>
<ul>
<li>Sometimes the application seems to be frozen.</li>
<li>Sometimes you just want to know what the hell<br />       is going on with your application.</li>
</ul>
<p>So the best way is to say:<br />   <strong><em>„Please my little tomcat, tell me – how do you feel right now?“</em></strong></p>
<p>And if you choose the right method you will get some answers.<br />           The good news ahead – it isn&#8217;t very difficult to get the information.</p>
<p> You just have to enable the tomcat console. And furthermore you should enable the printout of the garbage collects.<br />   <em>(type &quot;java -X&quot; to get the right gc options for your java-version &#8211; normally something like verbose:gc. I will show you in detail in another article)</em></p>
<p>Just edit the tomcat-users.xml File.</p>
<p>You have to add the roles: manager and admin and add a user and a password that meets your needs. Invent your own username and password and keep it secret. Because userid and password are not encrypted (if you do not explicitly configure https as protocol) you should keep in mind that this is no high sophisticated security.</p>
<p><img alt="Tomcat Monitoring" title="Tomcat Monitoring" src="http://www.askthegerman.com/wp-content/uploads/tomcat/tomcat-monitoring.jpg" height="157" width="429" /></p>
<p>Nevertheless &#8211; save your tomcat-users.xml file and restart tomcat. If your tomcat listens on the standard port (8080) give the manager console a try:</p>
<p><em>http://yourserver-adress:8080/manager/html</em></p>
<p>You will be prompted for a username and password &#8211; if you can remember the values you had put in the tomcat-user.xml file &#8211; go on and put them in. So you can see the console &#8211; not very exciting &#8211; thats true. Here you can just see how many sessions are currently active in an application . And if you want to have fun and you are !not the responsible person for this service you can easily stop an application within the tomcat.</p>
<p>But to be more serious – now choose the link in the upper right corner (Server Status) and again the link in the upper right corner (Complete Server Status).<br />           Or just enter:</p>
<p><em>http://yourserver-adress:8080/manager/status/all</em></p>
<p>Take some time to explore the page. Reload the page several times – look at how the connections fall and rise. Don&#8217;t forget to check the Memory – is enough free memory left ? What is the state of the connections – are there any connections left. How many threads are busy? How many spare threads do you have? Perhaps you have to adjust the values in the server.conf file.</p>
<p>Can you imagine that it is very easy to get this values extracted and in a &quot;cvs&quot;-file on a regular basis ? So you can get historical values &#8211; But that is subject for an own article. </p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.askthegerman.com%2Farchives%2F252';
  addthis_title  = 'Tomcat+Monitoring';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://www.askthegerman.com/archives/252/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Extracting MySQL Data</title>
		<link>http://www.askthegerman.com/archives/241</link>
		<comments>http://www.askthegerman.com/archives/241#comments</comments>
		<pubDate>Mon, 22 Dec 2008 12:50:59 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[CMS]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[Web Technologies]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[address]]></category>
		<category><![CDATA[address book]]></category>
		<category><![CDATA[desc table]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[Gui]]></category>
		<category><![CDATA[Joomla]]></category>
		<category><![CDATA[outfile]]></category>
		<category><![CDATA[statement]]></category>
		<category><![CDATA[use database]]></category>

		<guid isPermaLink="false">http://www.askthegerman.com/?p=241</guid>
		<description><![CDATA[Living in a world of GUIs (Graphical User Interface) many people are no longer aware about what SQL can do. Recently a friend asked me about, is it possible to extract the email adresses of my registered user out of my Joomla? Sure it is! It is not even difficult and the idea behind was [...]]]></description>
			<content:encoded><![CDATA[<p>Living in a world of GUIs (Graphical User Interface) many people are no longer aware about what SQL can do. Recently a friend asked me about, is it possible to extract the email adresses of my registered user out of my Joomla? Sure it is!</p>
<p>It is not even difficult and the idea behind was to load them into some email list to send out season greeting to all subscribers. To keep it simple here I will explain it by using a more common wordpress example, but in principle it can be done for any data the same way. </p>
<p>Most email clients are able to import a CSV (Comma separated List of Values) File by default, as also Excel or Access will &#8216;eat&#8217; them without problems.</p>
<p>Now we have to invoke the MySQL Command Line Client or any other tool which enables us to execute a&nbsp; SQL Statement hopefully we will ending up with such a prompt:</p>
<p><em>mysql&gt; </em></p>
<p>There we first tell MySQL&nbsp; to work with the specific database in question.</p>
<p><em>mysql&gt; use DATABASE</em> &nbsp; &nbsp; (e.q &nbsp; use wordpress)</p>
<p>With the command <em>desc</em> we can get a field description of our table.</p>
<p><em>mysql&gt; desc TABLENAME</em>&nbsp;&nbsp; (e.q.&nbsp; desc wp_users)</p>
<p>Knowing about the table structure now, with <em>select</em> we can extract the data wished:</p>
<p><em>mysql&gt; select user_nicename as Name,user_email as Email from wp_users;<br />        +&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+<br />        | Name&nbsp; | Email&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<br />        +&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+<br />        | admin | admin@localhost.com |<br />        +&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+<br />        1 row in set (0.00 sec)</em></p>
<p>Seeing the output and being sure about the result will match our needs we are now finally going to spool the query result into a file:</p>
<p><em>mysql&gt; select user_nicename,user_email into outfile &#8216;c:/temp/u_emails.csv&#8217; fields terminated by &#8216;;&#8217; from wp_users;<br />        Query OK, 1 row affected (0.01 sec)</em> </p>
<p>Content of &quot;c:/temp/u_email.csv&quot;:</p>
<p><em>admin;admin@localhost.com</em></p>
<p>or as variation:</p>
<p>mysql&gt; select user_nicename,user_email into outfile &#8216;c:/temp/u_emails.txt&#8217; fields enclosed by &#8216;&quot;&#8217; terminated by &#8216;;&#8217; from wp_users;<br />        Query OK, 1 row affected (0.01 sec) </p>
<p>Content of &quot;c:/temp/u_email.csv&quot;:</p>
<p><em>&quot;admin&quot;;&quot;admin@localhost.com&quot;</em></p>
<p>And now it should be easy for you to import all emails addresses within your email client&#8217;s address book.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.askthegerman.com%2Farchives%2F241';
  addthis_title  = 'Extracting+MySQL+Data';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://www.askthegerman.com/archives/241/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Password Protect Webfolders</title>
		<link>http://www.askthegerman.com/archives/227</link>
		<comments>http://www.askthegerman.com/archives/227#comments</comments>
		<pubDate>Sun, 14 Dec 2008 11:55:42 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Operating System]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[UNIX]]></category>
		<category><![CDATA[Webserver]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[.htpasswd]]></category>
		<category><![CDATA[htpasswd2]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[protect]]></category>
		<category><![CDATA[username]]></category>
		<category><![CDATA[webfolder]]></category>
		<category><![CDATA[webroot]]></category>

		<guid isPermaLink="false">http://www.askthegerman.com/?p=227</guid>
		<description><![CDATA[Sometimes we have to place content on our webserver we want to protect and only accessed by privileged users. A basic security can be established by a password restricted folder access, enforced by the Apache Webserver itself. This can be done by some simple instructions added to our .htaccess file: (In case you haven&#8217;t already [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes we have to place content on our webserver we want to protect and only accessed by privileged users.</p>
<p>A basic security can be established by a password restricted folder access, enforced by the Apache Webserver itself.</p>
<p>This can be done by some simple instructions added to our .htaccess file:<br />     (In case you haven&#8217;t already a .htaccess file, just create a new file calling it .htaccess and locating it in the folder you want to protect.) </p>
<p><em>AuthType Basic<br />     AuthName &quot;Protected Area&quot;<br />     AuthUserFile FILE<br />     require valid-user</em></p>
<p>These commands will tell the Apache webserver that the folder in question (and all below) are now protected and it needs a valid combination of username/password to access it.</p>
<ul>
<li><em>AuthName</em> is some free form text you can specify, telling the visitor what you are asking for and Apache Webserver will show in it&#8217;s dialog box.</li>
</ul>
<ul>
<li><em>AuthUserFile</em> is the reference to the stored .htpasswd file containing all valid username/password combinations to access the folder in question (ususally and best located out of the protected directory tree).</li>
</ul>
<p>Having that done we now need to create the necessary .htpasswd file which we can do interactive on our server with the command:</p>
<p><em>htpasswd2 -c FILE USER</em></p>
<p>Assuming html is your webroot, a valid example, for protecting a folder called images below our webroot and using demouser/demopassword as user credentials, would be:</p>
<p><strong>.htaccess:</strong><br />     (Locate this file within the folder images and be aware to use an absolute path for <em>AuthUserFile, </em>as for <em>www.domain.com</em> would be wrong!)</p>
<p><em>AuthUserFile /home/username/html/.htpasswd<br />     AuthType Basic<br />     AuthName &quot;Login for Secure Area&quot;<br />     require valid-user</em> </p>
<p><strong>.htpasswd</strong><br />     (Create a new file called .htpasswd and locate this file within the folder you&#8217;ve specified within <em>AuthUserFile </em>path<em>.</em>)</p>
<p><em>demouser:$1$OHq3K5v3$pvFrGsHjWwYjpkZhc70T9. </em> </p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.askthegerman.com%2Farchives%2F227';
  addthis_title  = 'Password+Protect+Webfolders';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://www.askthegerman.com/archives/227/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up BI Publisher against MySQL</title>
		<link>http://www.askthegerman.com/archives/197</link>
		<comments>http://www.askthegerman.com/archives/197#comments</comments>
		<pubDate>Sun, 07 Dec 2008 17:08:35 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[Web Technologies]]></category>
		<category><![CDATA[Webserver]]></category>
		<category><![CDATA[Apache Tomcat]]></category>
		<category><![CDATA[BI Publisher]]></category>
		<category><![CDATA[Business Intelligence Suit]]></category>
		<category><![CDATA[Classpath]]></category>
		<category><![CDATA[Data Source]]></category>
		<category><![CDATA[JDBC]]></category>
		<category><![CDATA[LAMP]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[WEBDAV]]></category>
		<category><![CDATA[XML]]></category>
		<category><![CDATA[xmlp-server-config.xml]]></category>
		<category><![CDATA[xmlpserver.war]]></category>
		<category><![CDATA[XMPL Server]]></category>

		<guid isPermaLink="false">http://www.askthegerman.com/?p=197</guid>
		<description><![CDATA[Oracle&#8217;s BI Publisher which is part of the Oracle Business Intelligence Suit has at least within Enterprise Computing environment established as a reliable and preferable choice when it comes to replace the somewhat aged Oracle Reports. Once being familiar with it you will ask yourself about why switching tool when it comes to the need [...]]]></description>
			<content:encoded><![CDATA[<p>Oracle&#8217;s BI Publisher which is part of the Oracle Business Intelligence Suit has at least within Enterprise Computing environment established as a reliable and preferable choice when it comes to replace the somewhat aged Oracle Reports.</p>
<p>Once being familiar with it you will ask yourself about why switching tool when it comes to the need of creating reports in a normal web design world mostly using MySQL Databases within a &quot;LAMP&quot; environment.</p>
<p>Written as an universal reporting tool BI Publishes does offer us a more or less universal data interface based on JDBC connections. And being able to act itself as a callable web service offering WEBDAV services based on XML data exchange it anyway seems to be an excellent choice for this world.</p>
<p>Already Oracle&#8217;s installation instructions does give you a quick idea about setting up BI Publisher working against some MySQL Database. But acting&nbsp; in a Web environment you might find it cool integration the BI Publisher within an already existing Apache Tomcat environment and for exactly this environment I will give you a short explanation about getting things together and ready for work.</p>
<p>First we will pick the BI Publisher software itself by copying the xmlpserver.war file from the distribution DVD and throwing it into the webapps folder of our Apache Tomcat. Waiting a few seconds until the self-deploying mechanism of the Apache Tomcat has extracted the files for us, we need to specify the access path to our project and development repository within the file xmlp-server-config.xml.</p>
<p>Having done that, we need to add the MySQL JDBC driver to our system and making it known within the environment of the Apache Tomcat. (The MySQL JDBC driver can be downloaded from: <a href="http://www.mysql.com/products/connector/j/">http://www.mysql.com/products/connector/j/</a>.) </p>
<p>So with the downloaded fileready, we have to extract it to any place we like onto our disk. Just I would recommend you to put it somewhere close to your MySQL installation for you being able to later on remember it again. Finally extracted and ready to use, we have to add the information about the mysql-connector-java- <version>-bin.jar file to the Java Classpath of the Apache Tomcat and finally restarting it:</version></p>
<p><img alt="Configuring Java Classpath" title="Configuring Java Classpath" src="http://www.askthegerman.com/wp-content/uploads/bip/bip01.jpg" height="290" width="300" />&nbsp;</p>
<p>Having this set, as a last step we have to invoke the BI Publisher itself, in which we then will configure the new JDBC data source within the Admin region of it: </p>
<p><img alt="Configuring JDBC Data Source" title="Configuring JDBC Data Source" src="http://www.askthegerman.com/wp-content/uploads/bip/bip02.jpg" height="155" width="400" />&nbsp;</p>
<p>And now with this tweaking ready, MySQL DB should connect, open and work for you like a charm. </p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.askthegerman.com%2Farchives%2F197';
  addthis_title  = 'Setting+up+BI+Publisher+against+MySQL';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://www.askthegerman.com/archives/197/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
